-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix user page footer * Move styles into its own file * Make image undraggable * improved stylings for table footer (#112) Co-authored-by: Kyler Wong <wsm.kyler@gmail.com>
- Loading branch information
1 parent
8c7e72f
commit 9926c3d
Showing
5 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
...s/UserPage/UserLinkTable/UrlTable/MemoTablePagination/PaginationActionComponent/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react' | ||
import { Grid, IconButton, createStyles, makeStyles } from '@material-ui/core' | ||
import arrowLeftIcon from '../../../assets/arrow-left-icon.svg' | ||
import arrowRightIcon from '../../../assets/arrow-right-icon.svg' | ||
|
||
const useStyles = makeStyles(() => | ||
createStyles({ | ||
pageSelectGrid: { | ||
fontWeight: 500, | ||
color: '#767676', | ||
position: 'absolute', | ||
top: 0, | ||
left: 0, | ||
display: 'flex', | ||
justifyContent: 'center', | ||
width: '100%', | ||
height: '100%', | ||
zIndex: 1, | ||
}, | ||
gridItemHorizontalPadding: { | ||
'&:first-child': { | ||
paddingRight: 34, | ||
}, | ||
'&:last-child': { | ||
paddingLeft: 34, | ||
}, | ||
}, | ||
}), | ||
) | ||
|
||
export default ({ pageCount, onChangePage, page }) => { | ||
const classes = useStyles() | ||
return ( | ||
<Grid container item alignItems="center" className={classes.pageSelectGrid}> | ||
<Grid item className={classes.gridItemHorizontalPadding}> | ||
<IconButton | ||
onClick={(event) => onChangePage(event, page - 1)} | ||
disabled={page <= 0} | ||
> | ||
<img src={arrowLeftIcon} alt="Previous page" draggable={false} /> | ||
</IconButton> | ||
</Grid> | ||
<Grid item className={classes.gridItemHorizontalPadding}>{`Page ${ | ||
page + 1 | ||
} of ${pageCount}`}</Grid> | ||
<Grid item className={classes.gridItemHorizontalPadding}> | ||
<IconButton | ||
onClick={(event) => onChangePage(event, page + 1)} | ||
disabled={pageCount <= page + 1} | ||
> | ||
<img src={arrowRightIcon} alt="Next page" draggable={false} /> | ||
</IconButton> | ||
</Grid> | ||
</Grid> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/client/components/UserPage/UserLinkTable/UrlTable/MemoTablePagination/styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { createStyles, makeStyles } from '@material-ui/core' | ||
|
||
type StyleProps = { | ||
appMargins: number | ||
} | ||
|
||
export default makeStyles((theme) => | ||
createStyles({ | ||
toolbar: { | ||
paddingLeft: (props: StyleProps) => props.appMargins, | ||
paddingRight: (props: StyleProps) => props.appMargins, | ||
}, | ||
spacer: { | ||
flex: 0, | ||
}, | ||
caption: { | ||
fontWeight: 400, | ||
marginRight: '4px', | ||
[theme.breakpoints.down('sm')]: { | ||
display: 'none', | ||
}, | ||
}, | ||
select: { | ||
border: 'solid 1px #d8d8d8', | ||
zIndex: 2, | ||
[theme.breakpoints.down('sm')]: { | ||
display: 'none', | ||
}, | ||
}, | ||
selectIcon: { | ||
zIndex: 2, | ||
[theme.breakpoints.down('sm')]: { | ||
display: 'none', | ||
}, | ||
}, | ||
}), | ||
) |
6 changes: 6 additions & 0 deletions
6
src/client/components/UserPage/UserLinkTable/assets/arrow-left-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions
6
src/client/components/UserPage/UserLinkTable/assets/arrow-right-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.