add header to recommended content and decrease autoplay size

This commit is contained in:
Sean Yesmunt 2018-08-06 14:26:20 -04:00
parent e1adc71f0a
commit 0d2eab88da
4 changed files with 29 additions and 9 deletions

View file

@ -9,6 +9,7 @@ type Props = {
verticallyCentered?: boolean, verticallyCentered?: boolean,
stretch?: boolean, stretch?: boolean,
alignRight?: boolean, alignRight?: boolean,
spaceBetween?: boolean,
}; };
export class FormRow extends React.PureComponent<Props> { export class FormRow extends React.PureComponent<Props> {
@ -17,7 +18,14 @@ export class FormRow extends React.PureComponent<Props> {
}; };
render() { render() {
const { centered, children, padded, verticallyCentered, stretch, alignRight } = this.props; const {
children,
padded,
verticallyCentered,
stretch,
alignRight,
spaceBetween,
} = this.props;
return ( return (
<div <div
className={classnames('form-row', { className={classnames('form-row', {
@ -25,6 +33,7 @@ export class FormRow extends React.PureComponent<Props> {
'form-row--vertically-centered': verticallyCentered, 'form-row--vertically-centered': verticallyCentered,
'form-row--stretch': stretch, 'form-row--stretch': stretch,
'form-row--right': alignRight, 'form-row--right': alignRight,
'form-row--space-between': spaceBetween,
})} })}
> >
{children} {children}

View file

@ -66,11 +66,12 @@ export default class RecommendedContent extends React.PureComponent<Props, State
return ( return (
<section className="card__list--recommended"> <section className="card__list--recommended">
<FormRow> <FormRow spaceBetween>
<span>Related</span>
<ToolTip onComponent body={__('Automatically download and play free content.')}> <ToolTip onComponent body={__('Automatically download and play free content.')}>
<FormField <FormField
useToggle
firstInList firstInList
affixClass="form-field__prefix--recommended-content"
name="autoplay" name="autoplay"
type="checkbox" type="checkbox"
prefix={__('Autoplay')} prefix={__('Autoplay')}

View file

@ -27,6 +27,10 @@
justify-content: flex-end; justify-content: flex-end;
} }
&.form-row--space-between {
justify-content: space-between;
}
.form-field.form-field--stretch { .form-field.form-field--stretch {
width: 100%; width: 100%;
@ -121,6 +125,11 @@
padding-left: $spacing-vertical * 1/3; padding-left: $spacing-vertical * 1/3;
} }
.form-field__prefix--recommended-content {
font-size: 12px;
align-self: center;
}
.form-field__select { .form-field__select {
min-width: 60px; min-width: 60px;
height: 30px; height: 30px;

View file

@ -9,6 +9,7 @@
padding: 0; padding: 0;
user-select: none; user-select: none;
margin-bottom: auto; margin-bottom: auto;
margin-top: 2px;
} }
.react-toggle-screenreader-only { .react-toggle-screenreader-only {
@ -30,8 +31,8 @@
} }
.react-toggle-track { .react-toggle-track {
width: 50px; width: 40px;
height: 24px; height: 19px;
padding: 0; padding: 0;
border-radius: 30px; border-radius: 30px;
background-color: #4d4d4d; background-color: #4d4d4d;
@ -61,7 +62,7 @@
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
line-height: 0; line-height: 0;
left: 8px; left: 6px;
opacity: 0; opacity: 0;
-webkit-transition: opacity 0.25s ease; -webkit-transition: opacity 0.25s ease;
-moz-transition: opacity 0.25s ease; -moz-transition: opacity 0.25s ease;
@ -98,8 +99,8 @@
position: absolute; position: absolute;
top: 1px; top: 1px;
left: 1px; left: 1px;
width: 22px; width: 17px;
height: 22px; height: 17px;
border: 1px solid #4d4d4d; border: 1px solid #4d4d4d;
border-radius: 50%; border-radius: 50%;
background-color: #fafafa; background-color: #fafafa;
@ -108,6 +109,6 @@
} }
.react-toggle--checked .react-toggle-thumb { .react-toggle--checked .react-toggle-thumb {
left: 27px; left: 22px;
border-color: var(--input-switch-color); border-color: var(--input-switch-color);
} }