-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #354 from akhilmhdh/feat/table-loader
Table loading state and empty states
- Loading branch information
Showing
20 changed files
with
467 additions
and
309 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
20 changes: 20 additions & 0 deletions
20
frontend/src/components/v2/EmptyState/EmptyState.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,20 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { EmptyState } from './EmptyState'; | ||
|
||
const meta: Meta<typeof EmptyState> = { | ||
title: 'Components/EmptyState', | ||
component: EmptyState, | ||
tags: ['v2'], | ||
argTypes: {}, | ||
args: { | ||
title: 'No members found' | ||
} | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof EmptyState>; | ||
|
||
export const Basic: Story = { | ||
render: (args) => <EmptyState {...args} /> | ||
}; |
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,21 @@ | ||
import { ReactNode } from 'react'; | ||
import { faCubesStacked, IconDefinition } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { twMerge } from 'tailwind-merge'; | ||
|
||
type Props = { | ||
title: ReactNode; | ||
className?: string; | ||
children?: ReactNode; | ||
icon?: IconDefinition; | ||
}; | ||
|
||
export const EmptyState = ({ title, className, children, icon = faCubesStacked }: Props) => ( | ||
<div className={twMerge('flex w-full flex-col items-center px-2 pt-6 text-bunker-300', className)}> | ||
<FontAwesomeIcon icon={icon} size="2x" className='mr-4' /> | ||
<div className='flex flex-row items-center py-4'> | ||
<div className="text-bunker-300 text-sm">{title}</div> | ||
<div>{children}</div> | ||
</div> | ||
</div> | ||
); |
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 @@ | ||
export { EmptyState } from './EmptyState'; |
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,17 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Skeleton } from './Skeleton'; | ||
|
||
const meta: Meta<typeof Skeleton> = { | ||
title: 'Components/Skeleton', | ||
component: Skeleton, | ||
tags: ['v2'], | ||
argTypes: {} | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Skeleton>; | ||
|
||
export const Basic: Story = { | ||
render: (args) => <Skeleton {...args} /> | ||
}; |
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 @@ | ||
import { twMerge } from 'tailwind-merge'; | ||
|
||
export type Props = { | ||
className?: string; | ||
}; | ||
|
||
// To show something is coming up | ||
// Can be used with cards | ||
// Tables etc | ||
export const Skeleton = ({ className }: Props) => ( | ||
<div className={twMerge('h-6 w-full animate-pulse rounded-md bg-mineshaft-800', className)} /> | ||
); |
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 @@ | ||
export { Skeleton } from './Skeleton'; |
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
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
Oops, something went wrong.