mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-31 13:47:02 +02:00
Fix/texture (#330)
* fix: import svg instead of setting bg image * fix: add user pagination
This commit is contained in:
parent
a09ee63a40
commit
5ef3966179
@ -10,6 +10,7 @@ import Header from '../../menu/Header/Header';
|
|||||||
import Footer from '../../menu/Footer/Footer';
|
import Footer from '../../menu/Footer/Footer';
|
||||||
import Proclamation from '../../common/Proclamation/Proclamation';
|
import Proclamation from '../../common/Proclamation/Proclamation';
|
||||||
import BreadcrumbNav from '../../common/BreadcrumbNav/BreadcrumbNav';
|
import BreadcrumbNav from '../../common/BreadcrumbNav/BreadcrumbNav';
|
||||||
|
import { ReactComponent as Texture } from '../../../assets/img/texture.svg';
|
||||||
|
|
||||||
const useStyles = makeStyles(theme => ({
|
const useStyles = makeStyles(theme => ({
|
||||||
container: {
|
container: {
|
||||||
@ -35,13 +36,28 @@ const MainLayout = ({ children, location, uiConfig }) => {
|
|||||||
<Grid container className={muiStyles.container}>
|
<Grid container className={muiStyles.container}>
|
||||||
<div className={classnames(styles.contentWrapper)}>
|
<div className={classnames(styles.contentWrapper)}>
|
||||||
<Grid item className={styles.content} xs={12} sm={12}>
|
<Grid item className={styles.content} xs={12} sm={12}>
|
||||||
<div className={muiStyles.contentContainer}>
|
<div
|
||||||
|
className={muiStyles.contentContainer}
|
||||||
|
style={{ zIndex: '100' }}
|
||||||
|
>
|
||||||
<BreadcrumbNav />
|
<BreadcrumbNav />
|
||||||
<Proclamation toast={uiConfig.toast} />
|
<Proclamation toast={uiConfig.toast} />
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
<ErrorContainer />
|
<ErrorContainer />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<div style={{ overflow: 'hidden' }}>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'fixed',
|
||||||
|
right: '0',
|
||||||
|
bottom: '-4px',
|
||||||
|
zIndex: '1',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Texture />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Footer />
|
<Footer />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable react/jsx-no-target-blank */
|
/* eslint-disable react/jsx-no-target-blank */
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { List, ListItem, ListItemText, Grid } from '@material-ui/core';
|
import { List, ListItem, ListItemText, Grid } from '@material-ui/core';
|
||||||
|
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
.list {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.listItem {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.listItem a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
background: #fff;
|
|
||||||
padding: 2rem 4rem;
|
|
||||||
color: #000;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
@ -3,9 +3,10 @@ import { makeStyles } from '@material-ui/styles';
|
|||||||
export const useStyles = makeStyles(theme => ({
|
export const useStyles = makeStyles(theme => ({
|
||||||
footer: {
|
footer: {
|
||||||
background: theme.palette.footer.background,
|
background: theme.palette.footer.background,
|
||||||
padding: '2rem 4rem',
|
padding: '2.5rem 4rem',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
|
zIndex: 100,
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
padding: 0,
|
padding: 0,
|
||||||
|
@ -23,10 +23,6 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #ecebeb;
|
background-color: #ecebeb;
|
||||||
background-image: url('../assets/img/texture.svg');
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position-x: right;
|
|
||||||
background-position-y: bottom;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
@ -21,6 +21,8 @@ import useAdminUsersApi from '../../../../hooks/api/actions/useAdminUsersApi/use
|
|||||||
import UserListItem from './UserListItem/UserListItem';
|
import UserListItem from './UserListItem/UserListItem';
|
||||||
import loadingData from './loadingData';
|
import loadingData from './loadingData';
|
||||||
import useLoading from '../../../../hooks/useLoading';
|
import useLoading from '../../../../hooks/useLoading';
|
||||||
|
import usePagination from '../../../../hooks/usePagination';
|
||||||
|
import PaginateUI from '../../../../component/common/PaginateUI/PaginateUI';
|
||||||
|
|
||||||
function UsersList({ location, closeDialog, showDialog }) {
|
function UsersList({ location, closeDialog, showDialog }) {
|
||||||
const { users, roles, refetch, loading } = useUsers();
|
const { users, roles, refetch, loading } = useUsers();
|
||||||
@ -42,6 +44,8 @@ function UsersList({ location, closeDialog, showDialog }) {
|
|||||||
const [delUser, setDelUser] = useState();
|
const [delUser, setDelUser] = useState();
|
||||||
const [updateDialog, setUpdateDialog] = useState({ open: false });
|
const [updateDialog, setUpdateDialog] = useState({ open: false });
|
||||||
const ref = useLoading(loading);
|
const ref = useLoading(loading);
|
||||||
|
const { page, pages, nextPage, prevPage, setPageIndex, pageIndex } =
|
||||||
|
usePagination(users, 50);
|
||||||
|
|
||||||
const closeDelDialog = () => {
|
const closeDelDialog = () => {
|
||||||
setDelDialog(false);
|
setDelDialog(false);
|
||||||
@ -131,7 +135,7 @@ function UsersList({ location, closeDialog, showDialog }) {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return users.map(user => {
|
return page.map(user => {
|
||||||
return (
|
return (
|
||||||
<UserListItem
|
<UserListItem
|
||||||
key={user.id}
|
key={user.id}
|
||||||
@ -164,6 +168,13 @@ function UsersList({ location, closeDialog, showDialog }) {
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>{renderUsers()}</TableBody>
|
<TableBody>{renderUsers()}</TableBody>
|
||||||
|
<PaginateUI
|
||||||
|
pages={pages}
|
||||||
|
pageIndex={pageIndex}
|
||||||
|
setPageIndex={setPageIndex}
|
||||||
|
nextPage={nextPage}
|
||||||
|
prevPage={prevPage}
|
||||||
|
/>
|
||||||
</Table>
|
</Table>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
@ -9,10 +9,12 @@ import { ADMIN } from '../../../component/AccessProvider/permissions';
|
|||||||
import { Alert } from '@material-ui/lab';
|
import { Alert } from '@material-ui/lab';
|
||||||
import HeaderTitle from '../../../component/common/HeaderTitle';
|
import HeaderTitle from '../../../component/common/HeaderTitle';
|
||||||
import { Button } from '@material-ui/core';
|
import { Button } from '@material-ui/core';
|
||||||
|
import { useStyles } from './index.styles';
|
||||||
|
|
||||||
const UsersAdmin = ({ history }) => {
|
const UsersAdmin = ({ history }) => {
|
||||||
const { hasAccess } = useContext(AccessContext);
|
const { hasAccess } = useContext(AccessContext);
|
||||||
const [showDialog, setDialog] = useState(false);
|
const [showDialog, setDialog] = useState(false);
|
||||||
|
const styles = useStyles();
|
||||||
|
|
||||||
const openDialog = e => {
|
const openDialog = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -27,6 +29,7 @@ const UsersAdmin = ({ history }) => {
|
|||||||
<div>
|
<div>
|
||||||
<AdminMenu history={history} />
|
<AdminMenu history={history} />
|
||||||
<PageContent
|
<PageContent
|
||||||
|
bodyClass={styles.userListBody}
|
||||||
headerContent={
|
headerContent={
|
||||||
<HeaderTitle
|
<HeaderTitle
|
||||||
title="Users"
|
title="Users"
|
||||||
|
9
frontend/src/page/admin/users/index.styles.js
Normal file
9
frontend/src/page/admin/users/index.styles.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { makeStyles } from '@material-ui/styles';
|
||||||
|
|
||||||
|
export const useStyles = makeStyles(theme => ({
|
||||||
|
userListBody: {
|
||||||
|
paddingBottom: '4rem',
|
||||||
|
minHeight: '50vh',
|
||||||
|
position: 'relative',
|
||||||
|
},
|
||||||
|
}));
|
Loading…
Reference in New Issue
Block a user