Skip to content

Commit

Permalink
fix: shimmer styles import
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Apr 10, 2024
1 parent a470a57 commit 868ee71
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/app/components/account-total-balance.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { memo } from 'react';

import { css } from 'leather-styles/css';
import { styled } from 'leather-styles/jsx';

import { useTotalBalance } from '@app/common/hooks/balance/use-total-balance';
Expand All @@ -24,7 +23,7 @@ export const AccountTotalBalance = memo(({ btcAddress, stxAddress }: AccountTota
return (
<SkeletonLoader height="20px" isLoading={isInitialLoading}>
<styled.span
className={css(shimmerStyles)}
className={shimmerStyles}
textStyle="label.02"
data-state={isLoading ? 'loading' : undefined}
>
Expand Down
3 changes: 1 addition & 2 deletions src/app/components/account/account-name.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { memo } from 'react';

import { css } from 'leather-styles/css';
import { styled } from 'leather-styles/jsx';

import { shimmerStyles } from '@app/ui/shared/shimmer-styles';
Expand All @@ -12,7 +11,7 @@ interface AccountNameLayoutProps {

export const AccountNameLayout = memo(({ children, isLoading }: AccountNameLayoutProps) => (
<styled.span
className={css(shimmerStyles)}
className={shimmerStyles}
textStyle="label.02"
aria-busy={isLoading}
data-state={isLoading ? 'loading' : undefined}
Expand Down
3 changes: 1 addition & 2 deletions src/app/ui/components/skeleton-loader/skeleton-loader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { css } from 'leather-styles/css';
import { Box } from 'leather-styles/jsx';

import { shimmerStyles } from '@app/ui/shared/shimmer-styles';
Expand All @@ -24,7 +23,7 @@ export function SkeletonLoader({
bgColor="ink.non-interactive"
data-state="loading"
borderRadius="sm"
className={css(shimmerStyles)}
className={shimmerStyles}
/>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/ui/shared/shimmer-styles.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { SystemStyleObject } from 'leather-styles/types';
import { css } from 'leather-styles/css';

export const shimmerStyles: SystemStyleObject = {
export const shimmerStyles = css({
'&[data-state=loading]': {
display: 'inline-block',
WebkitMask: 'linear-gradient(-60deg, #000 30%, #0005, #000 70%) right/300% 100%',
backgroundRepeat: 'no-repeat',
animation: 'shimmer 1.5s infinite',
color: 'ink.text-subdued',
},
};
});

0 comments on commit 868ee71

Please sign in to comment.