-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create Subtitle component feat: create LocationSelect component feat: create HomeHeader component style: fix linting errors refactor: rename LocationSelect to LocationMenu fix(a11y): select element must have an accessible name fix(a11y): document does not have a main landmark refactor: use consistent naming Add a Review to Add a Location All Places to All Locations refactor: use React Router Link refactor: move uniqueCities to locations data refactor: rename Subtitle to SiteSubtitle fix: update location data
- Loading branch information
Showing
12 changed files
with
123 additions
and
99 deletions.
There are no files selected for viewing
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
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,21 @@ | ||
import { Link } from 'react-router-dom'; | ||
import SiteSubtitle from './SiteSubtitle'; | ||
import LocationMenu from './LocationMenu'; | ||
|
||
function HomeHeader() { | ||
return ( | ||
<div className="home-header"> | ||
<SiteSubtitle /> | ||
|
||
<LocationMenu /> | ||
|
||
<div className="home-header__button"> | ||
<Link className="button__header-primary" to="/locations/new"> | ||
Add a Location | ||
</Link> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default HomeHeader; |
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,24 @@ | ||
import { uniqueCities } from '../locations'; | ||
|
||
function LocationMenu() { | ||
return ( | ||
<div className="location-select"> | ||
<h2 className="location-select__title"> | ||
<label htmlFor="location">Select a Location</label> | ||
</h2> | ||
|
||
<select className="location-select__menu" name="location" id="location"> | ||
<option className="location-select__option" value="all"> | ||
All Cities | ||
</option> | ||
{uniqueCities.map((city: string) => ( | ||
<option key={city} value={city}> | ||
{city} | ||
</option> | ||
))} | ||
</select> | ||
</div> | ||
); | ||
} | ||
|
||
export default LocationMenu; |
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,5 @@ | ||
function SiteSubtitle() { | ||
return <p className="site-subtitle">Food reviews and restaurant ratings</p>; | ||
} | ||
|
||
export default SiteSubtitle; |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.location-select { | ||
@media (min-width: $bp-grid-three-col) { | ||
width: 33%; | ||
} | ||
|
||
&__title { | ||
font-family: $roboto-stack; | ||
font-size: 1rem; | ||
margin-bottom: 0.5rem; | ||
} | ||
|
||
&__menu { | ||
appearance: none; | ||
cursor: pointer; | ||
box-sizing: border-box; | ||
width: 100%; | ||
border: 1px solid #4f4f4f; | ||
padding: 0.5rem; | ||
background-color: $tertiary-color; | ||
font-family: $roboto-stack; | ||
text-transform: capitalize; | ||
letter-spacing: inherit; | ||
word-spacing: inherit; | ||
line-height: 120%; | ||
|
||
// Custom select arrow | ||
padding-right: 1.5rem; | ||
background-repeat: no-repeat; | ||
background-position: calc(100% - 0.5rem); | ||
background-size: 1rem auto; | ||
background-image: url("data:image/svg+xml,<svg viewBox='0 0 30 20' xmlns='http://www.w3.org/2000/svg'><path d='M4.5 1 15 11.3 25.5 1l3.8 3.9L15 19 .7 4.8 4.5.9Z' fill='%23C92400'/></svg>"); | ||
} | ||
|
||
&__button .location-select { | ||
&__button-arrow { | ||
display: block; | ||
float: right; | ||
height: 0.5em; | ||
width: 0.5em; | ||
transform: rotate(135deg); | ||
border: solid $accent-color; | ||
border-width: 0.15rem 0.15rem 0 0; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/scss/components/_sparkeats-subtitle.scss → src/scss/components/_site-subtitle.scss
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.sparkeats-subtitle { | ||
.site-subtitle { | ||
font-family: $oswald-stack; | ||
font-size: 2rem; | ||
font-weight: $oswald-bold; | ||
|
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,12 @@ | ||
.home-header { | ||
margin: 4rem auto 5rem; | ||
width: 80%; | ||
|
||
&__button { | ||
margin-top: 2rem; | ||
|
||
@media (min-width: 64rem) { | ||
width: 33%; | ||
} | ||
} | ||
} |
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