-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature-mhv-medical-records-accelerated-vitals
- Loading branch information
Showing
18 changed files
with
251 additions
and
26 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 |
---|---|---|
|
@@ -149,6 +149,7 @@ | |
} | ||
|
||
.form-expanding-group { | ||
margin-bottom: 1.5em; | ||
margin-left: initial; | ||
margin-top: 1.5em; | ||
} | ||
|
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
54 changes: 54 additions & 0 deletions
54
src/applications/static-pages/situation-updates-banner/createSituationUpdatesBanner.jsx
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,54 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Provider } from 'react-redux'; | ||
import { useFeatureToggle } from '~/platform/utilities/feature-toggles'; | ||
import SituationUpdateBanner from './situationUpdateBanner'; | ||
|
||
export const BannerContainer = () => { | ||
const { | ||
TOGGLE_NAMES, | ||
useToggleValue, | ||
useToggleLoadingValue, | ||
} = useFeatureToggle(); | ||
|
||
const alternativeBannersEnabled = useToggleValue( | ||
TOGGLE_NAMES.bannerUseAlternativeBanners, | ||
); | ||
const isLoadingFeatureFlags = useToggleLoadingValue(); | ||
|
||
if (isLoadingFeatureFlags || !alternativeBannersEnabled) { | ||
return null; | ||
} | ||
|
||
const defaultProps = { | ||
id: '1', | ||
bundle: 'situation-updates', | ||
headline: 'Situation update', | ||
alertType: 'warning', | ||
content: | ||
"We're having issues at this location. Please avoid this facility until further notice.", | ||
context: 'global', | ||
showClose: true, | ||
operatingStatusCTA: false, | ||
emailUpdatesButton: false, | ||
findFacilitiesCTA: false, | ||
limitSubpageInheritance: false, | ||
}; | ||
|
||
return <SituationUpdateBanner {...defaultProps} />; | ||
}; | ||
|
||
export default async function createSituationUpdatesBanner(store, widgetType) { | ||
const bannerWidget = document.querySelector( | ||
`[data-widget-type="${widgetType}"]`, | ||
); | ||
|
||
if (bannerWidget) { | ||
ReactDOM.render( | ||
<Provider store={store}> | ||
<BannerContainer /> | ||
</Provider>, | ||
bannerWidget, | ||
); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/applications/static-pages/situation-updates-banner/situationUpdateBanner.jsx
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,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export default function SituationUpdateBanner({ | ||
id, | ||
alertType, | ||
headline, | ||
showClose, | ||
content, | ||
}) { | ||
return ( | ||
<va-banner | ||
banner-id={id} | ||
type={alertType} | ||
headline={headline} | ||
show-close={showClose} | ||
> | ||
<p>{content}</p> | ||
</va-banner> | ||
); | ||
} | ||
|
||
SituationUpdateBanner.propTypes = { | ||
alertType: PropTypes.string.isRequired, | ||
content: PropTypes.node.isRequired, | ||
headline: PropTypes.string.isRequired, | ||
id: PropTypes.string.isRequired, | ||
showClose: PropTypes.bool, | ||
}; |
Oops, something went wrong.