1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-11 01:22:48 +00:00

client: updated everything, deprecated pubg stuff

This commit is contained in:
2018-04-09 20:28:36 -05:00
parent 1f4cb18d21
commit 0fe7468506
43 changed files with 12857 additions and 11121 deletions

View File

@@ -1,40 +1,40 @@
@import '../../scss/variables';
.Soundboard {
display: flex;
padding: 10px;
display: flex;
padding: 10px;
}
.Soundboard__column {
flex: 1;
flex: 1;
}
.Soundboard__input {
display: block;
width: 200px;
margin-bottom: 10px;
margin-right: auto;
margin-left: auto;
display: block;
width: 200px;
margin-bottom: 10px;
margin-right: auto;
margin-left: auto;
}
.Dropzone {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 2px solid $primaryBlue;
border-radius: 1em;
padding: 20px;
margin-right: auto;
margin-left: auto;
color: $lightGray;
width: 400px;
height: 400px;
background-color: $gray2;
transition: box-shadow 0.1s linear, background-color 0.1s linear;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 2px solid $primaryBlue;
border-radius: 1em;
padding: 20px;
margin-right: auto;
margin-left: auto;
color: $lightGray;
width: 400px;
height: 400px;
background-color: $gray2;
transition: box-shadow 0.1s linear, background-color 0.1s linear;
}
.Dropzone--active {
background-color: $gray3;
box-shadow: 0px 0px 5px 1px $primaryBlue;
background-color: $gray3;
box-shadow: 0px 0px 5px 1px $primaryBlue;
}

View File

@@ -22,8 +22,8 @@ export class Soundboard extends React.Component<Props, State> {
private config: AxiosRequestConfig;
private soundListCache: any;
constructor() {
super();
constructor(props: Props) {
super(props);
(this.state = {
percentCompleted: 0,
uploaded: false,
@@ -37,13 +37,11 @@ export class Soundboard extends React.Component<Props, State> {
this.config = {
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': `Bearer ${storage.getJWT()}`
Authorization: `Bearer ${storage.getJWT()}`,
},
onUploadProgress: progressEvent => {
this.setState({
percentCompleted: Math.round(
progressEvent.loaded * 100 / progressEvent.total,
),
percentCompleted: Math.round(progressEvent.loaded * 100 / progressEvent.total),
});
},
};
@@ -123,16 +121,8 @@ export class Soundboard extends React.Component<Props, State> {
accept={'audio/*'}
>
<div style={{ fontSize: '20px' }}>Drop file here to upload.</div>
{this.state.percentCompleted > 0 ? (
<div>Uploading: {this.state.percentCompleted}</div>
) : (
''
)}
{this.state.uploaded ? (
<div style={{ color: 'green' }}>File uploded!</div>
) : (
''
)}
{this.state.percentCompleted > 0 ? <div>Uploading: {this.state.percentCompleted}</div> : ''}
{this.state.uploaded ? <div style={{ color: 'green' }}>File uploded!</div> : ''}
<div style={{ color: '#f95f59' }}>{this.state.uploadError}</div>
</Dropzone>
</div>