feature: add email in sorts fields
This commit is contained in:
@ -59,7 +59,7 @@ function TableHeader({
|
|||||||
label: 'Created at',
|
label: 'Created at',
|
||||||
order: 'asc',
|
order: 'asc',
|
||||||
id: sortId,
|
id: sortId,
|
||||||
} as SortType,
|
} satisfies SortType,
|
||||||
];
|
];
|
||||||
setSorts(newSorts);
|
setSorts(newSorts);
|
||||||
onSortsUpdate && onSortsUpdate(newSorts);
|
onSortsUpdate && onSortsUpdate(newSorts);
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
import { faUser, faList, faCalendar } from '@fortawesome/pro-regular-svg-icons';
|
import {
|
||||||
|
faUser,
|
||||||
|
faList,
|
||||||
|
faCalendar,
|
||||||
|
faEnvelope,
|
||||||
|
} from '@fortawesome/pro-regular-svg-icons';
|
||||||
import WithTopBarContainer from '../../layout/containers/WithTopBarContainer';
|
import WithTopBarContainer from '../../layout/containers/WithTopBarContainer';
|
||||||
import Table from '../../components/table/Table';
|
import Table from '../../components/table/Table';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
@ -27,6 +32,21 @@ const reduceSortsToOrderBy = (sorts: Array<SortType>): OrderBy[] => {
|
|||||||
return [mappedSorts];
|
return [mappedSorts];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sortsAvailable: Array<SortType<keyof GraphqlPerson>> = [
|
||||||
|
{
|
||||||
|
id: 'created_at',
|
||||||
|
label: 'Created at',
|
||||||
|
order: 'asc',
|
||||||
|
icon: faCalendar,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'email',
|
||||||
|
label: 'Email',
|
||||||
|
order: 'asc',
|
||||||
|
icon: faEnvelope,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
function People() {
|
function People() {
|
||||||
const [, setSorts] = useState([] as Array<SortType>);
|
const [, setSorts] = useState([] as Array<SortType>);
|
||||||
const [orderBy, setOrderBy] = useState(defaultOrderBy);
|
const [orderBy, setOrderBy] = useState(defaultOrderBy);
|
||||||
@ -38,15 +58,6 @@ function People() {
|
|||||||
|
|
||||||
const { data } = usePeopleQuery(orderBy);
|
const { data } = usePeopleQuery(orderBy);
|
||||||
|
|
||||||
const sortsAvailable: Array<SortType<keyof GraphqlPerson>> = [
|
|
||||||
{
|
|
||||||
id: 'created_at',
|
|
||||||
label: 'Created at',
|
|
||||||
order: 'asc',
|
|
||||||
icon: faCalendar,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WithTopBarContainer title="People" icon={faUser}>
|
<WithTopBarContainer title="People" icon={faUser}>
|
||||||
<StyledPeopleContainer>
|
<StyledPeopleContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user