Skip to content

Commit

Permalink
feat: landing-v2 (#169)
Browse files Browse the repository at this point in the history
* feat: landing-v2

* clean

* clean

* clean

* fix styles

* postinstall maybe

* postinstall maybe

* track store redirection + light mode only + fix image + le monde

* clean
  • Loading branch information
arnaudambro authored May 22, 2024
1 parent a25375e commit 85c51b3
Show file tree
Hide file tree
Showing 21 changed files with 12,289 additions and 24 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN yarn fetch --immutable && yarn cache clean

COPY . .

RUN yarn postinstall

ENV NEXT_PUBLIC_MATOMO_SITE_ID="34"
ENV NEXT_PUBLIC_MATOMO_URL="https://matomo.fabrique.social.gouv.fr/"
ENV NODE_ENV=production
Expand Down
19 changes: 19 additions & 0 deletions app/StartDsfr.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use client"

import { startReactDsfr } from "@codegouvfr/react-dsfr/next-appdir"
import { defaultColorScheme } from "./defaultColorScheme"
import Link from "next/link"

declare module "@codegouvfr/react-dsfr/next-appdir" {
// eslint-disable-next-line no-unused-vars
interface RegisterLink {
Link: typeof Link
}
}

startReactDsfr({ defaultColorScheme, Link })

export function StartDsfr() {
//Yes, leave null here.
return null
}
2 changes: 1 addition & 1 deletion app/blog/[blog]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function Blog({ params }) {

const components = {
DownloadButtons: () => (
<div className="mb-1 grid max-w-[200px] sm:max-w-[400px] sm:grid-flow-col gap-6 auto-cols-fr md:w-5/6 m-auto">
<div className="mt-[70px] mb-1 grid max-w-[200px] sm:max-w-[400px] sm:grid-flow-col gap-6 auto-cols-fr md:w-5/6 m-auto">
<a href={ANDROID_URL} target="_blank" rel="noopener noreferrer">
<img
className="object-contain w-full"
Expand Down
4 changes: 2 additions & 2 deletions app/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function Blog() {
const posts = await getBlogPosts()

return (
<>
<div className="mt-[70px]">
<DownloadPopupStandalone />
<div className="flex flex-col min-h-screen">
<Navigation />
Expand Down Expand Up @@ -45,7 +45,7 @@ export default async function Blog() {
</div>
<Footer />
</div>
</>
</div>
)
}

Expand Down
3 changes: 3 additions & 0 deletions app/defaultColorScheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { DefaultColorScheme } from "@codegouvfr/react-dsfr/next-appdir"

export const defaultColorScheme: DefaultColorScheme = "system"
43 changes: 43 additions & 0 deletions app/fb-redirection/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { DsfrProvider } from "@codegouvfr/react-dsfr/next-appdir/DsfrProvider"
import Head from "next/head"
import { StartDsfr } from "~/app/StartDsfr"
import { DsfrHead } from "@codegouvfr/react-dsfr/next-appdir/DsfrHead"
import Link from "next/link"

/*
Note: normally we can't use <Head> with next 14
but here we don't want to use react dsfr in our whole appn because it's breaking all the styles
so we use it only in this nested layout
this breaks the pattern for which it was designed so we need to
- use <Head>
- patch package @codegouvfr/react-dsfr
*/
export default function Layout({ children }) {
const lang = "fr"
return (
<>
<Head>
<StartDsfr />
<DsfrHead
Link={Link}
preloadFonts={[
//"Marianne-Light",
//"Marianne-Light_Italic",
"Marianne-Regular",
//"Marianne-Regular_Italic",
"Marianne-Medium",
//"Marianne-Medium_Italic",
"Marianne-Bold",
//"Marianne-Bold_Italic",
//"Spectral-Regular",
//"Spectral-ExtraBold"
]}
/>
</Head>
<DsfrProvider lang={lang}>{children}</DsfrProvider>
</>
)
}
Loading

0 comments on commit 85c51b3

Please sign in to comment.