-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: [M3-7537] - PaginationControls Storybook v7 Story (#9959)
* pagination story * update comments and tests * changeset * fix page arg not taking effect * Update packages/manager/src/components/PaginationControls/PaginationControls.stories.tsx Co-authored-by: Banks Nussman <[email protected]> * update import --------- Co-authored-by: Banks Nussman <[email protected]>
- Loading branch information
1 parent
1060a1c
commit d26bb93
Showing
5 changed files
with
77 additions
and
34 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-9959-tech-stories-1701811015350.md
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,5 @@ | ||
--- | ||
"@linode/manager": Tech Stories | ||
--- | ||
|
||
PaginationControls V7 story migration ([#9959](https://github.com/linode/manager/pull/9959)) |
28 changes: 0 additions & 28 deletions
28
packages/manager/src/components/PaginationControls/PaginationControls.stories.mdx
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
packages/manager/src/components/PaginationControls/PaginationControls.stories.tsx
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,34 @@ | ||
import { useArgs } from '@storybook/preview-api'; | ||
import * as React from 'react'; | ||
|
||
import { PaginationControls } from './PaginationControls'; | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
type Story = StoryObj<typeof PaginationControls>; | ||
|
||
export const PaginationControl: Story = { | ||
args: { | ||
count: 250, | ||
page: 1, | ||
pageSize: 25, | ||
}, | ||
render: (args) => { | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
const [, setArgs] = useArgs(); | ||
|
||
return ( | ||
<PaginationControls | ||
{...args} | ||
onClickHandler={(page) => setArgs({ page })} | ||
/> | ||
); | ||
}, | ||
}; | ||
|
||
const meta: Meta<typeof PaginationControls> = { | ||
component: PaginationControls, | ||
title: 'Components/Pagination Control', | ||
}; | ||
|
||
export default meta; |
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