Files
outline/app/scenes/Settings/People.js
Tom Moor fa4453a476 Fixes #687
Tidied people list, now displaying joined at date
2018-06-20 22:10:03 -07:00

54 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// @flow
import * as React from 'react';
import invariant from 'invariant';
import { observer, inject } from 'mobx-react';
import AuthStore from 'stores/AuthStore';
import UsersStore from 'stores/UsersStore';
import CenteredContent from 'components/CenteredContent';
import PageTitle from 'components/PageTitle';
import HelpText from 'components/HelpText';
import UserListItem from './components/UserListItem';
import List from 'components/List';
type Props = {
auth: AuthStore,
users: UsersStore,
};
@observer
class People extends React.Component<Props> {
componentDidMount() {
this.props.users.fetchPage({ limit: 100 });
}
render() {
const { users, auth } = this.props;
const currentUser = auth.user;
invariant(currentUser, 'User should exist');
return (
<CenteredContent>
<PageTitle title="People" />
<h1>People</h1>
<HelpText>
Everyone that has signed in to your Outline appear here. Its possible
that there are other people who have access but havent signed in yet.
</HelpText>
<List>
{users.data.map(user => (
<UserListItem
key={user.id}
user={user}
showMenu={!!currentUser.isAdmin && currentUser.id !== user.id}
/>
))}
</List>
</CenteredContent>
);
}
}
export default inject('auth', 'users')(People);