-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add virtualized grid description and component (#1892)
- Loading branch information
1 parent
b02aa11
commit 00bc711
Showing
3 changed files
with
43 additions
and
0 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
28 changes: 28 additions & 0 deletions
28
...ted-components/descriptions/virtualized-grid-description/virtualized-grid-description.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,28 @@ | ||
import { useMemo } from "react"; | ||
import { RelatedComponent } from "vibe-storybook-components"; | ||
import VirtualizedGrid from "../../../../../components/VirtualizedGrid/VirtualizedGrid"; | ||
import { | ||
generateItems, | ||
itemRenderer | ||
} from "../../../../../components/VirtualizedGrid/__stories__/VirtualizedGrid.stories.helpers"; | ||
import styles from "./virtualizedGrid.module.scss"; | ||
|
||
export const VirtualizedGridDescription = () => { | ||
const component = useMemo(() => { | ||
return ( | ||
<div className={styles.virtualizedGridItem}> | ||
<div className={styles.virtualizedGridItemChild}> | ||
<VirtualizedGrid id={"id"} items={generateItems(50, 100, 50)} itemRenderer={itemRenderer} /> | ||
</div> | ||
</div> | ||
); | ||
}, []); | ||
return ( | ||
<RelatedComponent | ||
component={component} | ||
title="VirtualizedGrid" | ||
href="/?path=/docs/navigation-virtualizedgrid--docs" | ||
description="VirtualizedGrid is a component which only renders visible grid items, it is a logic component and doesn't change and look and feel." | ||
/> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
.../related-components/descriptions/virtualized-grid-description/virtualizedGrid.module.scss
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,12 @@ | ||
.virtualizedGridItem { | ||
display: flex; | ||
align-items: center; | ||
overflow-x: hidden; | ||
width: 230px; | ||
height: 100%; | ||
} | ||
|
||
.virtualizedGridItemChild { | ||
width: inherit; | ||
height: inherit; | ||
} |