-
Notifications
You must be signed in to change notification settings - Fork 3
Add nav bar #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add nav bar #25
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
55c4ca0
Initial comit
32f0daf
Added nav links to home and profile pages
4d440c4
restyled buttons
the-duckchild 2c3a799
start on testing
the-duckchild 816401e
button links styled
the-duckchild e6ec457
merged
the-duckchild 03e21a4
nav bar
the-duckchild ac49ae5
Merge branch 'main' into addNavBar
eleanorscott97 1bd9dee
Merge branch 'main' into addNavBar
eleanorscott97 0999283
Fix import
eleanorscott97 ba63001
Fix test import
eleanorscott97 6b3a1bf
unusued dependancy removed
the-duckchild File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| @import "../../Styles/GlobalStyles.scss"; | ||
|
|
||
| body { | ||
| background-color: $blueBackground; | ||
| font-family: $PublicSans; | ||
| } | ||
|
|
||
| .navBarContainer { | ||
| display: flex; | ||
| background: $blueBackground; | ||
| justify-content: space-between; | ||
|
|
||
| } | ||
|
|
||
| .homeButton { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .profilePageButton { | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
|
|
||
| } | ||
|
|
||
| #astroButton { | ||
| width: 5vw; | ||
| min-width: 50px; | ||
|
|
||
| } | ||
|
|
||
| #earthButton { | ||
| width: 5vw; | ||
| min-width: 50px; | ||
|
|
||
| } | ||
|
|
||
| a { | ||
| margin: 15px 10px 10px 10px; | ||
| color: $orangeBackground; | ||
| padding: 2.5px 20px; | ||
| border: solid 2px $orangeBackground; | ||
| text-decoration: none; | ||
| border-radius: 25px; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| a:hover { | ||
|
|
||
| color: $whiteFontColor; | ||
| box-shadow: 0px 0px 3px 3px $greyBackground; | ||
| } | ||
|
|
||
| a:active { | ||
| box-shadow: none; | ||
| color: $orangeBackground; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import "@testing-library/jest-dom"; | ||
| import { render, screen } from "@testing-library/react"; | ||
| import userEvent from "@testing-library/user-event"; | ||
| import React from "react"; | ||
| import NavBar from "./NavBar"; | ||
| import { BrowserRouter } from "react-router-dom"; | ||
|
|
||
| describe(NavBar, () => { | ||
| it("Should change current location to profile when link is clicked", () => { | ||
| render( | ||
| <BrowserRouter> | ||
| <NavBar /> | ||
| </BrowserRouter>, | ||
| ); | ||
| const linkProfile = screen.getByText("Profile"); | ||
| userEvent.click(linkProfile); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import React from "react"; | ||
| import "./NavBar.scss"; | ||
| import { Link } from "react-router"; | ||
| import imageAstro from "./Images/astronautcartoon.png"; | ||
| import imageEarth from "./Images/cartoon earth.png"; | ||
|
|
||
| export default function NavBar() { | ||
| return ( | ||
| <div> | ||
| <header className="navBarHeader"> | ||
| <nav className="navBarContainer"> | ||
| <div> | ||
| <Link to="/" className="homeButton" id="homeLink"> | ||
| <img src={imageEarth} alt="imageEarth" id="earthButton" /> | ||
| Home | ||
| </Link> | ||
| </div> | ||
| <div> | ||
| <Link to="/profile" className="profilePageButton" id="profileLink"> | ||
| <img | ||
| src={imageAstro} | ||
| alt="cartoon astronaut illustration" | ||
| id="astroButton" | ||
| /> | ||
| Profile | ||
| </Link> | ||
| </div> | ||
| </nav> | ||
| </header> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| declare module "*.png" { | ||
| const value: string; | ||
| export default value; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,6 @@ | |
| "jsx": "react-jsx" | ||
| }, | ||
| "include": [ | ||
| "src" | ||
| "src", | ||
| ] | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.