Skip to content

Commit b4e5dc1

Browse files
committed
[Dashboard] Migrate missing extension overlay from chakra to tailwind css (#6677)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR primarily focuses on enhancing the UI components related to settings by adding `overflow="hidden"` to `Card` components and refining the `SettingDetectedState` component's structure and styling for improved clarity and responsiveness. ### Detailed summary - Added `overflow="hidden"` to `Card` components in multiple files. - Refactored `SettingDetectedState` to use a function declaration instead of a functional component type. - Improved the layout and styling of the loading and error states in `SettingDetectedState`. - Replaced `SimpleGrid` with a `div` for better control over layout. - Updated text structure and classes for better styling consistency. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 8b4091e commit b4e5dc1

File tree

5 files changed

+36
-51
lines changed

5 files changed

+36
-51
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Flex, SimpleGrid, Spinner } from "@chakra-ui/react";
1+
import { Spinner } from "@/components/ui/Spinner/Spinner";
2+
import { TrackedUnderlineLink } from "@/components/ui/tracked-link";
23
import type { ExtensionDetectedState } from "components/buttons/ExtensionDetectedState";
3-
import { ExternalLinkIcon, Grid2x2XIcon } from "lucide-react";
4-
import { Heading, Text, TrackedLink } from "tw-components";
4+
import { Grid2x2XIcon } from "lucide-react";
55

66
const settingTypeMap = {
77
metadata: {
@@ -26,61 +26,46 @@ const settingTypeMap = {
2626
},
2727
} as const;
2828

29-
interface SettingDetectedStateProps {
30-
type: keyof typeof settingTypeMap;
31-
detectedState: ExtensionDetectedState;
32-
}
33-
34-
export const SettingDetectedState: React.FC<SettingDetectedStateProps> = ({
29+
export function SettingDetectedState({
3530
type,
3631
detectedState,
37-
}) => {
32+
}: {
33+
type: keyof typeof settingTypeMap;
34+
detectedState: ExtensionDetectedState;
35+
}) {
3836
if (detectedState === "enabled") {
3937
return null;
4038
}
4139

4240
const metadata = settingTypeMap[type];
4341

4442
return (
45-
<SimpleGrid
46-
position="absolute"
47-
top={0}
48-
left={0}
49-
bottom={0}
50-
right={0}
51-
zIndex={1}
52-
placeItems="center"
53-
px={{ base: 6, md: 0 }}
54-
borderRadius="md"
55-
className="bg-background"
56-
>
43+
<div className="absolute inset-0 z-10 grid place-items-center bg-card p-6">
5744
{detectedState === "loading" ? (
58-
<Spinner size="sm" />
45+
<Spinner className="size-4" />
5946
) : (
60-
<Flex flexDir="column" gap={3}>
61-
<Flex align="center" gap={2}>
47+
<div className="flex flex-col items-center text-center">
48+
<div className="mb-2 flex size-10 items-center justify-center rounded-full border bg-background">
6249
<Grid2x2XIcon className="size-4 text-red-500" />
63-
<Heading size="subtitle.md">Missing extension</Heading>
64-
</Flex>
65-
<Text>
66-
This contract does not implement the required extension for{" "}
67-
<strong>{metadata.name}</strong>.
68-
</Text>
69-
<TrackedLink
70-
category="contract-settings"
71-
label="metadata-extension"
72-
href={metadata.portalLink}
73-
isExternal
74-
display="flex"
75-
flexDir="row"
76-
alignItems="center"
77-
gap={2}
78-
>
79-
Learn how to enable this extension
80-
<ExternalLinkIcon className="size-4" />
81-
</TrackedLink>
82-
</Flex>
50+
</div>
51+
<div>
52+
<h3 className="mb-2 font-semibold text-lg">Missing extension</h3>
53+
<p className="mb-0.5 text-muted-foreground text-sm">
54+
This contract does not implement the required extension for{" "}
55+
<span className="text-foreground">{metadata.name}</span>
56+
</p>
57+
<TrackedUnderlineLink
58+
category="contract-settings"
59+
label="metadata-extension"
60+
href={metadata.portalLink}
61+
target="_blank"
62+
className="text-muted-foreground text-sm"
63+
>
64+
Learn how to enable this extension
65+
</TrackedUnderlineLink>
66+
</div>
67+
</div>
8368
)}
84-
</SimpleGrid>
69+
</div>
8570
);
86-
};
71+
}

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/metadata.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const SettingsMetadata = ({
143143
);
144144

145145
return (
146-
<Card p={0} position="relative">
146+
<Card p={0} position="relative" overflow="hidden">
147147
<SettingDetectedState type="metadata" detectedState={detectedState} />
148148
<Flex
149149
as="form"

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/platform-fees.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const SettingsPlatformFees = ({
7676
);
7777

7878
return (
79-
<Card p={0} position="relative">
79+
<Card p={0} position="relative" overflow="hidden">
8080
<SettingDetectedState type="platformFee" detectedState={detectedState} />
8181
<Flex
8282
as="form"

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/primary-sale.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const SettingsPrimarySale = ({
6868
);
6969

7070
return (
71-
<Card p={0} position="relative">
71+
<Card p={0} position="relative" overflow="hidden">
7272
<SettingDetectedState type="primarySale" detectedState={detectedState} />
7373
<Flex
7474
as="form"

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/royalties.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const SettingsRoyalties = ({
8989
);
9090

9191
return (
92-
<Card p={0} position="relative">
92+
<Card p={0} position="relative" overflow="hidden">
9393
<SettingDetectedState type="royalties" detectedState={detectedState} />
9494
<Flex
9595
as="form"

0 commit comments

Comments
 (0)