Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 3 additions & 31 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,17 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>

<title>Visual Regression Tracker</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

18 changes: 5 additions & 13 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import {
MenuItem,
} from "@material-ui/core";
import { Link } from "react-router-dom";
import {
useAuthState,
useAuthDispatch,
logout,
} from "../contexts";
import { useAuthState, useAuthDispatch, logout } from "../contexts";
import { routes } from "../constants";

const Header: FunctionComponent = () => {
Expand Down Expand Up @@ -65,15 +61,11 @@ const Header: FunctionComponent = () => {
<React.Fragment>
<AppBar position="static" color="default">
<Toolbar>
<Grid container justify="space-between">
<Grid container justify="space-between" alignItems="center">
<Grid item>
<Grid container>
<Grid item>
<Link to="/">
<img src="/logo512.png" width="40" height="40" alt="logo" />
</Link>
</Grid>
</Grid>
<Link to="/">
<img src="/logo.png" width="60" height="60" alt="logo" />
</Link>
</Grid>
<Grid item>
{loggedIn && (
Expand Down
255 changes: 130 additions & 125 deletions src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
CardActions,
Button,
Typography,
Box,
} from "@material-ui/core";
import { useAuthState, useAuthDispatch, update } from "../contexts";
import { usersService } from "../services";
Expand Down Expand Up @@ -64,138 +65,142 @@ const ProfilePage = () => {
};

return (
<Grid
container
spacing={4}
direction="column"
alignItems="center"
justify="center"
style={{ minHeight: "60vh" }}
>
<Grid item>
<Card variant="outlined">
<CardContent>
<Typography>apiKey: {user?.apiKey}</Typography>
</CardContent>
</Card>
</Grid>
<Grid item>
<form onSubmit={handleUserUpdateSubmit}>
<Box mt={2}>
<Grid
container
spacing={4}
direction="column"
alignItems="center"
justify="center"
style={{ minHeight: "60vh" }}
>
<Grid item>
<Card variant="outlined">
<CardContent>
<Grid container spacing={2}>
<Grid item xs={6}>
<TextField
id="firstName"
name="firstName"
value={firstName}
label={"First name"}
type="text"
variant="outlined"
required
fullWidth
inputProps={{
onChange: (event) =>
setFirstName((event.target as HTMLInputElement).value),
"data-testid": "firstName",
}}
/>
</Grid>
<Grid item xs={6}>
<TextField
id="lastName"
name="lastName"
value={lastName}
label={"Last name"}
type="text"
variant="outlined"
required
fullWidth
inputProps={{
onChange: (event) =>
setLastName((event.target as HTMLInputElement).value),
"data-testid": "lastName",
}}
/>
</Grid>
<Grid item xs={12}>
<TextField
id="email"
name="email"
value={email}
label={"Email address"}
type="text"
variant="outlined"
required
fullWidth
inputProps={{
onChange: (event) =>
setEmail((event.target as HTMLInputElement).value),
"data-testid": "email",
}}
/>
</Grid>
</Grid>
<Typography>apiKey: {user?.apiKey}</Typography>
</CardContent>
<CardActions>
<Grid container justify="center">
<Grid item>
<Button
type="submit"
color="primary"
variant="outlined"
data-testid="submit"
>
Update
</Button>
</Grid>
</Grid>
</CardActions>
</Card>
</form>
</Grid>
<Grid item>
<form onSubmit={handlePasswordUpdateSubmit}>
<Card variant="outlined">
<CardContent>
<Grid container spacing={2}>
<Grid item xs={12}>
<TextField
id="password"
name="password"
value={password}
label={"New password"}
type="password"
variant="outlined"
required
fullWidth
inputProps={{
onChange: (event) =>
setPassword((event.target as HTMLInputElement).value),
"data-testid": "password",
}}
/>
</Grid>
<Grid item>
<form onSubmit={handleUserUpdateSubmit}>
<Card variant="outlined">
<CardContent>
<Grid container spacing={2}>
<Grid item xs={6}>
<TextField
id="firstName"
name="firstName"
value={firstName}
label={"First name"}
type="text"
variant="outlined"
required
fullWidth
inputProps={{
onChange: (event) =>
setFirstName(
(event.target as HTMLInputElement).value
),
"data-testid": "firstName",
}}
/>
</Grid>
<Grid item xs={6}>
<TextField
id="lastName"
name="lastName"
value={lastName}
label={"Last name"}
type="text"
variant="outlined"
required
fullWidth
inputProps={{
onChange: (event) =>
setLastName((event.target as HTMLInputElement).value),
"data-testid": "lastName",
}}
/>
</Grid>
<Grid item xs={12}>
<TextField
id="email"
name="email"
value={email}
label={"Email address"}
type="text"
variant="outlined"
required
fullWidth
inputProps={{
onChange: (event) =>
setEmail((event.target as HTMLInputElement).value),
"data-testid": "email",
}}
/>
</Grid>
</Grid>
</Grid>
</CardContent>
<CardActions>
<Grid container justify="center">
<Grid item>
<Button
type="submit"
color="primary"
variant="outlined"
data-testid="submit"
>
Update
</Button>
</CardContent>
<CardActions>
<Grid container justify="center">
<Grid item>
<Button
type="submit"
color="primary"
variant="outlined"
data-testid="submit"
>
Update
</Button>
</Grid>
</Grid>
</Grid>
</CardActions>
</Card>
</form>
</CardActions>
</Card>
</form>
</Grid>
<Grid item>
<form onSubmit={handlePasswordUpdateSubmit}>
<Card variant="outlined">
<CardContent>
<Grid container spacing={2}>
<Grid item xs={12}>
<TextField
id="password"
name="password"
value={password}
label={"New password"}
type="password"
variant="outlined"
required
fullWidth
inputProps={{
onChange: (event) =>
setPassword((event.target as HTMLInputElement).value),
"data-testid": "password",
}}
/>
</Grid>
</Grid>
</CardContent>
<CardActions>
<Grid container justify="center">
<Grid item>
<Button
type="submit"
color="primary"
variant="outlined"
data-testid="submit"
>
Update
</Button>
</Grid>
</Grid>
</CardActions>
</Card>
</form>
</Grid>
</Grid>
</Grid>
</Box>
);
};

Expand Down
Loading