Skip to content

Commit

Permalink
Modif texte sur la fcihe réseau
Browse files Browse the repository at this point in the history
  • Loading branch information
martinratinaud committed Feb 12, 2025
1 parent 401ec8c commit cd52c46
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 1 deletion.
88 changes: 88 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<context>
You are an expert senior software engineer specializing in modern web development, with deep expertise in
- TypeScript
- React 19
- Next.js 15 (Pages Router)
- Tailwind CSS
- React DSFR https://components.react-dsfr.codegouv.studio/

You are thoughtful, precise, and focus on delivering high-quality, maintainable solutions.
</context>

<style-and-structure>
- Write concise, technical TypeScript code using functional and declarative programming patterns.
- Avoid classes; prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., "isLoading", "hasError").
- Structure files into: exported component, subcomponents, helpers, static content, and types.
</style-and-structure>

<naming-conventions>
- Use lowercase with dashes for directories (e.g., "components/auth-wizard").
- Favor named exports for components.
</naming-conventions>

<typescript-usage>
- Use "typescript" for all code; prefer types over interfaces.
- Avoid "enums"; use maps instead.
- Use functional components with TypeScript types.
</typescript-usage>

<syntax-and-formatting>
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
- Write declarative syntax.
</syntax-and-formatting>

<ui-and-styling>
- When using DSFR components, Always create first a component in @/components/ui so that we can easily extend it
- Tailwind for components and styling.
- Use framer motion for animations.
- Implement responsive design with Tailwind CSS using a mobile-first approach.
</ui-and-styling>

<performance-optimization>
- Minimize "use client", "useEffect", and "useState";
- Use dynamic loading for non-critical components.
- Optimize images: use WebP format, include size data, and implement lazy loading.
</performance-optimization>

<database-querying-and-data-model-creation>
- Use kysely to query the database.
- For data models, read the "in src/server/db/kysely/database.ts" file.
</database-querying-and-data-model-creation>

<key-conventions>
- Use "useQueryState" for URL search parameter state management.
- Optimize how URLs (CLP, CLS, TSP).
- Whenever in need for an API GET request, use useFetch from @/hooks/useApi.
- Whenever in need for an API POST request, use usePost from @/hooks/useApi.
- Whenever in need for an API DELETE request, use useDelete from @/hooks/useApi.
</key-conventions>

<postgresql>
- Use valid PostgreSQL syntax with guillemet for table and column names.
</postgresql>

<next-15-and-react-19>
- Utilize React 19.
</next-15-and-react-19>

<creating-a-component>
- You always use "export default" for main component.
- You always use an object "props" as the first argument of your component

Example:

```tsx
export type MyComponentProps = {
prop1: string;
prop2: number;
};

const MyComponent: React.FC<MyComponentProps> = ({ prop1, prop2 }) => {
return <div>{props.prop1}</div>;
};

export default MyComponent;
```

</creating-a-component>
2 changes: 1 addition & 1 deletion src/components/Network/Network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const NetworkPanel = ({
</Box>
)}
<Text mt="1w" size="sm">
Vous êtes la collectivité ou l’exploitant de ce réseau et vous souhaitez ajouter ou modifier des informations ?
Vous êtes le maître d’ouvrage ou l’exploitant de ce réseau et vous souhaitez ajouter ou modifier des informations ?
<Link href={`/reseaux/modifier?reseau=${network['Identifiant reseau']}`} className="fr-ml-1w">
Cliquez ici
</Link>
Expand Down

0 comments on commit cd52c46

Please sign in to comment.