Skip to content

Commit

Permalink
fix:lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalk0 committed Oct 24, 2023
1 parent 0fd4517 commit 1a3d55a
Show file tree
Hide file tree
Showing 8 changed files with 255 additions and 2,009 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"react-app",
"next/core-web-vitals",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@typescript-eslint/parser": "6.8.0",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-react-app": "^7.0.1",
"eslint-config-next": "^13.5.6",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
Expand Down
2,142 changes: 192 additions & 1,950 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import StoreProvider from '@/store';
import React from 'react';
import { Flip, ToastContainer } from 'react-toastify';
import '/public/fontawesome/css/all.min.css'
import '/public/fontawesome/css/all.min.css';

export const metadata = {
charset: 'utf-8',
title: 'TurboBouffe',
description: "Site de gestion de la bouffe de l'UA",
icons: {
icon: '/favicon.ico',
apple: '/logo192.png'
apple: '/logo192.png',
},
themeColor: '#fb560c',
manifest: '/manifest.json',
viewport: {
width: 'device-width',
initialScale: 1,
}
},
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
Expand Down
96 changes: 48 additions & 48 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
'use client'
import React from 'react';
import 'react-toastify/dist/ReactToastify.css';
import 'moment/locale/fr';
import './page.scss';
import moment from 'moment';
import { useDispatch } from 'react-redux';
import Navbar from '@/components/navbar';
import FontAwesome from 'react-fontawesome';
import { logout } from '@/reducers/login';
import { Action } from 'redux';

moment.locale('fr');

const App = () => {
const dispatch = useDispatch();
return (
<>
<Navbar>
<div className="logout" onClick={() => dispatch(logout() as unknown as Action)}>
<FontAwesome name="sign-out-alt" /> Déconnexion
</div>
</Navbar>
{/* <div id="index">
<div onClick={() => history.push('/sell?except=goodies')}>
<FontAwesome name="hamburger" /> Vente de bouffe
</div>
<div onClick={() => history.push('/sell?only=goodies')}>
<FontAwesome name="tshirt" /> Vente de goodies
</div>
<div onClick={() => history.push('/preparation')}>
<FontAwesome name="check" /> Préparation générale
</div>
<div onClick={() => history.push('/preparation?only=pizzas')}>
<FontAwesome name="pizza-slice" /> Préparation des pizzas
</div>
<div onClick={() => history.push('/tv')}>
<FontAwesome name="tv" /> TV
</div>
<div onClick={() => history.push('/items')}>
<FontAwesome name="receipt" /> Gestion des items
</div>
</div> */}
</>
);
};

export default App;
'use client';
import React from 'react';
import 'react-toastify/dist/ReactToastify.css';
import 'moment/locale/fr';
import './page.scss';
import moment from 'moment';
import { useDispatch } from 'react-redux';
import Navbar from '@/components/navbar';
import FontAwesome from 'react-fontawesome';
import { logout } from '@/reducers/login';
import { Action } from 'redux';

moment.locale('fr');

const App = () => {
const dispatch = useDispatch();
return (
<>
<Navbar>
<div className="logout" onClick={() => dispatch(logout() as unknown as Action)}>
<FontAwesome name="sign-out-alt" /> Déconnexion
</div>
</Navbar>
{/* <div id="index">
<div onClick={() => history.push('/sell?except=goodies')}>
<FontAwesome name="hamburger" /> Vente de bouffe
</div>
<div onClick={() => history.push('/sell?only=goodies')}>
<FontAwesome name="tshirt" /> Vente de goodies
</div>
<div onClick={() => history.push('/preparation')}>
<FontAwesome name="check" /> Préparation générale
</div>
<div onClick={() => history.push('/preparation?only=pizzas')}>
<FontAwesome name="pizza-slice" /> Préparation des pizzas
</div>
<div onClick={() => history.push('/tv')}>
<FontAwesome name="tv" /> TV
</div>
<div onClick={() => history.push('/items')}>
<FontAwesome name="receipt" /> Gestion des items
</div>
</div> */}
</>
);
};

export default App;
2 changes: 1 addition & 1 deletion src/components/loginRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const LoginRouter = ({ children }: { children: ReactNode }) => {

if (!state.login.token) return <Login />;

return {children};
return { children };
};

export default LoginRouter;
1 change: 0 additions & 1 deletion src/reducers/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,3 @@ export const tryLogin = (pin: string) => async (dispatch: Dispatch) => {
dispatch(isOnline ? setServerOnline() : setServerOffline());
dispatch(fetchData());
};

13 changes: 9 additions & 4 deletions src/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
import { createLogger } from 'redux-logger';
import thunk from 'redux-thunk';
import reducers from './reducers';
import {configureStore, compose, applyMiddleware} from '@reduxjs/toolkit'
import { configureStore, compose, applyMiddleware } from '@reduxjs/toolkit';
import { Provider } from 'react-redux';

const logger = createLogger({ collapsed: true });
const middleware = [thunk, logger];
const composedEnhancers = compose(applyMiddleware(...middleware), ...[]);
const store = configureStore({reducer: reducers, middleware, enhancers: [composedEnhancers], devTools: process.env.NODE_ENV === 'development',});
const store = configureStore({
reducer: reducers,
middleware,
enhancers: [composedEnhancers],
devTools: process.env.NODE_ENV === 'development',
});

export default function StoreProvider({ children }: {children: React.ReactNode}) {
return <Provider store={store}>{children}</Provider>
export default function StoreProvider({ children }: { children: React.ReactNode }) {
return <Provider store={store}>{children}</Provider>;
}

0 comments on commit 1a3d55a

Please sign in to comment.