-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into fix-position-on-safari
- Loading branch information
Showing
17 changed files
with
407 additions
and
260 deletions.
There are no files selected for viewing
496 changes: 248 additions & 248 deletions
496
__tests__/components/viewers/__snapshots__/nearby-view.js.snap
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
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,83 @@ | ||
import { CSSTransition, TransitionGroup } from 'react-transition-group' | ||
import { FormattedMessage } from 'react-intl' | ||
import React, { useRef } from 'react' | ||
import styled from 'styled-components' | ||
|
||
import { RED_ON_WHITE } from '../util/colors' | ||
import InvisibleA11yLabel from '../util/invisible-a11y-label' | ||
|
||
const containerClassname = 'network-connection-banner' | ||
const timeout = 250 | ||
|
||
const TransitionStyles = styled.div` | ||
.${containerClassname} { | ||
background: ${RED_ON_WHITE}; | ||
border-left: 1px solid #e7e7e7; | ||
border-right: 1px solid #e7e7e7; | ||
color: #fff; | ||
font-weight: 600; | ||
padding: 5px; | ||
position: absolute; | ||
text-align: center; | ||
top: 50px; | ||
width: 100%; | ||
// When banner is fully loaded, set z-index higher than nav so we're not seeing the nav border. | ||
z-index: 26; | ||
@media (max-width: 768px) { | ||
border: 0; | ||
} | ||
} | ||
.${containerClassname}-enter { | ||
opacity: 0; | ||
transform: translateY(-100%); | ||
} | ||
.${containerClassname}-enter-active { | ||
opacity: 1; | ||
transform: translateY(0); | ||
transition: opacity ${timeout}ms ease-in; | ||
} | ||
.${containerClassname}-exit { | ||
opacity: 1; | ||
transform: translateY(0); | ||
z-index: 20; | ||
} | ||
.${containerClassname}-exit-active { | ||
opacity: 0; | ||
transform: translateY(-100%); | ||
transition: opacity ${timeout}ms ease-in, transform ${timeout}ms ease-in; | ||
z-index: 20; | ||
} | ||
` | ||
|
||
export const NetworkConnectionBanner = ({ | ||
networkConnectionLost | ||
}: { | ||
networkConnectionLost: boolean | ||
}): JSX.Element => { | ||
const connectionLostBannerRef = useRef<HTMLDivElement>(null) | ||
return ( | ||
<TransitionStyles> | ||
<InvisibleA11yLabel aria-live="assertive" role="status"> | ||
{networkConnectionLost ? ( | ||
<FormattedMessage id="components.AppMenu.networkConnectionLost" /> | ||
) : ( | ||
<FormattedMessage id="components.AppMenu.networkConnectionRestored" /> | ||
)} | ||
</InvisibleA11yLabel> | ||
<TransitionGroup style={{ display: 'content' }}> | ||
{networkConnectionLost && ( | ||
<CSSTransition | ||
classNames={containerClassname} | ||
nodeRef={connectionLostBannerRef} | ||
timeout={timeout} | ||
> | ||
<div className={containerClassname} ref={connectionLostBannerRef}> | ||
<FormattedMessage id="components.AppMenu.networkConnectionLost" /> | ||
</div> | ||
</CSSTransition> | ||
)} | ||
</TransitionGroup> | ||
</TransitionStyles> | ||
) | ||
} |
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 |
---|---|---|
|
@@ -2542,10 +2542,10 @@ | |
"@opentripplanner/core-utils" "^11.4.4" | ||
prop-types "^15.7.2" | ||
|
||
"@opentripplanner/itinerary-body@6.0.3", "@opentripplanner/itinerary-body@^6.0.0": | ||
version "6.0.3" | ||
resolved "https://registry.yarnpkg.com/@opentripplanner/itinerary-body/-/itinerary-body-6.0.3.tgz#84573d20ac9cc1fc7f2d2e032fac5a072ac3e142" | ||
integrity sha512-1qrH8hpR5Rr9KMGNnajI7GJyuoV+rogmyGqd5Z5DErZGp4luVzksIsnyW1IbxRslnV3bqKll+DH8lTXy4QIyZg== | ||
"@opentripplanner/itinerary-body@6.1.0": | ||
version "6.1.0" | ||
resolved "https://registry.yarnpkg.com/@opentripplanner/itinerary-body/-/itinerary-body-6.1.0.tgz#8a1399e8dc15b6918ede51a0f263519e4b891415" | ||
integrity sha512-nv42+hJavdVS5nHtKLDv1Um04patzGD+/xh3zApgxpB9xG/D2Zy4JBqbyMtZ1eHKF4JYkmm+NsAq/7043WPXGA== | ||
dependencies: | ||
"@opentripplanner/core-utils" "^12.0.0" | ||
"@opentripplanner/humanize-distance" "^1.2.0" | ||
|
@@ -2578,6 +2578,24 @@ | |
react-resize-detector "^4.2.1" | ||
string-similarity "^4.0.4" | ||
|
||
"@opentripplanner/itinerary-body@^6.0.0": | ||
version "6.0.3" | ||
resolved "https://registry.yarnpkg.com/@opentripplanner/itinerary-body/-/itinerary-body-6.0.3.tgz#84573d20ac9cc1fc7f2d2e032fac5a072ac3e142" | ||
integrity sha512-1qrH8hpR5Rr9KMGNnajI7GJyuoV+rogmyGqd5Z5DErZGp4luVzksIsnyW1IbxRslnV3bqKll+DH8lTXy4QIyZg== | ||
dependencies: | ||
"@opentripplanner/core-utils" "^12.0.0" | ||
"@opentripplanner/humanize-distance" "^1.2.0" | ||
"@opentripplanner/icons" "^3.0.0" | ||
"@opentripplanner/location-icon" "^1.4.1" | ||
"@styled-icons/fa-solid" "^10.34.0" | ||
"@styled-icons/foundation" "^10.34.0" | ||
date-fns "^2.28.0" | ||
date-fns-tz "^1.2.2" | ||
flat "^5.0.2" | ||
react-animate-height "^3.0.4" | ||
react-resize-detector "^4.2.1" | ||
string-similarity "^4.0.4" | ||
|
||
"@opentripplanner/[email protected]": | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/@opentripplanner/location-field/-/location-field-3.0.0.tgz#a6f8743290cf088bcd589cf8e6b0d07a651b704a" | ||
|