Autoplay #1453

Merged
daovist merged 4 commits from autoplay into master 2018-05-11 20:16:26 +02:00
2 changed files with 20 additions and 20 deletions
Showing only changes of commit 7635145641 - Show all commits

View file

@ -41,6 +41,7 @@ type Props = {
playingUri: ?string, playingUri: ?string,
isPaused: boolean, isPaused: boolean,
claimIsMine: boolean, claimIsMine: boolean,
autoplay: boolean,
costInfo: ?{}, costInfo: ?{},
navigate: (string, ?{}) => void, navigate: (string, ?{}) => void,
openModal: ({ id: string }, { uri: string }) => void, openModal: ({ id: string }, { uri: string }) => void,
@ -78,6 +79,10 @@ class FilePage extends React.Component<Props> {
} }
} }
onAutoplayChange(event: SyntheticInputEvent<*>) {
this.props.setClientSetting(settings.AUTOPLAY, event.target.checked);
}
checkSubscription = (props: Props) => { checkSubscription = (props: Props) => {
if ( if (
props.subscriptions props.subscriptions
@ -97,10 +102,6 @@ class FilePage extends React.Component<Props> {
} }
}; };
onAutoplayChange(event: SyntheticInputEvent<*>) {
this.props.setClientSetting(settings.AUTOPLAY, event.target.checked);
}
render() { render() {
const { const {
claim, claim,
@ -116,7 +117,6 @@ class FilePage extends React.Component<Props> {
prepareEdit, prepareEdit,
navigate, navigate,
autoplay, autoplay,
setClientSetting
} = this.props; } = this.props;
// File info // File info
@ -159,14 +159,6 @@ class FilePage extends React.Component<Props> {
<div className="card__title-identity-icons"> <div className="card__title-identity-icons">
<FilePrice uri={normalizeURI(uri)} /> <FilePrice uri={normalizeURI(uri)} />
{isRewardContent && <Icon icon={icons.FEATURED} />} {isRewardContent && <Icon icon={icons.FEATURED} />}
<FormField
type="checkbox"
name="autoplay"
className="autoplay"
onChange={this.onAutoplayChange}
checked={autoplay}
postfix={__('Autoplay')}
/>
</div> </div>
</div> </div>
<span className="card__subtitle card__subtitle--file"> <span className="card__subtitle card__subtitle--file">
@ -200,6 +192,15 @@ class FilePage extends React.Component<Props> {
)} )}
</div> </div>
</div> </div>
<div className="autoplay">
<FormField
type="checkbox"
name="autoplay"
onChange={this.onAutoplayChange}
checked={autoplay}
postfix={__('Autoplay')}
/>
</div>
</div> </div>
<div className="card__content"> <div className="card__content">

View file

@ -86,15 +86,10 @@
display: flex; display: flex;
align-items: center; align-items: center;
.credit-amount, .credit-amount,
.autoplay,
.icon { .icon {
margin-top: $spacing-vertical * 1/3; margin-top: $spacing-vertical * 1/3;
margin-left: $spacing-vertical * 2/3; margin-left: $spacing-vertical * 2/3;
} }
.autoplay .icon {
margin: 0 0 0 5px;
}
} }
.card__title-identity-icons { .card__title-identity-icons {
@ -173,12 +168,16 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: $spacing-width 0; padding: $spacing-width 0 0;
} }
.card__channel-info--large { .card__channel-info--large {
padding-top: 0; padding-top: 0;
padding-bottom: $spacing-width; padding-bottom: 0;
}
.autoplay div div input {
margin: 0 0 $spacing-vertical auto;
} }
.card__content { .card__content {