saleor-dashboard/src/staff/components/StaffListPage/StaffListPage.tsx

53 lines
1.5 KiB
TypeScript
Raw Normal View History

2019-06-19 14:40:52 +00:00
import Button from "@material-ui/core/Button";
import AddIcon from "@material-ui/icons/Add";
2019-08-09 10:26:22 +00:00
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
2019-06-19 14:40:52 +00:00
import AppHeader from "@saleor/components/AppHeader";
import { Container } from "@saleor/components/Container";
import PageHeader from "@saleor/components/PageHeader";
import { sectionNames } from "@saleor/intl";
2019-08-09 11:14:35 +00:00
import { ListProps } from "@saleor/types";
2019-06-19 14:40:52 +00:00
import { StaffList_staffUsers_edges_node } from "../../types/StaffList";
import StaffList from "../StaffList/StaffList";
export interface StaffListPageProps extends ListProps {
staffMembers: StaffList_staffUsers_edges_node[];
onAdd: () => void;
onBack: () => void;
}
const StaffListPage: React.StatelessComponent<StaffListPageProps> = ({
disabled,
onAdd,
onBack,
...listProps
}) => {
const intl = useIntl();
return (
<Container>
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.configuration)}
</AppHeader>
<PageHeader title={intl.formatMessage(sectionNames.staff)}>
<Button
color="primary"
disabled={disabled}
variant="contained"
onClick={onAdd}
>
<FormattedMessage
2019-09-05 13:33:50 +00:00
defaultMessage="Invite staff member"
description="button"
/>
<AddIcon />
</Button>
</PageHeader>
<StaffList disabled={disabled} {...listProps} />
</Container>
);
};
2019-06-19 14:40:52 +00:00
StaffListPage.displayName = "StaffListPage";
export default StaffListPage;