-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
UserShow.tsx
31 lines (27 loc) · 977 Bytes
/
UserShow.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* eslint react/jsx-key: off */
import * as React from 'react';
import PropTypes from 'prop-types';
import { Show, Tab, TabbedShowLayout, TextField } from 'react-admin'; // eslint-disable-line import/no-unresolved
import UserTitle from './UserTitle';
import Aside from './Aside';
const UserShow = ({ permissions, ...props }) => (
<Show title={<UserTitle />} aside={<Aside />} {...props}>
<TabbedShowLayout>
<Tab label="user.form.summary">
<TextField source="id" />
<TextField source="name" />
</Tab>
{permissions === 'admin' && (
<Tab label="user.form.security" path="security">
<TextField source="role" />
</Tab>
)}
</TabbedShowLayout>
</Show>
);
UserShow.propTypes = {
location: PropTypes.object.isRequired,
match: PropTypes.object.isRequired,
permissions: PropTypes.string,
};
export default UserShow;