mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
chore: remove semi
This commit is contained in:
parent
4b75eaa0ab
commit
8fcc0dcbf9
64 changed files with 1073 additions and 1073 deletions
|
@ -1,17 +1,17 @@
|
|||
import React, { Component, Fragment } from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import PropTypes from 'prop-types';
|
||||
import ServerCard from './ServerCard';
|
||||
import UserCard from './UserCard';
|
||||
import { Scrollbars } from 'react-custom-scrollbars';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import React, { Component, Fragment } from 'react'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import PropTypes from 'prop-types'
|
||||
import ServerCard from './ServerCard'
|
||||
import UserCard from './UserCard'
|
||||
import { Scrollbars } from 'react-custom-scrollbars'
|
||||
import { NavLink } from 'react-router-dom'
|
||||
|
||||
class ServersNavigation extends Component {
|
||||
static propTypes = {
|
||||
user: ImmutablePropTypes.map.isRequired,
|
||||
servers: ImmutablePropTypes.orderedMapOf(ImmutablePropTypes.map).isRequired,
|
||||
className: PropTypes.string,
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
// console.log(this.props.servers)
|
||||
|
@ -21,8 +21,8 @@ class ServersNavigation extends Component {
|
|||
<div className={this.props.className}>
|
||||
<Scrollbars autoHeight autoHeightMax="calc(100vh - 180px)">
|
||||
{this.props.servers.reduce((acc, s, i) => {
|
||||
acc.push(<ServerCard server={s} user={this.props.user} key={i} />);
|
||||
return acc;
|
||||
acc.push(<ServerCard server={s} user={this.props.user} key={i} />)
|
||||
return acc
|
||||
}, [])}
|
||||
<NavLink
|
||||
className="server-list__item add-new"
|
||||
|
@ -36,8 +36,8 @@ class ServersNavigation extends Component {
|
|||
</Scrollbars>
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ServersNavigation;
|
||||
export default ServersNavigation
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import './ServerCard.sass';
|
||||
import { withRouter } from 'react-router';
|
||||
import React, { Component } from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import { NavLink } from 'react-router-dom'
|
||||
import './ServerCard.sass'
|
||||
import { withRouter } from 'react-router'
|
||||
|
||||
class ServerCard extends Component {
|
||||
static propTypes = {
|
||||
user: ImmutablePropTypes.map.isRequired,
|
||||
server: ImmutablePropTypes.map.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const { server, user } = this.props;
|
||||
const { server, user } = this.props
|
||||
|
||||
let icon = '';
|
||||
let icon = ''
|
||||
|
||||
console.log(__filename, server);
|
||||
console.log(__filename, server)
|
||||
|
||||
const s = server.get('server');
|
||||
const gm = server.get('gm');
|
||||
const perms = server.get('perms');
|
||||
const s = server.get('server')
|
||||
const gm = server.get('gm')
|
||||
const perms = server.get('perms')
|
||||
|
||||
if (perms.get('canManageRoles')) {
|
||||
icon = (
|
||||
|
@ -32,7 +32,7 @@ class ServerCard extends Component {
|
|||
className="server-list__item__tag"
|
||||
uk-icon="icon: bolt; ratio: 0.7"
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
if (perms.get('isAdmin')) {
|
||||
|
@ -45,7 +45,7 @@ class ServerCard extends Component {
|
|||
className="server-list__item__tag"
|
||||
uk-icon="icon: star; ratio: 0.7"
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -69,8 +69,8 @@ class ServerCard extends Component {
|
|||
{icon}
|
||||
</div>
|
||||
</NavLink>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ServerCard;
|
||||
export default ServerCard
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Link, Redirect } from 'react-router-dom';
|
||||
import superagent from 'superagent';
|
||||
import discordLogo from '../../pages/images/discord-logo.svg';
|
||||
import React, { Component } from 'react'
|
||||
import { Link, Redirect } from 'react-router-dom'
|
||||
import superagent from 'superagent'
|
||||
import discordLogo from '../../pages/images/discord-logo.svg'
|
||||
|
||||
export default class ServerLanding extends Component {
|
||||
state = {
|
||||
server: null,
|
||||
exit: false,
|
||||
};
|
||||
}
|
||||
|
||||
async componentWillMount() {
|
||||
console.log(this.props);
|
||||
console.log(this.props)
|
||||
|
||||
try {
|
||||
const rsp = await superagent.get(
|
||||
`/api/server/${this.props.match.params.server}/slug`
|
||||
);
|
||||
this.setState({ server: rsp.body });
|
||||
)
|
||||
this.setState({ server: rsp.body })
|
||||
} catch (e) {
|
||||
this.setState({ exit: true });
|
||||
return;
|
||||
this.setState({ exit: true })
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.exit === true) {
|
||||
return <Redirect to="/" />;
|
||||
return <Redirect to="/" />
|
||||
}
|
||||
|
||||
if (this.state.server === null) {
|
||||
return null; //SPINNER
|
||||
return null //SPINNER
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -54,6 +54,6 @@ export default class ServerLanding extends Component {
|
|||
</section>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
import React, { Component } from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { connect } from 'react-redux';
|
||||
import * as Actions from '../../actions';
|
||||
import './UserCard.sass';
|
||||
import React, { Component } from 'react'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import { NavLink } from 'react-router-dom'
|
||||
import { connect } from 'react-redux'
|
||||
import * as Actions from '../../actions'
|
||||
import './UserCard.sass'
|
||||
|
||||
@connect()
|
||||
class UserCard extends Component {
|
||||
static propTypes = {
|
||||
user: ImmutablePropTypes.map,
|
||||
};
|
||||
}
|
||||
|
||||
get avatar() {
|
||||
const { user } = this.props;
|
||||
const avatar = user.get('avatar');
|
||||
const { user } = this.props
|
||||
const avatar = user.get('avatar')
|
||||
|
||||
if (avatar === '' || avatar == null) {
|
||||
return `https://cdn.discordapp.com/embed/avatars/${Math.ceil(Math.random() * 9999) %
|
||||
5}.png`;
|
||||
5}.png`
|
||||
}
|
||||
|
||||
return `https://cdn.discordapp.com/avatars/${user.get('id')}/${avatar}.png`;
|
||||
return `https://cdn.discordapp.com/avatars/${user.get('id')}/${avatar}.png`
|
||||
}
|
||||
|
||||
render() {
|
||||
const { user } = this.props;
|
||||
const { user } = this.props
|
||||
|
||||
// console.log(this.props)
|
||||
|
||||
|
@ -45,7 +45,7 @@ class UserCard extends Component {
|
|||
title="Sign out"
|
||||
uk-icon="icon: sign-out"
|
||||
onClick={() => {
|
||||
this.props.dispatch(Actions.userLogout);
|
||||
this.props.dispatch(Actions.userLogout)
|
||||
}}
|
||||
/>
|
||||
</li>
|
||||
|
@ -63,8 +63,8 @@ class UserCard extends Component {
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default UserCard;
|
||||
export default UserCard
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import { Scrollbars } from 'react-custom-scrollbars';
|
||||
import { connect } from 'react-redux';
|
||||
import { withRouter, Redirect } from 'react-router';
|
||||
import './index.sass';
|
||||
import React, { Component } from 'react'
|
||||
import { Route, Switch } from 'react-router-dom'
|
||||
import { Scrollbars } from 'react-custom-scrollbars'
|
||||
import { connect } from 'react-redux'
|
||||
import { withRouter, Redirect } from 'react-router'
|
||||
import './index.sass'
|
||||
|
||||
import Navigation from './Navigation';
|
||||
import RolePicker from '../role-picker';
|
||||
import RoleEditor from '../role-editor';
|
||||
import AddServer from '../add-server';
|
||||
import Error404 from '../../pages/Error404';
|
||||
import Navigation from './Navigation'
|
||||
import RolePicker from '../role-picker'
|
||||
import RoleEditor from '../role-editor'
|
||||
import AddServer from '../add-server'
|
||||
import Error404 from '../../pages/Error404'
|
||||
|
||||
// import mockData from './mockData'
|
||||
|
||||
|
@ -18,20 +18,20 @@ const mapState = ({ servers, user, appState }) => {
|
|||
servers,
|
||||
user,
|
||||
fade: appState.fade,
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@connect(mapState)
|
||||
class Servers extends Component {
|
||||
get defaultPath() {
|
||||
console.log(this.props.servers.toJS());
|
||||
console.log(this.props.servers.toJS())
|
||||
|
||||
const first = this.props.servers.first();
|
||||
const first = this.props.servers.first()
|
||||
if (first != null) {
|
||||
return first.get('id');
|
||||
return first.get('id')
|
||||
}
|
||||
|
||||
return 'add';
|
||||
return 'add'
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -62,8 +62,8 @@ class Servers extends Component {
|
|||
</Scrollbars>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Servers;
|
||||
export default Servers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue