Skip to content

Commit

Permalink
cleaning up unused files and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrotap committed Jul 25, 2022
1 parent 231786f commit eaf6a35
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 184 deletions.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
# React with Apollo and JWT
# react-apollo-jwt

## Description

Sample App using MERN stack and JWT Authentication

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![badmath](https://img.shields.io/github/languages/top/nitrotap/react-apollo-jwt)
![badmath](https://img.shields.io/github/languages/top/nitrotap/nitrotap/react-apollo-jwt)
![badmath](https://img.shields.io/github/issues/nitrotap/react-apollo-jwt)
![badmath](https://img.shields.io/github/forks/nitrotap/react-apollo-jwt)
![badmath](https://img.shields.io/github/stars/nitrotap/react-apollo-jwt)

## Table of Contents

- [Installation](#Installation)
- [Questions](#Questions)
- [License](#License)

## Installation

npm i

## Questions

Please reach out to me on [GitHub](https://github.com/nitrotap) or by email at [email protected] for any additional questions.

## License

MIT

Copyright 2022 nitrotap
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 changes: 9 additions & 14 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@mui/material": "^5.8.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
"@testing-library/user-event": "^14.3.0",
"graphql": "^16.5.0",
"jwt-decode": "^3.1.2",
"react": "^18.2.0",
Expand Down
11 changes: 1 addition & 10 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import * as React from 'react';
import Box from '@mui/material/Box';
import CssBaseline from '@mui/material/CssBaseline';




//apollo
import {
ApolloClient,
Expand Down Expand Up @@ -42,14 +39,8 @@ const client = new ApolloClient({
cache: new InMemoryCache(),
});





export default function App() {



return (
<ApolloProvider client={client}>
<Box sx={{ marginTop: '30px', marginBottom: '60px' }}>
Expand All @@ -58,7 +49,7 @@ export default function App() {
<CssBaseline />

<Routes>
{/* <Route path="/" element={<Home />} /> */}
<Route path="/" element={<Signup />} />
<Route path="signup" element={<Signup />} />
<Route path="login" element={<Login />} />
</Routes>
Expand Down
Binary file removed client/src/assets/images/jumbo.jpg
Binary file not shown.
Binary file removed client/src/assets/images/jumbo2.jpg
Binary file not shown.
151 changes: 70 additions & 81 deletions client/src/pages/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Auth from '../utils/auth';
import * as React from 'react';
import Avatar from '@mui/material/Avatar';
import Button from '@mui/material/Button';
import CssBaseline from '@mui/material/CssBaseline';
import TextField from '@mui/material/TextField';
import FormControlLabel from '@mui/material/FormControlLabel';
import Checkbox from '@mui/material/Checkbox';
Expand All @@ -18,14 +17,9 @@ import Box from '@mui/material/Box';
import LockOutlinedIcon from '@mui/icons-material/LockOutlined';
import Typography from '@mui/material/Typography';
import Container from '@mui/material/Container';
import { createTheme, ThemeProvider } from '@mui/material/styles';

import Copyright from '../components/Elements/Copyright';



const theme = createTheme();

function Login(props) {
const [formState, setFormState] = useState({ email: '', password: '' });
const [login, { error }] = useMutation(LOGIN);
Expand Down Expand Up @@ -87,84 +81,79 @@ function Login(props) {


return (
<Container>
<ThemeProvider theme={theme}>
<Container component="main" maxWidth="xs" sx={{
backgroundColor: 'white', marginTop: '100px', marginBottom: '250px',
}}>
<CssBaseline />
<Box
sx={{
marginTop: 8,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
<Container component="main" maxWidth="xs" sx={{
backgroundColor: 'white', marginTop: '100px', marginBottom: '250px',
}}>
<Box
sx={{
marginTop: 8,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<Avatar sx={{ m: 1, bgcolor: 'secondary.main' }}>
<LockOutlinedIcon />
</Avatar>
<Typography component="h1" variant="h5">
Sign in
</Typography>
<Box component="form" onSubmit={handleFormSubmit} noValidate sx={{ mt: 1 }}>
<TextField
margin="normal"
required
fullWidth
id="email"
label="Email Address"
name="email"
autoComplete="email"
autoFocus
onChange={handleChangeEmail}
error={!emailState}
helperText={emailHelper}
/>
<TextField
margin="normal"
required
fullWidth
name="password"
label="Password"
type="password"
id="password"
autoComplete="current-password"
onChange={handleChangePw}
error={!passwordState}
helperText={pwHelper}
/>
<FormControlLabel
control={<Checkbox value="remember" color="primary" />}
label="Remember me"
checked={checked}
onChange={() => setChecked(!checked)}
/>
<Button
type="submit"
fullWidth
variant="contained"
sx={{ mt: 3, mb: 2 }}
>
<Avatar sx={{ m: 1, bgcolor: 'secondary.main' }}>
<LockOutlinedIcon />
</Avatar>
<Typography component="h1" variant="h5">
Sign in
</Typography>
<Box component="form" onSubmit={handleFormSubmit} noValidate sx={{ mt: 1 }}>
<TextField
margin="normal"
required
fullWidth
id="email"
label="Email Address"
name="email"
autoComplete="email"
autoFocus
onChange={handleChangeEmail}
error={!emailState}
helperText={emailHelper}
/>
<TextField
margin="normal"
required
fullWidth
name="password"
label="Password"
type="password"
id="password"
autoComplete="current-password"
onChange={handleChangePw}
error={!passwordState}
helperText={pwHelper}
/>
<FormControlLabel
control={<Checkbox value="remember" color="primary" />}
label="Remember me"
checked={checked}
onChange={() => setChecked(!checked)}
/>
<Button
type="submit"
fullWidth
variant="contained"
sx={{ mt: 3, mb: 2 }}
>
Sign In
</Button>
<Grid container>
<Grid item xs>
{/* <Link href="#" variant="body2">
Sign In
</Button>
<Grid container>
<Grid item xs>
{/* <Link href="#" variant="body2">
Forgot password?
</Link> */}
</Grid>
<Grid item>
<Link to="/signup" variant="body2">
{"Don't have an account? Sign Up"}
</Link>
</Grid>
</Grid>
</Box>
</Box>
<Copyright sx={{ mt: 8, mb: 4 }} />
</Container>
</ThemeProvider>
</Grid>
<Grid item>
<Link to="/signup" variant="body2">
{"Don't have an account? Sign Up"}
</Link>
</Grid>
</Grid>
</Box>
</Box>
<Copyright sx={{ mt: 8, mb: 4 }} />
</Container>
);
}
Expand Down
Loading

0 comments on commit eaf6a35

Please sign in to comment.