-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prettify previous/next nav buttons
- Loading branch information
1 parent
1569468
commit fc84f81
Showing
4 changed files
with
100 additions
and
62 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,53 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { | ||
LinkLookingLikeButton as LinkLookingLikeButtonBase, | ||
LinkLookingLikeButtonProps, | ||
} from 'src/components/Link/Link' | ||
import { BsCaretLeftFill as ArrowLeftBase, BsCaretRightFill as ArrowRightBase } from 'react-icons/bs' | ||
|
||
const ARROW_SIZE = 10 | ||
|
||
export interface LinkButtonNextProps extends LinkLookingLikeButtonProps { | ||
text: string | ||
} | ||
|
||
export function LinkButtonNext({ href, text, ...restProps }: LinkButtonNextProps) { | ||
return ( | ||
<LinkLookingLikeButton href={href} {...restProps}> | ||
{text} | ||
<ArrowRight size={ARROW_SIZE} /> | ||
</LinkLookingLikeButton> | ||
) | ||
} | ||
|
||
export interface LinkButtonPrevProps extends LinkLookingLikeButtonProps { | ||
text: string | ||
} | ||
|
||
export function LinkButtonPrev({ href, text, ...restProps }: LinkButtonPrevProps) { | ||
return ( | ||
<LinkLookingLikeButton href={href} {...restProps}> | ||
<ArrowLeft size={ARROW_SIZE} /> | ||
{text} | ||
</LinkLookingLikeButton> | ||
) | ||
} | ||
|
||
const LinkLookingLikeButton = styled(LinkLookingLikeButtonBase)` | ||
padding: 0.2rem 0.3rem; | ||
min-width: 120px; | ||
font-size: 0.8rem; | ||
` | ||
|
||
const ArrowRight = styled(ArrowRightBase)` | ||
margin-bottom: 2px; | ||
margin-left: 0.25rem; | ||
fill: ${(props) => props.theme.gray650}; | ||
` | ||
|
||
const ArrowLeft = styled(ArrowLeftBase)` | ||
margin-bottom: 2px; | ||
margin-right: 0.25rem; | ||
fill: ${(props) => props.theme.gray650}; | ||
` |
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
fc84f81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
flu-frequencies – ./
flu-frequencies-git-web-neherlab.vercel.app
flu-frequencies.vercel.app
flu-frequencies-neherlab.vercel.app