forked from pawnhearts/django_react_admin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathusers.js
More file actions
26 lines (24 loc) · 885 Bytes
/
users.js
File metadata and controls
26 lines (24 loc) · 885 Bytes
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
import React from 'react';
import { useMediaQuery } from '@material-ui/core';
import { SimpleList, List, Datagrid, EmailField, TextField } from 'react-admin';
export const UserList = props => {
const isSmall = useMediaQuery(theme => theme.breakpoints.down('sm'));
return (
<List title="All users" {...props}>
{isSmall ? (
<SimpleList
primaryText={record => record.name}
secondaryText={record => record.username}
tertiaryText={record => record.email}
/>
) : (
<Datagrid>
<TextField source="id" />
<TextField source="name" />
<TextField source="username" />
<EmailField source="email" />
</Datagrid>
)}
</List>
);
};