mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-11 17:42:48 +00:00
feat: add player controls to uploaded clips on stats page
This commit is contained in:
@@ -37,7 +37,7 @@ export class Clips extends React.Component<Props, State> {
|
||||
return (
|
||||
<div className="content">
|
||||
<div className="column">
|
||||
<SoundList soundList={this.state.clipList} type="Clips" />
|
||||
<SoundList soundList={this.state.clipList} type="clips" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import React from 'react';
|
||||
import { SoundList, SoundType, Uploader } from '../../components';
|
||||
import { Permissions } from '../../model';
|
||||
import { axios, SoundService } from '../../services';
|
||||
import { AppStore } from '../../stores';
|
||||
import './soundboard.scss';
|
||||
@@ -73,9 +72,9 @@ export class Soundboard extends React.Component<Props, State> {
|
||||
<Uploader onComplete={this.onUploadComplete} />
|
||||
<SoundList
|
||||
soundList={soundList}
|
||||
type="Sounds"
|
||||
type="sounds"
|
||||
onPlayDiscord={this.onPlayDiscord}
|
||||
showDiscordPlay={appStore!.claims && appStore!.claims!.permissions >= Permissions.Mod}
|
||||
showDiscordPlay={appStore!.hasModPermissions()}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -74,7 +74,7 @@ export class Stats extends Component<IProps, IState> {
|
||||
},
|
||||
};
|
||||
|
||||
const { claims } = this.props.appStore;
|
||||
const { claims, hasModPermissions } = this.props.appStore;
|
||||
|
||||
return (
|
||||
<div className="content">
|
||||
@@ -82,7 +82,7 @@ export class Stats extends Component<IProps, IState> {
|
||||
<div className="card__header">Posts containing links</div>
|
||||
<HorizontalBar data={data} />
|
||||
</div>
|
||||
{claims && <UploadHistory sounds={this.state.sounds} />}
|
||||
{claims && <UploadHistory sounds={this.state.sounds} showDiscordPlay={hasModPermissions()} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user