-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/PostHog/posthog into bran…
…ching-question-deletion-rearrangement
- Loading branch information
Showing
64 changed files
with
2,273 additions
and
798 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.5 KB
frontend/__snapshots__/components-playlist--multiple-sections--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.2 KB
frontend/__snapshots__/components-playlist--multiple-sections--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-12.3 KB
...end/__snapshots__/exporter-exporter--funnel-historical-trends-insight--dark.png
Binary file not shown.
Binary file removed
BIN
-12.1 KB
...nd/__snapshots__/exporter-exporter--funnel-historical-trends-insight--light.png
Binary file not shown.
Binary file modified
BIN
-25.1 KB
(81%)
frontend/__snapshots__/replay-player-failure--recent-recordings-404--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-25.5 KB
(81%)
frontend/__snapshots__/replay-player-failure--recent-recordings-404--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { Meta, StoryFn, StoryObj } from '@storybook/react' | ||
import { range } from 'lib/utils' | ||
|
||
import { Playlist, PlaylistProps } from './Playlist' | ||
|
||
type Story = StoryObj<typeof Playlist> | ||
const meta: Meta<typeof Playlist> = { | ||
title: 'Components/Playlist', | ||
component: Playlist, | ||
} | ||
export default meta | ||
|
||
type ObjectType = { id: string | number } | ||
|
||
const ListItem = ({ item }: { item: ObjectType }): JSX.Element => <div className="p-1">Object {item.id}</div> | ||
|
||
const Template: StoryFn<typeof Playlist> = (props: Partial<PlaylistProps<any>>) => { | ||
const mainContent = ({ activeItem }: { activeItem: ObjectType }): JSX.Element => ( | ||
<div className="flex items-center justify-center h-full"> | ||
{activeItem ? `Object ${activeItem.id} selected` : 'Select an item from the list'} | ||
</div> | ||
) | ||
|
||
return ( | ||
<div className="h-96 min-w-[40rem]"> | ||
<Playlist | ||
title="Title" | ||
sections={[]} | ||
listEmptyState={<div>No items</div>} | ||
content={mainContent} | ||
{...props} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export const Default: Story = Template.bind({}) | ||
Default.args = { | ||
sections: [ | ||
{ | ||
key: 'default', | ||
title: 'Default section', | ||
items: range(0, 100).map((idx) => ({ id: idx })), | ||
render: ListItem, | ||
}, | ||
], | ||
} | ||
|
||
export const MultipleSections: Story = Template.bind({}) | ||
MultipleSections.args = { | ||
sections: [ | ||
{ | ||
key: 'one', | ||
title: 'First section', | ||
items: range(0, 5).map((idx) => ({ id: idx })), | ||
render: ListItem, | ||
initiallyOpen: true, | ||
}, | ||
{ | ||
key: 'two', | ||
title: 'Second section', | ||
items: range(0, 5).map((idx) => ({ id: idx })), | ||
render: ListItem, | ||
}, | ||
], | ||
} | ||
|
||
export const WithFooter: Story = Template.bind({}) | ||
WithFooter.args = { | ||
sections: [ | ||
{ | ||
key: 'default', | ||
title: 'Section with footer', | ||
items: range(0, 100).map((idx) => ({ id: idx })), | ||
render: ListItem, | ||
footer: <div className="px-1 py-3">Section footer</div>, | ||
}, | ||
], | ||
} |
Oops, something went wrong.