From 1b86e6260fdc619e5a3f8a049a7af9873f0ae498 Mon Sep 17 00:00:00 2001 From: Piyush Sharma Date: Tue, 1 Mar 2022 13:32:42 -0500 Subject: [PATCH] Added Routing and Sign in/up Pages --- package-lock.json | 6 +++ sports-matcher/package.json | 5 ++ sports-matcher/src/App.js | 22 +++------ sports-matcher/src/SignIn.js | 68 ++++++++++++++++++++++++++ sports-matcher/src/SignUp.js | 94 ++++++++++++++++++++++++++++++++++++ sports-matcher/src/index.js | 5 +- 6 files changed, 183 insertions(+), 17 deletions(-) create mode 100644 package-lock.json create mode 100644 sports-matcher/src/SignIn.js create mode 100644 sports-matcher/src/SignUp.js diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a3c03c6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "team58", + "lockfileVersion": 2, + "requires": true, + "packages": {} +} diff --git a/sports-matcher/package.json b/sports-matcher/package.json index bad46ea..71556c7 100644 --- a/sports-matcher/package.json +++ b/sports-matcher/package.json @@ -3,11 +3,16 @@ "version": "0.1.0", "private": true, "dependencies": { + "@emotion/react": "^11.8.1", + "@emotion/styled": "^11.8.1", + "@mui/icons-material": "^5.4.4", + "@mui/material": "^5.4.4", "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.3", "@testing-library/user-event": "^13.5.0", "react": "^17.0.2", "react-dom": "^17.0.2", + "react-router-dom": "^6.2.2", "react-scripts": "^5.0.0", "web-vitals": "^2.1.4" }, diff --git a/sports-matcher/src/App.js b/sports-matcher/src/App.js index 3784575..f00a5a2 100644 --- a/sports-matcher/src/App.js +++ b/sports-matcher/src/App.js @@ -1,23 +1,15 @@ import logo from './logo.svg'; import './App.css'; - +import { Routes, Route, Link } from "react-router-dom"; +import SignIn from './SignIn'; +import SignUp from './SignUp'; function App() { return (
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
+ + } /> + } /> +
); } diff --git a/sports-matcher/src/SignIn.js b/sports-matcher/src/SignIn.js new file mode 100644 index 0000000..e7cd153 --- /dev/null +++ b/sports-matcher/src/SignIn.js @@ -0,0 +1,68 @@ +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'; +import { useHistory } from 'react-router-dom'; +import Box from '@mui/material/Box'; +import Typography from '@mui/material/Typography'; +import Container from '@mui/material/Container'; +import { Link } from '@mui/material'; +import AccountCircleIcon from '@mui/icons-material/AccountCircle'; + +export default function SignIn() { + return ( + + + + + + + + Sign in + + + + + + + {"Don't have an account?"} + + + + + )} \ No newline at end of file diff --git a/sports-matcher/src/SignUp.js b/sports-matcher/src/SignUp.js new file mode 100644 index 0000000..c4e86e2 --- /dev/null +++ b/sports-matcher/src/SignUp.js @@ -0,0 +1,94 @@ +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'; +import { useHistory } from 'react-router-dom'; +import Box from '@mui/material/Box'; +import AccountBoxIcon from '@mui/icons-material/AccountBox'; +import Typography from '@mui/material/Typography'; +import Container from '@mui/material/Container'; +import { Link } from '@mui/material'; +import { Router, Link as RouterLink } from 'react-router-dom'; +import { Grid } from '@mui/material'; + +export default function SignUp() { + return ( + + + + + + + + Sign up + + + + + + + + + + + + + + + + + + + {'Already have an account?'} + + + + + )} \ No newline at end of file diff --git a/sports-matcher/src/index.js b/sports-matcher/src/index.js index ef2edf8..78717fc 100644 --- a/sports-matcher/src/index.js +++ b/sports-matcher/src/index.js @@ -1,13 +1,14 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import { BrowserRouter } from "react-router-dom"; import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; ReactDOM.render( - + - , + , document.getElementById('root') );