Skip to content

Commit

Permalink
add header to recommended content and decrease autoplay size
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Yesmunt committed Aug 6, 2018
1 parent 5f039a0 commit 5bd41c1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
11 changes: 10 additions & 1 deletion src/renderer/component/common/form-components/form-row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Props = {
verticallyCentered?: boolean,
stretch?: boolean,
alignRight?: boolean,
spaceBetween?: boolean,
};

export class FormRow extends React.PureComponent<Props> {
Expand All @@ -17,14 +18,22 @@ export class FormRow extends React.PureComponent<Props> {
};

render() {
const { centered, children, padded, verticallyCentered, stretch, alignRight } = this.props;
const {
children,
padded,
verticallyCentered,
stretch,
alignRight,
spaceBetween,
} = this.props;
return (
<div
className={classnames('form-row', {
'form-row--padded': padded,
'form-row--vertically-centered': verticallyCentered,
'form-row--stretch': stretch,
'form-row--right': alignRight,
'form-row--space-between': spaceBetween,
})}
>
{children}
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/component/recommendedContent/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ export default class RecommendedContent extends React.PureComponent<Props, State

return (
<section className="card__list--recommended">
<FormRow>
<FormRow spaceBetween>
<span>Related</span>
<ToolTip onComponent body={__('Automatically download and play free content.')}>
<FormField
useToggle
firstInList
affixClass="form-field__prefix--recommended-content"
name="autoplay"
type="checkbox"
prefix={__('Autoplay')}
Expand Down
9 changes: 9 additions & 0 deletions src/renderer/scss/component/_form-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
justify-content: flex-end;
}

&.form-row--space-between {
justify-content: space-between;
}

.form-field.form-field--stretch {
width: 100%;

Expand Down Expand Up @@ -121,6 +125,11 @@
padding-left: $spacing-vertical * 1/3;
}

.form-field__prefix--recommended-content {
font-size: 12px;
align-self: center;
}

.form-field__select {
min-width: 60px;
height: 30px;
Expand Down
13 changes: 7 additions & 6 deletions src/renderer/scss/component/_toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
padding: 0;
user-select: none;
margin-bottom: auto;
margin-top: 2px;
}

.react-toggle-screenreader-only {
Expand All @@ -30,8 +31,8 @@
}

.react-toggle-track {
width: 50px;
height: 24px;
width: 40px;
height: 19px;
padding: 0;
border-radius: 30px;
background-color: #4d4d4d;
Expand Down Expand Up @@ -61,7 +62,7 @@
margin-top: auto;
margin-bottom: auto;
line-height: 0;
left: 8px;
left: 6px;
opacity: 0;
-webkit-transition: opacity 0.25s ease;
-moz-transition: opacity 0.25s ease;
Expand Down Expand Up @@ -98,8 +99,8 @@
position: absolute;
top: 1px;
left: 1px;
width: 22px;
height: 22px;
width: 17px;
height: 17px;
border: 1px solid #4d4d4d;
border-radius: 50%;
background-color: #fafafa;
Expand All @@ -108,6 +109,6 @@
}

.react-toggle--checked .react-toggle-thumb {
left: 27px;
left: 22px;
border-color: var(--input-switch-color);
}

0 comments on commit 5bd41c1

Please sign in to comment.