-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0950f03
Showing
24 changed files
with
5,310 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Pipeline | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build & Publish | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm install | ||
- name: Build | ||
run: | | ||
npm run build | ||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// material UI empty state | ||
import React from 'react'; | ||
import { NoTransfer } from "@mui/icons-material"; | ||
import { Box, Typography } from "@mui/material"; | ||
|
||
type EmptyStateProps = { | ||
title?: string; | ||
description?: string; | ||
}; | ||
|
||
const EmptyState = ({ title, description }: EmptyStateProps) => { | ||
return ( | ||
<Box sx={{ width: "100%", textAlign: "center" }}> | ||
<NoTransfer fontSize="large" color="disabled" /> | ||
<Typography variant="h6" gutterBottom color="grey"> | ||
{title || "Aucun résultat trouvé"} | ||
</Typography> | ||
<Typography variant="subtitle1" gutterBottom color="grey"> | ||
{description || ""} | ||
</Typography> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default EmptyState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import EmptyState from "./EmptyState"; | ||
|
||
export default EmptyState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
import ErrorMessage from "../ErrorMessage"; | ||
|
||
export default function ErrorBoundary({ error }: { error: Error }) { | ||
return ( | ||
<ErrorMessage | ||
error={error} | ||
message="Une erreur est survenue. Veuillez contacter le support." | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { useRouteError } from "react-router-dom"; | ||
import ErrorBoundary from "./ErrorBoundary"; | ||
|
||
export default function ErrorBoundaryContainer() { | ||
const error = useRouteError(); | ||
return <ErrorBoundary error={error as Error} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { Alert, Typography } from "@mui/material"; | ||
|
||
type ErrorMessageProps = { | ||
error: Error | null; | ||
message?: string; | ||
}; | ||
|
||
const ErrorMessage = ({ error, message }: ErrorMessageProps) => { | ||
return error ? ( | ||
<Alert severity="error"> | ||
{message || "Une erreur est survenue. Veuillez réessayer"} | ||
<br /> | ||
<Typography variant="caption"> | ||
Code d'erreur: {error.message || "Erreur inconnue"} | ||
</Typography> | ||
</Alert> | ||
) : null; | ||
}; | ||
|
||
export default ErrorMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ErrorMessage from "./ErrorMessage"; | ||
|
||
export default ErrorMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { useEffect } from "react"; | ||
import { useLocation } from "react-router-dom"; | ||
|
||
export default function ScrollToTop() { | ||
const { pathname } = useLocation(); | ||
|
||
useEffect(() => { | ||
window.scrollTo(0, 0); | ||
}, [pathname]); | ||
|
||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import EmptyState from "./components/EmptyState/EmptyState"; | ||
import ErrorBoundary from "./components/ErrorBoundary/ErrorBoundary"; | ||
import ErrorMessage from "./components/ErrorMessage"; | ||
import ScrollToTop from "./components/ScrollToTop"; | ||
|
||
export { ScrollToTop, EmptyState, ErrorBoundary, ErrorMessage }; |
Oops, something went wrong.