generated from wmcadigital/wmn-create-react-app-template
-
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 #36 from wmcadigital/next-release
fix: show correct rail zone names and mobile key styling
- Loading branch information
Showing
27 changed files
with
332 additions
and
46 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,28 @@ | ||
import React from 'react'; | ||
|
||
const { REACT_APP_TITLE } = process.env; | ||
|
||
function Breadcrumbs() { | ||
return ( | ||
<nav ariaLabel="Breadcrumb" className="wmnds-breadcrumb"> | ||
<ol className="wmnds-breadcrumb__list"> | ||
<li className="wmnds-breadcrumb__list-item"> | ||
<a href="//wmnetwork.co.uk" className="wmnds-breadcrumb__link"> | ||
Home | ||
</a> | ||
</li> | ||
<li className="wmnds-breadcrumb__list-item"> | ||
<a | ||
href="/" | ||
className="wmnds-breadcrumb__link wmnds-breadcrumb__link--current" | ||
ariaCurrent="page" | ||
> | ||
{REACT_APP_TITLE} | ||
</a> | ||
</li> | ||
</ol> | ||
</nav> | ||
); | ||
} | ||
|
||
export default Breadcrumbs; |
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 @@ | ||
/* eslint-disable jsx-a11y/label-has-associated-control */ | ||
import React, { useContext } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import dompurify from 'dompurify'; | ||
|
||
// Import contexts | ||
import { FormContext } from 'globalState'; | ||
|
||
import s from './Radio.module.scss'; | ||
|
||
const { sanitize } = dompurify; | ||
|
||
const Radio = ({ name = '', onChange, text, value, info }) => { | ||
const [formState] = useContext(FormContext); // Get the state/dispatch of form data from FormContext | ||
|
||
return ( | ||
<> | ||
<label className={`${s.radioContainer} wmnds-fe-radios__container`}> | ||
<div className={s.text} dangerouslySetInnerHTML={{ __html: sanitize(text) }} /> | ||
<input | ||
className={`${s.radio} wmnds-fe-radios__input`} | ||
value={value} | ||
name={name} | ||
type="radio" | ||
onChange={onChange} | ||
defaultChecked={formState[name] && formState[name] === value} | ||
/> | ||
{info && ( | ||
<div | ||
className={`${s.insetText} wmnds-inset-text wmnds-m-t-xs`} | ||
dangerouslySetInnerHTML={{ __html: sanitize(info) }} | ||
/> | ||
)} | ||
<span className="wmnds-fe-radios__checkmark" /> | ||
</label> | ||
</> | ||
); | ||
}; | ||
|
||
Radio.propTypes = { | ||
name: PropTypes.string, | ||
onChange: PropTypes.func, | ||
text: PropTypes.string.isRequired, | ||
value: PropTypes.string.isRequired, | ||
info: PropTypes.string, | ||
}; | ||
|
||
Radio.defaultProps = { | ||
name: '', | ||
onChange: null, | ||
info: null, | ||
}; | ||
|
||
export default Radio; |
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,34 @@ | ||
// Refer to https://create-react-app.dev/docs/adding-a-css-modules-stylesheet | ||
// On how to use scss modules with React | ||
|
||
// Import WMN Design System scss for use in this scss file | ||
// Tilde (~) represents the root folder(src) | ||
@import '~assets/wmnds/vars'; | ||
@import '~assets/wmnds/mixins'; | ||
|
||
.text { | ||
display: inline-flex; | ||
min-height: 35px; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
|
||
strong { | ||
display: block; | ||
} | ||
} | ||
|
||
.radioContainer { | ||
flex-wrap: wrap; | ||
} | ||
|
||
.insetText { | ||
display: none; | ||
flex: 0 0 100%; | ||
} | ||
|
||
.radio { | ||
&:checked + .insetText { | ||
display: block; | ||
} | ||
} |
Oops, something went wrong.