diff options
author | Parker <contact@pkrm.dev> | 2024-11-12 23:34:45 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-12 23:34:45 -0600 |
commit | 47b429e8b1c8ae99a945ee0795d98311bc2aba42 (patch) | |
tree | 0d6390b8f0629d9c83163b99432cf4673ca25065 | |
parent | 3b2258877fcbd211314b153c56273e3a597ad08b (diff) |
basic navbar
-rw-r--r-- | app/src/components/Navbar.tsx | 19 | ||||
-rw-r--r-- | app/src/components/Signup.tsx | 94 | ||||
-rw-r--r-- | app/src/styles/Navbar.module.css | 47 |
3 files changed, 100 insertions, 60 deletions
diff --git a/app/src/components/Navbar.tsx b/app/src/components/Navbar.tsx index 7ffb514..5107bf4 100644 --- a/app/src/components/Navbar.tsx +++ b/app/src/components/Navbar.tsx @@ -1,10 +1,23 @@ import styles from '../styles/Navbar.module.css'; +import { Link } from 'react-router-dom'; function Navbar() { return ( - <nav className={styles.navbar}> - <span>LinkLogger</span> - </nav> + <div className={styles.navbar}> + <div className={styles.navbarLeft}> + <Link to={'/login'}> + <a className={styles.navbarLink}>Login</a> + </Link> + <Link to={'/signup'}> + <a className={styles.navbarLink}>Signup</a> + </Link> + </div> + <div className={styles.navbarRight}> + <Link to={'/status'}> + <a className={styles.navbarLink}>API Status</a> + </Link> + </div> + </div> ); } diff --git a/app/src/components/Signup.tsx b/app/src/components/Signup.tsx index 388396c..5ec2e17 100644 --- a/app/src/components/Signup.tsx +++ b/app/src/components/Signup.tsx @@ -3,6 +3,7 @@ import styles from '../styles/Login.module.css'; import { Link } from 'react-router-dom'; import { useNavigate } from 'react-router-dom'; import axios from 'axios'; +import Navbar from './Navbar'; function Signup() { document.title = 'LinkLogger | Signup'; @@ -61,52 +62,55 @@ function Signup() { }; return ( - <div id={styles.container}> - <p id={styles.signupText}>Sign up</p> - <p id={styles.error} className={error ? 'visible' : 'hidden'}> - {error} - </p> - <div> - <header> - <hr></hr> - <form onSubmit={handleSubmit}> - <input - type="text" - placeholder="username" - value={username} - onChange={(e) => setUsername(e.target.value)} - required - /> - <input - type="password" - placeholder="password" - value={password} - minLength={8} - onChange={(e) => setPassword(e.target.value)} - required - /> - <input - type="password" - placeholder="confirm password" - value={passwordConfirm} - minLength={8} - onChange={(e) => setPasswordConfirm(e.target.value)} - required - /> - <button type="submit" disabled={isSubmitting}> - {isSubmitting ? 'Submitting...' : 'Submit'} - </button> - </form> - <hr></hr> - <p id={styles.bottomText}> - Already have an account?{' '} - <Link to="/login" className={styles.link}> - Log in here. - </Link> - </p> - </header> + <> + <Navbar /> + <div id={styles.container}> + <p id={styles.signupText}>Sign up</p> + <p id={styles.error} className={error ? 'visible' : 'hidden'}> + {error} + </p> + <div> + <header> + <hr></hr> + <form onSubmit={handleSubmit}> + <input + type="text" + placeholder="username" + value={username} + onChange={(e) => setUsername(e.target.value)} + required + /> + <input + type="password" + placeholder="password" + value={password} + minLength={8} + onChange={(e) => setPassword(e.target.value)} + required + /> + <input + type="password" + placeholder="confirm password" + value={passwordConfirm} + minLength={8} + onChange={(e) => setPasswordConfirm(e.target.value)} + required + /> + <button type="submit" disabled={isSubmitting}> + {isSubmitting ? 'Submitting...' : 'Submit'} + </button> + </form> + <hr></hr> + <p id={styles.bottomText}> + Already have an account?{' '} + <Link to="/login" className={styles.link}> + Log in here. + </Link> + </p> + </header> + </div> </div> - </div> + </> ); } diff --git a/app/src/styles/Navbar.module.css b/app/src/styles/Navbar.module.css index 217e4b1..d8c3f72 100644 --- a/app/src/styles/Navbar.module.css +++ b/app/src/styles/Navbar.module.css @@ -1,18 +1,41 @@ -/* Create the nav and center the span */ +/* Create the navbar and set the colors */ .navbar { display: flex; - justify-content: center; - align-items: center; - height: 60px; - background-color: #f8f9fa; + justify-content: space-between; + background-color: #3b4148; + color: white; + padding: 15px; } -/* Create the nav links */ +.navbarLink { + margin: 0 20px; + position: relative; + display: inline-block; + text-decoration: none; + color: #ccc; + font-size: 20px; + font-weight: 600; +} + +.navbarLink::after { + content: ""; + position: absolute; + bottom: 0; + left: 0; + width: 0%; + height: 2px; + background-color: #ccc; + transition: width 0.3s ease; +} + +.navbarLink:hover::after { + width: 100%; +} + +.navbarLeft { + margin-left: 50px; +} -span { - font-size: 35px; - font-weight: 600; - color: #333; - text-decoration: none; - margin-right: 10px; +.navbarRight { + margin-right: 50px; }
\ No newline at end of file |