-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change code structure and refactor layout
- Loading branch information
Showing
10 changed files
with
84 additions
and
84 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 |
---|---|---|
@@ -1,30 +0,0 @@ | ||
# React + TypeScript + Vite | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
|
||
Currently, two official plugins are available: | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
|
||
## Expanding the ESLint configuration | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
|
||
```js | ||
export default { | ||
// other rules... | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json', './tsconfig.node.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
} | ||
``` | ||
|
||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list | ||
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
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
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,28 @@ | ||
export default function HomePage() { | ||
return ( | ||
<> | ||
<div style={{margin: '3rem 8rem', color: '#281900'}}> | ||
<h1 style={{margin: '2rem 0', fontSize: '1.5rem'}}> | ||
🇫🇷 Découvrez Nutripatrol : l'outil de modération en cours de développement pour OpenFoodFacts. | ||
</h1> | ||
<p style={{margin: '2rem 0', fontSize: '1.2rem'}}> | ||
Nutripatrol simplifie la modération des produits alimentaires en proposant une plateforme de ticketing intuitive. Vous pouvez signaler rapidement les erreurs, incohérences ou informations manquantes sur les produits alimentaires répertoriés. | ||
</p> | ||
<p style={{margin: '2rem 0', fontSize: '1.2rem'}}> | ||
Rejoignez-nous pour contribuer à l'amélioration de la base de données OpenFoodFacts et aider les consommateurs du monde entier à prendre des décisions éclairées sur leur alimentation. | ||
</p> | ||
</div> | ||
<div style={{margin: '3rem 8rem', color: '#281900'}}> | ||
<h1 style={{margin: '2rem 0', fontSize: '1.5rem'}}> | ||
🇺🇸 / 🇬🇧 Discover Nutripatrol: the moderation tool currently in development for OpenFoodFacts. | ||
</h1> | ||
<p style={{margin: '2rem 0', fontSize: '1.2rem'}}> | ||
Nutripatrol simplifies the moderation of food products by offering an intuitive ticketing platform. You can quickly report errors, inconsistencies, or missing information on listed food products. | ||
</p> | ||
<p style={{margin: '2rem 0', fontSize: '1.2rem'}}> | ||
Join us in contributing to the improvement of the OpenFoodFacts database and helping consumers worldwide make informed decisions about their diet. | ||
</p> | ||
</div> | ||
</> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import Button from '@mui/material/Button'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
export default function LoginPage() { | ||
return ( | ||
<div className='login-container'> | ||
<h1>Login</h1> | ||
<form> | ||
<label htmlFor="username">Username</label> | ||
<input type="text" id="username" name="username" /> | ||
<label htmlFor="password">Password</label> | ||
<input type="password" id="password" name="password" /> | ||
<input type="submit" value="Submit" /> | ||
</form> | ||
<div style={{margin: '5rem 0', color: '#281900', display: 'flex',flexDirection: "column", alignItems: "center", justifyContent:"center"}}> | ||
<h2 style={{fontSize: '1.4rem', margin: "2rem 0"}}>🇫🇷 Connectez-vous avec votre compte OpenFoodFacts </h2> | ||
<h2 style={{fontSize: '1.4rem', margin: "2rem 0"}}>🇺🇸 / 🇬🇧 Login with your OpenFoodFacts account </h2> | ||
<Button | ||
component={Link} | ||
to={"https://world.openfoodfacts.org/cgi/session.pl"} | ||
variant='contained' | ||
color="primary" | ||
target="_blank" > | ||
Login | ||
</Button> | ||
</div> | ||
) | ||
} |
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
Empty file.
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 |
---|---|---|
@@ -1,15 +1,22 @@ | ||
import { | ||
Route, | ||
Routes | ||
} from "react-router-dom"; | ||
|
||
import './App.css' | ||
import LayoutMenu from '../components/Layouts/LayoutMenu' | ||
import HomePage from '../pages/HomePage.tsx' | ||
import ModerationPage from '../pages/ModerationPage.tsx' | ||
import LoginPage from '../pages/LoginPage.tsx' | ||
import LayoutMenu from "../components/Layouts/LayoutMenu.tsx"; | ||
|
||
function App() { | ||
return ( | ||
<> | ||
<LayoutMenu> | ||
Homepage 🚪 | ||
</LayoutMenu> | ||
</> | ||
) | ||
} | ||
|
||
export default App | ||
export default function App() { | ||
return ( | ||
<LayoutMenu> | ||
<Routes> | ||
<Route path="/" element={<HomePage />} /> | ||
<Route path="/moderation" element={< ModerationPage/>} /> | ||
<Route path="/login" element={<LoginPage />} /> | ||
<Route path="*" element={<h1>Not Found</h1>} /> | ||
</Routes> | ||
</LayoutMenu> | ||
) | ||
} |
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
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 |
---|---|---|
@@ -1,21 +1,13 @@ | ||
import ReactDOM from 'react-dom/client' | ||
import { | ||
BrowserRouter as Router, | ||
Route, | ||
Routes | ||
} from "react-router-dom"; | ||
import App from './App.tsx' | ||
import ModerationPage from '../pages/ModerationPage.tsx' | ||
import LoginPage from '../pages/LoginPage.tsx' | ||
import ReactDOM from "react-dom/client"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
import App from './App' | ||
import './index.css' | ||
import React from "react"; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')!).render( | ||
<Router> | ||
<Routes> | ||
<Route path="/" element={<App />} /> | ||
<Route path="/moderation" element={< ModerationPage/>} /> | ||
<Route path="/login" element={<LoginPage />} /> | ||
<Route path="*" element={<h1>Not Found</h1>} /> | ||
</Routes> | ||
</Router>, | ||
<React.StrictMode> | ||
<BrowserRouter> | ||
<App /> | ||
</BrowserRouter> | ||
</React.StrictMode> | ||
) |