-
Notifications
You must be signed in to change notification settings - Fork 53
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
Replace trip sort select with accessible dropdown #897
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f86e840
refactor: replace trip sort select with dropdown
amy-corson-ibigroup cd5480a
Merge branch 'dev' into results-sort-dropdown
amy-corson-ibigroup c0f8322
refactor: address feedback
amy-corson-ibigroup 8f77197
refactor dropdown and sort options
amy-corson-ibigroup aba7c39
refactor: address feedback
amy-corson-ibigroup 9bea70a
refactor: address feedback
amy-corson-ibigroup 58322f1
Merge branch 'dev' into results-sort-dropdown
amy-corson-ibigroup 96df27f
refactor: sort preventdefault
amy-corson-ibigroup 46b6f27
Merge branch 'results-sort-dropdown' of https://github.com/opentrippl…
amy-corson-ibigroup c5c078e
refactor: standardize navbar buttons
amy-corson-ibigroup c2670a2
fix: correct display and float on small screens
amy-corson-ibigroup fbfe469
refactor: sort button styling + variable rename
amy-corson-ibigroup 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
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
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
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
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,50 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
type Props = { | ||
children: React.ReactNode | ||
className?: string | ||
onClick: () => void | ||
title: string | undefined | ||
} | ||
|
||
export const NavbarButton = styled.button` | ||
background: transparent; | ||
border: none; | ||
color: white; | ||
display: block; | ||
line-height: 20px; | ||
padding: 15px; | ||
transition: all 0.1s ease-in-out; | ||
|
||
@media (max-width: 768px) { | ||
padding: 10px; | ||
float: right; | ||
} | ||
&:hover, | ||
&[aria-expanded='true'] { | ||
background: rgba(0, 0, 0, 0.05); | ||
color: #ddd; | ||
cursor: pointer; | ||
} | ||
&.active { | ||
background: rgba(0, 0, 0, 0.05); | ||
} | ||
` | ||
|
||
const NavbarItem = ({ | ||
children, | ||
className, | ||
onClick, | ||
title | ||
}: Props): JSX.Element => { | ||
return ( | ||
<li className={className}> | ||
<NavbarButton className="navItem" onClick={onClick} title={title}> | ||
{children} | ||
</NavbarButton> | ||
</li> | ||
) | ||
} | ||
|
||
export default NavbarItem |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we control
NavbarItem
we can probably add this rule right toNavbarItem
! This hack was only there because I couldn't touch bootstrapThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using
NavbarItem
for the log in/sign up button as well, which should stay visible at smaller screen sizes, so I think the custom rule is still necessary!