From 9b950365f4494a2cdb67fd883967130175a10c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Mon, 3 Jul 2023 18:28:20 +0200 Subject: [PATCH] Add github link in footer --- site/source/components/Contact.tsx | 1 - site/source/components/MoreInfosOnUs.tsx | 20 +------ .../components/layout/Footer/Footer.tsx | 20 +++++++ site/source/components/ui/SocialIcon.tsx | 52 ------------------- site/source/design-system/icons/index.tsx | 18 +++++++ site/source/pages/integration/Options.tsx | 17 +----- 6 files changed, 42 insertions(+), 86 deletions(-) delete mode 100644 site/source/components/ui/SocialIcon.tsx diff --git a/site/source/components/Contact.tsx b/site/source/components/Contact.tsx index c81872f3b..cb67f4f68 100644 --- a/site/source/components/Contact.tsx +++ b/site/source/components/Contact.tsx @@ -1,7 +1,6 @@ import { Trans, useTranslation } from 'react-i18next' import { Message, PopoverWithTrigger } from '@/design-system' -import { H2 } from '@/design-system/typography/heading' import { Link, StyledLink } from '@/design-system/typography/link' import { Li, Ul } from '@/design-system/typography/list' import { Body } from '@/design-system/typography/paragraphs' diff --git a/site/source/components/MoreInfosOnUs.tsx b/site/source/components/MoreInfosOnUs.tsx index afe97c3f7..fd707776a 100644 --- a/site/source/components/MoreInfosOnUs.tsx +++ b/site/source/components/MoreInfosOnUs.tsx @@ -3,12 +3,11 @@ import { useLocation } from 'react-router-dom' import { SmallCard } from '@/design-system/card' import { Emoji } from '@/design-system/emoji' +import { GithubIcon } from '@/design-system/icons' import { Grid } from '@/design-system/layout' import { H2 } from '@/design-system/typography/heading' import { useSitePaths } from '@/sitePaths' -import { icons } from './ui/SocialIcon' - export default function MoreInfosOnUs() { const { pathname } = useLocation() const { absoluteSitePaths } = useSitePaths() @@ -57,22 +56,7 @@ export default function MoreInfosOnUs() { )} - - - - - } + icon={} href="https://github.com/betagouv/mon-entreprise" title={

Le code source

} > diff --git a/site/source/components/layout/Footer/Footer.tsx b/site/source/components/layout/Footer/Footer.tsx index 531b29214..7b78eda29 100644 --- a/site/source/components/layout/Footer/Footer.tsx +++ b/site/source/components/layout/Footer/Footer.tsx @@ -11,6 +11,7 @@ import { Button } from '@/design-system/buttons' import { Emoji } from '@/design-system/emoji' import { FooterContainer } from '@/design-system/footer' import { FooterColumn } from '@/design-system/footer/column' +import { GithubIcon } from '@/design-system/icons' import { Container, Grid } from '@/design-system/layout' import { Link } from '@/design-system/typography/link' import { Body } from '@/design-system/typography/paragraphs' @@ -152,6 +153,25 @@ export default function Footer() { )} + + + + Voir le code source sur Github + {' '} + + + {altHref && ( diff --git a/site/source/components/ui/SocialIcon.tsx b/site/source/components/ui/SocialIcon.tsx deleted file mode 100644 index 25da87016..000000000 --- a/site/source/components/ui/SocialIcon.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import styled from 'styled-components' - -export const icons = { - facebook: { - icon: 'M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z', - mask: 'M0,0v64h64V0H0z M39.6,22l-2.8,0c-2.2,0-2.6,1.1-2.6,2.6V28h5.3l-0.7,5.3h-4.6V47h-5.5V33.3H24V28h4.6V24 c0-4.6,2.8-7,6.9-7c2,0,3.6,0.1,4.1,0.2V22z', - label: 'Facebook', - }, - twitter: { - icon: 'M48,22.1c-1.2,0.5-2.4,0.9-3.8,1c1.4-0.8,2.4-2.1,2.9-3.6c-1.3,0.8-2.7,1.3-4.2,1.6 C41.7,19.8,40,19,38.2,19c-3.6,0-6.6,2.9-6.6,6.6c0,0.5,0.1,1,0.2,1.5c-5.5-0.3-10.3-2.9-13.5-6.9c-0.6,1-0.9,2.1-0.9,3.3 c0,2.3,1.2,4.3,2.9,5.5c-1.1,0-2.1-0.3-3-0.8c0,0,0,0.1,0,0.1c0,3.2,2.3,5.8,5.3,6.4c-0.6,0.1-1.1,0.2-1.7,0.2c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,3.8-0.2,4.2c-1,1.1-1.6,2.5-1.6,4.3c0,6.1,3.7,7.5,7.3,7.9 c-0.5,0.4-0.9,1.1-1,2.1c-0.9,0.4-3.2,1.1-4.7-1.3c0,0-0.8-1.5-2.5-1.6c0,0-1.6,0-0.1,1c0,0,1,0.5,1.8,2.3c0,0,0.9,3.1,5.4,2.1 c0,1.3,0,2.3,0,2.7c0,0.4-0.3,0.9-1.1,0.8C20.6,45.1,16,39.1,16,32c0-8.8,7.2-16,16-16c8.8,0,16,7.2,16,16 C48,39.1,43.4,45.1,37.1,47.2z', - label: 'GitHub', - }, - email: { - icon: 'M17,22v20h30V22H17z M41.1,25L32,32.1L22.9,25H41.1z M20,39V26.6l12,9.3l12-9.3V39H20z', - mask: 'M41.1,25H22.9l9.1,7.1L41.1,25z M44,26.6l-12,9.3l-12-9.3V39h24V26.6z M0,0v64h64V0H0z M47,42H17V22h30V42z', - label: 'e-mail', - }, -} - -const FilledG = styled.g` - fill: ${({ theme }) => theme.colors.bases.primary[700]}; -` - -export default function SocialIcon({ media }: { media: keyof typeof icons }) { - return ( - - - - - - ) -} diff --git a/site/source/design-system/icons/index.tsx b/site/source/design-system/icons/index.tsx index 73562bf37..8a8a07cd1 100644 --- a/site/source/design-system/icons/index.tsx +++ b/site/source/design-system/icons/index.tsx @@ -402,3 +402,21 @@ export const WarningIcon = (props: HTMLAttributes) => ( /> ) + +export const GithubIcon = (props: HTMLAttributes) => ( + + + +) diff --git a/site/source/pages/integration/Options.tsx b/site/source/pages/integration/Options.tsx index b71a763f6..a3f370e49 100644 --- a/site/source/pages/integration/Options.tsx +++ b/site/source/pages/integration/Options.tsx @@ -1,9 +1,9 @@ import { Trans, useTranslation } from 'react-i18next' import PageHeader from '@/components/PageHeader' -import { icons } from '@/components/ui/SocialIcon' import { Card } from '@/design-system/card' import { Emoji } from '@/design-system/emoji' +import { GithubIcon } from '@/design-system/icons' import { Grid } from '@/design-system/layout' import { Body, Intro } from '@/design-system/typography/paragraphs' import { useSitePaths } from '@/sitePaths' @@ -146,20 +146,7 @@ export default function Options() { - - - - + } title={t( 'pages.développeur.choice.github.title',