mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-01 10:56:31 +08:00
42 lines
1012 B
JavaScript
42 lines
1012 B
JavaScript
import React from 'react';
|
|
import { Plugin } from '../../model/';
|
|
|
|
import './plugin.scss';
|
|
|
|
const PluginBox = (props) => {
|
|
return (
|
|
<div className="component_pluginbox">
|
|
<div className="title">{props.name}</div>
|
|
<div>{props.description}</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export class PluginPage extends React.Component {
|
|
constructor(props){
|
|
super(props);
|
|
this.state = {
|
|
plugins: []
|
|
};
|
|
}
|
|
|
|
componentWillMount(){
|
|
Plugin.all().then((list) => this.setState({plugins: list}));
|
|
}
|
|
|
|
render(){
|
|
return (
|
|
<div className="component_plugin">
|
|
<h2>Plugins</h2>
|
|
<div>
|
|
{
|
|
this.state.plugins.map((plugin, index) => {
|
|
return ( <PluginBox key={index} name={plugin.name} author={plugin.author} description={plugin.description} /> );
|
|
})
|
|
}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|