mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-11 01:22:48 +00:00
UI Overhaul
This commit is contained in:
45
client/app/pages/clips/clips.tsx
Normal file
45
client/app/pages/clips/clips.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import React from 'react';
|
||||
import { SoundList, SoundType } from '../../components';
|
||||
import { axios } from '../../services';
|
||||
|
||||
interface Props {}
|
||||
|
||||
interface State {
|
||||
clipList: SoundType[];
|
||||
}
|
||||
|
||||
export class Clips extends React.Component<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
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="content">
|
||||
<div className="column">
|
||||
<SoundList soundList={this.state.clipList} type="Clips" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user