apply the skeleton component to the Plugin loading card

pull/12372/head
Yi 1 year ago
parent b8f9747849
commit d6dea67947

@ -3,7 +3,7 @@ import classNames from '@/utils/classnames'
type SkeletonProps = ComponentProps<'div'> type SkeletonProps = ComponentProps<'div'>
export const SkeletonContanier: FC<SkeletonProps> = (props) => { export const SkeletonContainer: FC<SkeletonProps> = (props) => {
const { className, children, ...rest } = props const { className, children, ...rest } = props
return ( return (
<div className={classNames('flex flex-col gap-1', className)} {...rest}> <div className={classNames('flex flex-col gap-1', className)} {...rest}>
@ -24,7 +24,7 @@ export const SkeletonRow: FC<SkeletonProps> = (props) => {
export const SkeletonRectangle: FC<SkeletonProps> = (props) => { export const SkeletonRectangle: FC<SkeletonProps> = (props) => {
const { className, children, ...rest } = props const { className, children, ...rest } = props
return ( return (
<div className={classNames('h-2 rounded-sm opacity-20 bg-text-tertiary my-1', className)} {...rest}> <div className={classNames('h-2 rounded-sm opacity-20 bg-text-quaternary my-1', className)} {...rest}>
{children} {children}
</div> </div>
) )

@ -1,5 +1,6 @@
import { Group } from '../../../base/icons/src/vender/other' import { Group } from '../../../base/icons/src/vender/other'
import Title from './title' import Title from './title'
import { SkeletonContainer, SkeletonPoint, SkeletonRectangle, SkeletonRow } from '@/app/components/base/skeleton'
import cn from '@/utils/classnames' import cn from '@/utils/classnames'
type Props = { type Props = {
@ -17,7 +18,7 @@ const Placeholder = ({
}: Props) => { }: Props) => {
return ( return (
<div className={wrapClassName}> <div className={wrapClassName}>
<div className="flex"> <SkeletonRow>
<div <div
className='flex w-10 h-10 p-1 justify-center items-center gap-2 rounded-[10px] className='flex w-10 h-10 p-1 justify-center items-center gap-2 rounded-[10px]
border-[0.5px] border-components-panel-border bg-background-default backdrop-blur-sm'> border-[0.5px] border-components-panel-border bg-background-default backdrop-blur-sm'>
@ -25,24 +26,24 @@ const Placeholder = ({
<Group className='text-text-tertiary' /> <Group className='text-text-tertiary' />
</div> </div>
</div> </div>
<div className="ml-3 grow"> <div className="grow">
<div className="flex items-center h-5"> <SkeletonContainer>
{loadingFileName ? ( <div className="flex items-center h-5">
<Title title={loadingFileName} /> {loadingFileName ? (
) : ( <Title title={loadingFileName} />
<LoadingPlaceholder className="w-[260px]" /> ) : (
)} <SkeletonRectangle className="w-[260px]" />
</div> )}
<div className={cn('flex items-center h-4 space-x-0.5')}> </div>
<LoadingPlaceholder className="w-[41px]" /> <SkeletonRow className="h-4">
<span className='shrink-0 text-text-quaternary system-xs-regular'> <SkeletonRectangle className="w-[41px]" />
· <SkeletonPoint />
</span> <SkeletonRectangle className="w-[180px]" />
<LoadingPlaceholder className="w-[180px]" /> </SkeletonRow>
</div> </SkeletonContainer>
</div> </div>
</div> </SkeletonRow>
<LoadingPlaceholder className="mt-3 w-[420px]" /> <SkeletonRectangle className="mt-3 w-[420px]" />
</div> </div>
) )
} }

Loading…
Cancel
Save