summaryrefslogtreecommitdiff
path: root/client/src/pages/ServerSelection.js
diff options
context:
space:
mode:
author8cy <[email protected]>2020-07-23 23:24:17 -0700
committer8cy <[email protected]>2020-07-23 23:24:17 -0700
commitbb511abc03bb66848947e37a999502b813c77269 (patch)
tree612c010fc8317e1cdf11471a18aad0270819d33e /client/src/pages/ServerSelection.js
parentfix: if clear amount equal or over 100, round down to 99 (diff)
downloaddep-core-bb511abc03bb66848947e37a999502b813c77269.tar.xz
dep-core-bb511abc03bb66848947e37a999502b813c77269.zip
goodbye old uwufier :cry:
Diffstat (limited to 'client/src/pages/ServerSelection.js')
-rw-r--r--client/src/pages/ServerSelection.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/client/src/pages/ServerSelection.js b/client/src/pages/ServerSelection.js
new file mode 100644
index 0000000..f1e3a39
--- /dev/null
+++ b/client/src/pages/ServerSelection.js
@@ -0,0 +1,33 @@
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import { MDBAlert, MDBRow } from 'mdbreact';
+
+import ServerCard from '../components/selection/ServerCard';
+
+export default class ServerSelection extends Component {
+ render() {
+ const guilds = this.props.user.guilds.filter(g => g.admin);
+
+ if (!guilds.length) {
+ return(
+ <MDBAlert color="warning">
+ <strong>You cannot manage any servers</strong>
+ </MDBAlert>
+ );
+ } else {
+ return(
+ <React.Fragment>
+ <MDBRow>
+ {guilds.map(guild => {
+ return(<ServerCard guild={guild} />);
+ })}
+ </MDBRow>
+ </React.Fragment>
+ );
+ }
+ }
+}
+
+ServerSelection.propTypes = {
+ user: PropTypes.object
+} \ No newline at end of file