-
-
Notifications
You must be signed in to change notification settings - Fork 980
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add @swmansion/t-rex-ui (#2895)
## Description Because of a ramping up maintainance cost across our suite of tools - Reanimated, Gesture Handler & React Native IDE we've decided to create a UI library for our reusable docusaurus components. The [`@swmansion/t-rex-ui`](https://github.com/software-mansion-labs/t-rex-ui) package aims to unify the components across our documentations. This will make the maintainance easier in the long term by code reuse. We hope that with a single source of truth will avoid the need of fixing a bug in 3-4 places instead of just one. Sidenote: the package requires the React & ReactDOM in version `18` or higher. ## Test plan ``` cd docs/ yarn # to test development build yarn start # to test production build yarn build yarn serve ``` --------- Co-authored-by: Jakub Piasecki <jakub.piasecki@swmansion.com>
- Loading branch information
1 parent
51cf28b
commit cc05007
Showing
3 changed files
with
35 additions
and
66 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
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 |
---|---|---|
@@ -1,43 +1,3 @@ | ||
import React from 'react'; | ||
import clsx from 'clsx'; | ||
import Link from '@docusaurus/Link'; | ||
import styles from './styles.module.css'; | ||
import ThemedImage from '@theme/ThemedImage'; | ||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
import { PaginatorNavLink } from '@swmansion/t-rex-ui'; | ||
|
||
export default function PaginatorNavLink(props) { | ||
const { permalink, title, subLabel, isNext } = props; | ||
const rightArrow = { | ||
light: useBaseUrl('/img/arrow-right.svg'), | ||
dark: useBaseUrl('/img/arrow-right-dark.svg'), | ||
}; | ||
|
||
const leftArrow = { | ||
light: useBaseUrl('/img/arrow-left.svg'), | ||
dark: useBaseUrl('/img/arrow-left-dark.svg'), | ||
}; | ||
|
||
return ( | ||
<Link | ||
className={clsx( | ||
styles.pagination, | ||
'pagination-nav__link', | ||
isNext ? 'pagination-nav__link--next' : 'pagination-nav__link--prev' | ||
)} | ||
to={permalink}> | ||
{subLabel && ( | ||
<div | ||
className={clsx( | ||
styles.paginationSublabel, | ||
isNext ? styles.paginationNext : styles.paginationPrevious | ||
)}> | ||
<div className={styles.paginationArrow}> | ||
<ThemedImage sources={isNext ? rightArrow : leftArrow} /> | ||
</div> | ||
<div className="pagination-nav__sublabel">{subLabel}</div> | ||
</div> | ||
)} | ||
<div className="pagination-nav__label">{title}</div> | ||
</Link> | ||
); | ||
} | ||
export default PaginatorNavLink; |
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