-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashboard): add migratable object details (#4424)
* feat(dashboard): add migration overview * feat: refine values * fix: update summarizeMigratableObjectValues function * feat(dashboard): add migratable object details * feat: add object details * fix: add missing type * feat: use react query to cache data * refactor: show expiration label correctly * feat: add missing asset fallback * feat: simplify code, add correct timestamps * fix: remove package id * fix: bring back missing logic * fix: remove unnecesary memos and improve skeleton * perf: fetch objects in chunks * fix: remove duplicated export * fix: show correct time in expiration * feat: disable buttons * fix: remove file and improve sorting
- Loading branch information
Showing
31 changed files
with
1,133 additions
and
156 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
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
47 changes: 47 additions & 0 deletions
47
apps/ui-kit/src/lib/components/atoms/skeleton/Skeleton.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,47 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import cx from 'classnames'; | ||
|
||
interface SkeletonLoaderProps { | ||
/** | ||
* Width class for the skeleton div. | ||
*/ | ||
widthClass?: string; | ||
/** | ||
* Height class for the skeleton div. | ||
*/ | ||
heightClass?: string; | ||
/** | ||
* If true, the skeleton will use darker neutral colors. | ||
*/ | ||
hasSecondaryColors?: boolean; | ||
/** | ||
* Whether the class `rounded-full` should be applied. Defaults to true. | ||
*/ | ||
isRounded?: boolean; | ||
} | ||
|
||
export function Skeleton({ | ||
children, | ||
widthClass = 'w-full', | ||
heightClass = 'h-3', | ||
hasSecondaryColors, | ||
isRounded = true, | ||
}: React.PropsWithChildren<SkeletonLoaderProps>): React.JSX.Element { | ||
return ( | ||
<div | ||
className={cx( | ||
'animate-pulse rounded-full', | ||
widthClass, | ||
heightClass, | ||
isRounded && 'rounded-full', | ||
hasSecondaryColors | ||
? 'bg-neutral-80 dark:bg-neutral-10' | ||
: 'bg-neutral-90 dark:bg-neutral-12', | ||
)} | ||
> | ||
{children} | ||
</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,4 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export * from './Skeleton'; |
33 changes: 33 additions & 0 deletions
33
apps/ui-kit/src/storybook/stories/atoms/Skeleton.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,33 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Card, CardImage, ImageShape, Skeleton } from '@/components'; | ||
|
||
const meta: Meta<typeof Skeleton> = { | ||
component: Skeleton, | ||
tags: ['autodocs'], | ||
} satisfies Meta<typeof Skeleton>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const SkeletonCard: Story = { | ||
render: () => ( | ||
<Card> | ||
<CardImage shape={ImageShape.SquareRounded}> | ||
<div className="h-10 w-10 animate-pulse bg-neutral-90 dark:bg-neutral-12" /> | ||
<Skeleton widthClass="w-10" heightClass="h-10" isRounded={false} /> | ||
</CardImage> | ||
<div className="flex flex-col gap-y-xs"> | ||
<Skeleton widthClass="w-40" heightClass="h-3.5" /> | ||
<Skeleton widthClass="w-32" heightClass="h-3" hasSecondaryColors /> | ||
</div> | ||
<div className="ml-auto flex flex-col gap-y-xs"> | ||
<Skeleton widthClass="w-20" heightClass="h-3.5" /> | ||
<Skeleton widthClass="w-16" heightClass="h-3" hasSecondaryColors /> | ||
</div> | ||
</Card> | ||
), | ||
}; |
Oops, something went wrong.