-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin): initial per page component
- Loading branch information
Showing
5 changed files
with
126 additions
and
3 deletions.
There are no files selected for viewing
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,48 @@ | ||
@import '../../../scss/styles.scss'; | ||
|
||
.per-page { | ||
display: flex; | ||
margin-bottom: $baseline; | ||
margin-right: 0; | ||
margin-left: auto; | ||
|
||
button { | ||
padding: base(.25) 0; | ||
line-height: base(1); | ||
background: transparent; | ||
border: 0; | ||
font-weight: 600; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
&:active, | ||
&:focus { | ||
outline: none; | ||
} | ||
} | ||
|
||
span { | ||
color: $color-gray; | ||
} | ||
|
||
ul { | ||
list-style: none; | ||
padding: 0; | ||
text-align: left; | ||
margin: 0; | ||
|
||
li { | ||
text-decoration: none; | ||
} | ||
|
||
a { | ||
color: $color-gray; | ||
&:visited, &:link, &:active { | ||
text-decoration: none; | ||
} | ||
} | ||
} | ||
} |
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,49 @@ | ||
import React from 'react'; | ||
|
||
import './index.scss'; | ||
import { Link } from 'react-router-dom'; | ||
import Popup from '../Popup'; | ||
import Chevron from '../../icons/Chevron'; | ||
|
||
const baseClass = 'per-page'; | ||
type Props = { | ||
valueOptions: number[]; | ||
} | ||
|
||
const PerPage: React.FC<Props> = ({ valueOptions }) => ( | ||
<div className={baseClass}> | ||
<Popup | ||
horizontalAlign="center" | ||
button={( | ||
<div> | ||
Per Page: | ||
<Chevron /> | ||
</div> | ||
)} | ||
backgroundColor="#333333" | ||
render={({ close }) => ( | ||
<div> | ||
<ul> | ||
{valueOptions.map((option, i) => ( | ||
<li | ||
className={`${baseClass}-item`} | ||
key={i} | ||
> | ||
<Link | ||
to="/asdf" | ||
onClick={close} | ||
> | ||
{option} | ||
</Link> | ||
|
||
</li> | ||
))} | ||
|
||
</ul> | ||
</div> | ||
)} | ||
/> | ||
</div> | ||
); | ||
|
||
export default PerPage; |
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
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
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