Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: intégration du cerfa #3622

Merged
merged 6 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions shared/constants/plausible-goals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export const plausibleGoals = [
// - Page Effectifs Doublons
"suppression_doublons_effectifs",
"suppression_doublons_effectifs_en_lot",

// - Cerfa
"clic_redirection_cerfa",
] as const;

export type PlausibleGoalType = (typeof plausibleGoals)[number];
Expand Down
79 changes: 79 additions & 0 deletions ui/components/Cerfa/CerfaLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { Box, HStack, Text, Image, Button, Link } from "@chakra-ui/react";

import { Organisme } from "@/common/internal/Organisme";
import { usePlausibleTracking } from "@/hooks/plausible";
import Edition from "@/theme/components/icons/Edition";

const style = {
width: "330px",
maxWidth: "330px",
borderRadius: "8px",
opacity: 0.8,
padding: "16px",
background:
"linear-gradient(282deg, #FCEEAC 0%, #FFE4B9 9.5%, #FFDFCD 21.5%, #FFDEE1 27.5%, #FFE1EE 38%, #FDE3F4 46%, #FBE6FA 55%, #F8E9FF 63.5%, #F3EAFF 72%, #EFEBFF 82%, #EBECFF 91.5%, #EFEBFF 100%)",
boxShadow: "0px 4px 4px 0px rgba(0, 0, 0, 0.25), 0px 4px 4px 0px rgba(0, 0, 0, 0.25)",
};

const titleStyle = {
color: "#0063CB",
fontSize: "16px",
fontWeight: 700,
};

const contentStyle = {
color: "#161616",
fontSize: "14px",
fontWeight: 400,
lineHeight: "24px",
};

const buttonStyle = {
color: "#F5F5FE",
fontSize: "16px",
fontWeight: 500,
};

interface CerfaLinkProps {
organisme: Organisme;
}
const CerfaLink = (props: CerfaLinkProps) => {
const externaLink = `https://contrat.apprentissage.beta.gouv.fr/cerfa?utm_source=tdb&utm_content=${props.organisme._id}`;
const { trackPlausibleEvent } = usePlausibleTracking();

const onLinkClicked = () => {
trackPlausibleEvent("clic_redirection_cerfa", undefined, {
uai: props.organisme?.uai?.toString() ?? "",
siret: props.organisme.siret,
});
};

return (
<Box style={style}>
<HStack>
<Box>
<HStack mb={"12px"}>
<Image flex={1} src="/images/cerfa/avatar.svg" alt="Logo République française" userSelect="none" />
<Text flex={8} style={titleStyle}>
{" "}
Un contrat d&apos;apprentissage ?
</Text>
</HStack>
<Text mb={"12px"} fontSize={14} style={contentStyle}>
Remplissez vos prochains contrats CERFA : simple, rapide et sans erreur.
</Text>
<Link href={externaLink} onClick={onLinkClicked} isExternal>
<Button variant="primary" padding={"8px 24px"} mr={1}>
<Edition></Edition>
<Text ml={2} style={buttonStyle}>
Démarrer un contrat CERFA
</Text>
</Button>
</Link>
</Box>
</HStack>
</Box>
);
};

export default CerfaLink;
Loading
Loading