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

audio clips - client done

This commit is contained in:
2017-10-04 20:56:55 -05:00
parent b487548ac6
commit 74976de6cf
18 changed files with 175 additions and 92 deletions

View File

@@ -0,0 +1,46 @@
import React from 'react';
import axios from 'axios';
import { SoundList, SoundType } from '../../components/SoundList';
interface Props {}
interface State {
clipList: SoundType[];
}
export class Clips extends React.Component<Props, State> {
constructor() {
super();
this.state = {
clipList: [],
};
}
componentDidMount() {
this.getClipList();
}
private getClipList() {
axios
.get('/api/cliplist')
.then(response => {
this.setState({
clipList: response.data,
});
})
.catch((error: any) => {
console.error(error.response.data);
});
}
render() {
return (
<div className="Soundboard">
<div className="column">
<SoundList soundList={this.state.clipList} type="Clips"/>
</div>
</div>
);
}
}

View File

@@ -0,0 +1 @@
export * from './Clips';