forked from thinkcompany/code-challenges
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Luke-Yamasaki/Navbar
Merging Navbar into React and deleting the Navbar branch.
- Loading branch information
Showing
38 changed files
with
1,303 additions
and
16,913 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Binary file not shown.
This file contains 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 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,35 @@ | ||
.submit { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100px; | ||
height: 35px; | ||
background: white; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 16px; | ||
color: #205479; | ||
border: 1px solid white; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
opacity: 0.9; | ||
} | ||
|
||
.cancel { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100px; | ||
height: 35px; | ||
background: #205479; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 16px; | ||
color: white; | ||
border: 1px solid white; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
opacity: 0.75; | ||
} | ||
|
||
:hover { | ||
opacity: 1; | ||
} |
This file contains 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 @@ | ||
//Styling | ||
import styles from "./Buttons.module.css"; | ||
|
||
export const Buttons = ({ action }) => { | ||
return ( | ||
<button | ||
type={ | ||
action === 'Cancel' || action === 'Cancelar' ? | ||
'reset' : 'submit' | ||
} | ||
className={ | ||
action === 'Cancel' || action === 'Cancelar' ? | ||
styles.cancel : styles.submit | ||
}> | ||
{action} | ||
</button> | ||
) | ||
} |
Empty file.
This file contains 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,35 @@ | ||
.trainImage { | ||
width: 100vw; | ||
height: 75px; | ||
object-fit: cover; | ||
object-position: center; | ||
} | ||
|
||
.mapImage { | ||
width: 545px; | ||
min-width: 400px; | ||
height: 480px; | ||
min-height: 380px; | ||
object-fit: fill; | ||
object-position: center; | ||
border: 1px solid white; | ||
border-radius: 5px; | ||
} | ||
|
||
.fareImage { | ||
width: 545px; | ||
min-width: 400px; | ||
height: 265px; | ||
min-height: 165px; | ||
object-fit: fill; | ||
object-position: center; | ||
border: 1px solid white; | ||
border-radius: 5px; | ||
} | ||
|
||
.fareImage:after { | ||
display: block; | ||
background: black; | ||
content: "This image will get replaced with more accurate information."; | ||
color: white; | ||
} |
This file contains 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 @@ | ||
//Styling | ||
import styles from "./InfoImages.module.css"; | ||
|
||
export const InfoImages = ({ imageSrc, altText, type }) => { | ||
return ( | ||
<img | ||
className={ | ||
type === 'train' ? | ||
styles.trainImage | ||
: type === 'map' ? | ||
styles.mapImage | ||
: styles.fareImage | ||
} | ||
src={imageSrc} | ||
alt={altText} | ||
/> | ||
) | ||
} |
22 changes: 22 additions & 0 deletions
22
frontend/src/components/LanguageSwitch/LanguageSwitch.module.css
This file contains 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,22 @@ | ||
.languageBox { | ||
width: 50px; | ||
height: 30px; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 5px; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 14px; | ||
cursor: pointer; | ||
} | ||
|
||
.light { | ||
color: #595959; | ||
text-decoration: underline; | ||
} | ||
|
||
.dark { | ||
color: white; | ||
text-decoration: underline; | ||
} |
This file contains 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,42 @@ | ||
//Language Context | ||
import { useLanguage } from "../../context/languageContext"; | ||
import { useTheme } from "../../context/themeContext"; | ||
//Styling | ||
import styles from './LanguageSwitch.module.css'; | ||
|
||
export const LanguageSwitch = () => { | ||
const { setLanguage } = useLanguage(); | ||
const { theme } = useTheme(); | ||
|
||
const english = (e) => { | ||
e.preventDefault(); | ||
return setLanguage('english'); | ||
} | ||
|
||
const spanish = (e) => { | ||
e.preventDefault(); | ||
return setLanguage('spanish'); | ||
} | ||
|
||
return ( | ||
<div className={styles.languageBox}> | ||
<p | ||
className={theme === 'light' ? styles.light : styles.dark} | ||
onClick={english} | ||
> | ||
EN | ||
</p> | ||
<span | ||
className={theme === 'light' ? styles.light : styles.dark} | ||
> | ||
/ | ||
</span> | ||
<p | ||
className={theme === 'light' ? styles.light : styles.dark} | ||
onClick={spanish} | ||
> | ||
ES | ||
</p> | ||
</div> | ||
) | ||
} |
60 changes: 60 additions & 0 deletions
60
frontend/src/components/LightSwitch/LightSwitch.module.css
This file contains 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 @@ | ||
.switchBox { | ||
width: auto; | ||
height: 40px; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 10px; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 16px; | ||
} | ||
|
||
.lightLabel { | ||
color: #595959; | ||
} | ||
|
||
.darkLabel { | ||
color: white; | ||
} | ||
|
||
.lightSwitch { | ||
width: 60px; | ||
padding: 0px 5px 0px 5px; | ||
height: 35px; | ||
border-radius: 100px; | ||
border: 1px solid #595959; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: flex-start; | ||
background-color: lightgreen; | ||
} | ||
|
||
.darkSwitch { | ||
width: 60px; | ||
padding: 0px 5px 0px 5px; | ||
height: 35px; | ||
border-radius: 100px; | ||
border: 1px solid #595959; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: flex-end; | ||
background-color: lightgreen; | ||
} | ||
|
||
.lightCircle { | ||
width: 30px; | ||
height: 30px; | ||
border-radius: 100px; | ||
background-color: white; | ||
border: 1px solid lightgrey; | ||
} | ||
|
||
.darkCircle { | ||
width: 30px; | ||
height: 30px; | ||
border-radius: 100px; | ||
background-color: #595959; | ||
} |
This file contains 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,27 @@ | ||
//Theme context | ||
import { useTheme } from "../../context/themeContext"; | ||
//Styling | ||
import styles from "./LightSwitch.module.css"; | ||
|
||
export const LightSwitch = () => { | ||
const {theme, setTheme} = useTheme(); | ||
|
||
const switchThemes = (e) => { | ||
e.preventDefault(); | ||
return setTheme(theme === 'light' ? 'dark' : 'light'); | ||
} | ||
|
||
return ( | ||
<div | ||
className={styles.switchBox} | ||
onClick={switchThemes} | ||
> | ||
<p className={theme === "light" ? styles.lightLabel : styles.darkLabel}> | ||
{theme === 'light' ? "Light mode" : "Dark mode"} | ||
</p> | ||
<div className={theme === 'light' ? styles.lightSwitch : styles.darkSwitch}> | ||
<div className={theme === 'light' ? styles.lightCircle : styles.darkCircle} /> | ||
</div> | ||
</div> | ||
) | ||
} |
Empty file.
Oops, something went wrong.