Skip to content

Commit

Permalink
feat: fixing the theme contrast issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BLuEScioN committed Jan 14, 2025
1 parent 8c22b2a commit 7023dc2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/app/_components/BlockList/Grouped/skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ export function BlocksPageBlockListSkeleton() {
return (
// TODO: fix this loading state
<BlocksPageBlockListLayout>
<BlocksPageControlsSkeleton horizontal />
<UpdateBarSkeleton />
{/* <BlocksPageControlsSkeleton horizontal /> */}
{/* <UpdateBarSkeleton /> */}
<BlocksPageBlockListGroupedSkeleton />
</BlocksPageBlockListLayout>
);
Expand Down
5 changes: 3 additions & 2 deletions src/app/_components/BlockList/Ungrouped/skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Caption } from '../../../../ui/typography';
import { BlockListGridHeaderRowSkeleton } from '../Grouped/skeleton';
import { LineAndNode } from '../LineAndNode';
import { BtcBlockRowLayout, StxBlocksGridLayout } from './BlockListUngrouped';
import StxIcon from '@/ui/icons/StxIcon';

export function BlockListRowSkeleton({
minimized,
Expand All @@ -18,8 +19,8 @@ export function BlockListRowSkeleton({
isFirst?: boolean;
}) {
const icon = isFirst ? (
<Icon h={2.5} w={2.5} fill="borderPrimary">
<Circle />
<Icon h={2.5} w={2.5} fill="white">
<StxIcon />
</Icon>
) : null;
return minimized ? (
Expand Down
1 change: 0 additions & 1 deletion src/app/blocks/PageClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import dynamic from 'next/dynamic';

import { BlocksPageBlockListSkeleton } from '../_components/BlockList/Grouped/skeleton';
import { PageTitle } from '../_components/PageTitle';
import BlocksPageSkeleton from './skeleton';

const BlocksPageBlockListDynamic = dynamic(
() =>
Expand Down
3 changes: 2 additions & 1 deletion src/app/blocks/skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { BlocksPageLayout } from './PageClient';
export default function BlocksPageSkeleton() {
return (
<BlocksPageLayout
title={<PageTitle>Recent Blocks</PageTitle>}
title={<PageTitle>Recent Blocks</PageTitle>} // TODO: fix this loading state
blocksList={<BlocksPageBlockListSkeleton />}
// blocksList={null}
/>
);
}
11 changes: 8 additions & 3 deletions src/components/ui/color-mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ export function useColorMode() {
const { resolvedTheme, setTheme } = useTheme();
const setThemeCookie = useUpdateThemeCookie();

const toggleColorMode = () => {
const toggleColorMode = useCallback(() => {
setTheme(resolvedTheme === 'light' ? 'dark' : 'light');
setThemeCookie(resolvedTheme === 'light' ? 'dark' : 'light');
};
}, [setTheme, setThemeCookie, resolvedTheme]);

const setColorMode = useCallback((theme: 'light' | 'dark') => {
setTheme(theme);
setThemeCookie(theme);
}, [setTheme, setThemeCookie]);

return {
colorMode: resolvedTheme || 'light',
setColorMode: setTheme,
setColorMode,
toggleColorMode,
};
}
Expand Down
1 change: 1 addition & 0 deletions src/ui/theme/sizes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { SPACE } from './space';

export const CURRENT_SIZES = {
4.5: { value: '1.125rem' },
60: { value: '3.75rem' },
150: { value: '9.375rem' },
};

Expand Down

0 comments on commit 7023dc2

Please sign in to comment.