Skip to content
Snippets Groups Projects
Commit d8ec3867 authored by Christopher Willis-Ford's avatar Christopher Willis-Ford
Browse files

restyle telemetry radio buttons like in WWW

parent 0d052660
Branches
No related tags found
No related merge requests found
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
@import "../../css/typography.css"; @import "../../css/typography.css";
@import "../../css/z-index.css"; @import "../../css/z-index.css";
/* from scratch-www */
$active-gray: hsla(0, 0%, 0%, .1);
$ui-blue-10percent: hsla(215, 100%, 65%, .1);
$ui-blue-25percent: hsla(215, 100%, 65%, .25);
$ui-gray: hsla(0, 0%, 95%, 1);
.modal-overlay { .modal-overlay {
position: fixed; position: fixed;
top: 0; top: 0;
...@@ -44,15 +50,60 @@ ...@@ -44,15 +50,60 @@
text-decoration: none; text-decoration: none;
} }
.radioButtons {
justify-content: center;
width: fit-content;
}
/* stack the radio buttons vertically, not horizontally */ /* stack the radio buttons vertically, not horizontally */
.radioButtons label { .radioButtons label {
display: block; display: block;
margin: 0.5rem; margin: 0.5rem;
transition: all .125s ease;
background-color: $ui-gray;
border-radius: .5rem;
margin: 0 auto 0.375rem;
padding-left: 0.8125rem;
align-items: center;
padding: 1rem;
vertical-align: middle;
}
.radioButtons label:hover {
background-color: $ui-blue-10percent;
}
.radioButtons label.labelSelected,
.radioButtons label.labelSelected:hover {
background-color: $ui-blue-25percent;
}
.radioButtons input[type="radio"] {
margin: -1px 0.75rem 1px 0;
border: 1px solid $active-gray;
border-radius: 50%;
width: 1rem;
height: 1rem;
appearance: none;
background-color: $ui-white;
vertical-align: middle;
}
.radioButtons input[type="radio"]:checked,
.radioButtons input[type="radio"]:focus {
box-shadow: 0 0 0 2px $ui-blue-25percent;
outline: none;
}
.radioButtons input[type="radio"]:checked {
transition: all .25s ease;
background-color: $ui-white;
border: 1px solid $motion-primary;
}
.radioButtons input[type="radio"]:checked::after {
display: block;
transform: translate(.125rem, .125rem);
border-radius: 50%;
background-color: $motion-primary;
width: .625rem;
height: .625rem;
content: "";
} }
/* Confirmation buttons at the bottom of the modal */ /* Confirmation buttons at the bottom of the modal */
......
...@@ -87,6 +87,8 @@ class TelemetryModal extends React.PureComponent { ...@@ -87,6 +87,8 @@ class TelemetryModal extends React.PureComponent {
} }
render () { render () {
const isUndecided = (typeof this.props.isTelemetryEnabled !== 'boolean'); const isUndecided = (typeof this.props.isTelemetryEnabled !== 'boolean');
const isOff = (this.props.isTelemetryEnabled === false);
const isOn = (this.props.isTelemetryEnabled === true);
return (<ReactModal return (<ReactModal
isOpen isOpen
className={styles.modalContent} className={styles.modalContent}
...@@ -114,7 +116,7 @@ class TelemetryModal extends React.PureComponent { ...@@ -114,7 +116,7 @@ class TelemetryModal extends React.PureComponent {
}} }}
/></p> /></p>
<Box className={styles.radioButtons}> <Box className={styles.radioButtons}>
<label> <label className={isOn ? styles.labelSelected : null}>
<input <input
name="optInOut" name="optInOut"
type="radio" type="radio"
...@@ -125,7 +127,7 @@ class TelemetryModal extends React.PureComponent { ...@@ -125,7 +127,7 @@ class TelemetryModal extends React.PureComponent {
/> />
<FormattedMessage {...messages.optInText} /> <FormattedMessage {...messages.optInText} />
</label> </label>
<label> <label className={isOff ? styles.labelSelected : null}>
<input <input
name="optInOut" name="optInOut"
type="radio" type="radio"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment