@@ -21,81 +21,26 @@ import { Markdown } from "./Markdown";
2121# 🔧 Initial setup
2222
2323_ Setup ` @codegouvfr/react-dsfr ` in your project_
24-
25- <Alert
26- severity = " warning"
27- title = " Warning: If you already had the DSFR installed in your project"
28- isClosable
29- description = { <Markdown >{ `
30- * Remove [\` @gouvfr/dsfr\` ](https://www.npmjs.com/package/@gouvfr/dsfr) from your dependencies.
31- * Remove all imports: \` dsfr.css\` , \` dsfr.module.js\` the favicon and the fonts.
32- * Remove the \` data-fr-scheme\` (and \` data-fr-theme\` ) attribude from your \` <html/>\` tag. `
33- } </Markdown >}
34- />
3524
36- ``` bash
25+
26+ <Markdown >{ `
27+ \`\`\` bash {0}
3728yarn add @codegouvfr/react-dsfr # Or: 'npm install --save @codegouvfr/react-dsfr'
38- ```
29+ \`\`\`
30+ ` } </Markdown >
3931
40- export const craContent = <Markdown >{ `
32+
33+ <Markdown >{ `
4134#### package.json
4235
43- \`\`\` diff {0}
36+ \`\`\` diff
4437 "scripts": {
4538+ "postinstall": "copy-dsfr-to-public"
4639+ "prestart": "only-include-used-icons",
4740+ "prebuild": "only-include-used-icons"
4841 }
4942\`\`\`
5043
51- \` copy-dsfr-to-public\` is a \` bin\` script of \` @codegouvfr/react-dsfr\` that copies \` @gouvfr/dsfr/dist\` into \` public/dsfr\`
52-
53- #### .gitignore
54-
55- \`\`\` diff {0}
56- + /public/dsfr
57- \`\`\`
58-
59- #### public/index.html
60-
61- Add the following code in the \` <head />\`
6244
63- \`\`\` ejs {0}
64- <link rel="apple-touch-icon" href="%PUBLIC_URL%/dsfr/favicon/apple-touch-icon.png" />
65- <link rel="icon" href="%PUBLIC_URL%/dsfr/favicon/favicon.svg" type="image/svg+xml" />
66- <link rel="shortcut icon" href="%PUBLIC_URL%/dsfr/favicon/favicon.ico" type="image/x-icon" />
67- <link rel="manifest" href="%PUBLIC_URL%/dsfr/favicon/manifest.webmanifest" crossorigin="use-credentials" />
68- <link rel="stylesheet" href="%PUBLIC_URL%/dsfr/dsfr.min.css" />
69- <link rel="stylesheet" href="%PUBLIC_URL%/dsfr/utility/icons/icons.min.css" />
70- \`\`\`
71-
72- #### src/index.tsx
73-
74- \`\`\` diff {0}
75- import React from 'react';
76- import ReactDOM from 'react-dom/client';
77- import App from './App';
78- +import { startDsfrReact } from "@codegouvfr/react-dsfr";
79- +startDsfrReact({ "defaultColorScheme": "system" });
80- const root = ReactDOM.createRoot(
81- document.getElementById('root') as HTMLElement
82- );
83- root.render(
84- <React.StrictMode>
85- <App />
86- </React.StrictMode>
87- );
88- \`\`\`
89-
90- You can find an example setup [here](https://github.com/codegouvfr/dsfr-react/tree/main/src/test/frameworks/cra).
91-
92- ` } </Markdown >;
45+ ` } </Markdown >
9346
94-
95- <Tabs
96- tabs = { [
97- { " label" : " Create React App" , " content" : craContent },
98- { " label" : " Tab 2" , " iconId" : " fr-icon-ball-pen-fill" , " content" : <p >Content of tab2</p > },
99- { " label" : " Tab 3" , " content" : <p >Content of tab3</p > }
100- ]}
101- />
0 commit comments