Skip to content

Commit 8e9d13c

Browse files
committed
Add position relative on all Shadcn/Chakra AspectRatio component replacement divs (#4801)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating various components to add the `relative` class to `div` elements that define aspect ratios, enhancing layout control and positioning. ### Detailed summary - Added `relative` class to `div` elements in: - `GameShowcase.tsx` for aspect ratios `16/9` - `GuideCard.tsx` for aspect ratios `2400/1260` - `airdrop-upload-erc20.tsx` for aspect ratios `21/9` - `chain-header.tsx` for conditional aspect ratios - `airdrop-upload.tsx` for aspect ratios `21/9` - `snapshot-upload.tsx` for aspect ratios `21/9` - `upload-step.tsx` for aspect ratio `square` - `NFTCards.tsx` for aspect ratio `square` - `MarketplaceDetails.tsx` for aspect ratio `square` - `dropzone.tsx` for aspect ratio adjustments - `WithoutThirdwebSection.tsx` for aspect ratios `16/10` - `logo/index.tsx` for aspect ratio `516/321` - Updated `Logo` component for aspect ratio `1377/267` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent d35f0b2 commit 8e9d13c

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/chain-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function ChainHeader(props: ChainHeaderProps) {
2121
{!props.headerImageUrl && <div className="h-8 md:hidden" />}
2222
<div
2323
className={cn(
24-
"max-sm:-mx-4 border-border border-b",
24+
"max-sm:-mx-4 relative border-border border-b",
2525
props.headerImageUrl ? "aspect-[4/1]" : "aspect-[8/1]",
2626
)}
2727
>

apps/dashboard/src/components/hackathon/gaming/GameShowcase.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const GameShowcase = () => {
8686
>
8787
<ModalCloseButton />
8888
</Box>
89-
<div className="aspect-[16/9] w-full">
89+
<div className="relative aspect-[16/9] w-full">
9090
<Box
9191
bg="#000"
9292
borderRadius={{ base: "md", md: "lg" }}

apps/dashboard/src/components/homepage/sections/WithoutThirdwebSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const WithoutThirdwebSection: React.FC = () => {
113113
>
114114
<SimpleGrid columns={12} gap={8} w="full">
115115
<GridItem colSpan={{ base: 12, md: 6 }}>
116-
<div className="aspect-[16/10] w-full">
116+
<div className="relative aspect-[16/10] w-full">
117117
<HomePageCodeBlock
118118
darkTheme={darkTheme}
119119
color="white"
@@ -131,7 +131,7 @@ export const WithoutThirdwebSection: React.FC = () => {
131131
</div>
132132
</GridItem>
133133
<GridItem colSpan={{ base: 12, md: 6 }}>
134-
<div className="aspect-[16/10] w-full">
134+
<div className="relative aspect-[16/10] w-full">
135135
<HomePageCodeBlock
136136
darkTheme={darkTheme}
137137
color="white"

apps/dashboard/src/components/ipfs-upload/dropzone.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const IpfsUploadDropzone: React.FC = () => {
7676
<Flex flexDir="column" gap={4}>
7777
<div
7878
className={cn(
79-
"w-full",
79+
"relative w-full",
8080
droppedFiles.length
8181
? "aspect-square md:aspect-[16/9]"
8282
: "aspect-[2] md:aspect-[36/9]",
@@ -234,7 +234,7 @@ const FileUpload: React.FC<FileUploadProps> = ({ files, updateFiles }) => {
234234
alignItems="center"
235235
>
236236
<GridItem colSpan={5} rowSpan={2}>
237-
<div className="aspect-square">
237+
<div className="relative aspect-square">
238238
<Box
239239
rounded="lg"
240240
overflow="hidden"

apps/dashboard/src/components/logo/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const IconLogo: React.FC<{ extraClass?: string; color?: string }> = ({
66
extraClass,
77
}) => {
88
return (
9-
<div className={cn("aspect-[516/321]", extraClass || "")}>
9+
<div className={cn("relative aspect-[516/321]", extraClass || "")}>
1010
<svg viewBox="0 0 516 321" fill="none">
1111
<title>thirdweb</title>
1212
<g clipPath="url(#clip0_3:35)">
@@ -100,7 +100,7 @@ export const Logo: React.FC<ILogoProps> = ({
100100
{(hideWordmark && !forceShowWordMark) ?? (
101101
<div
102102
className={cn(
103-
"aspect-[1377/267] w-24 flex-shrink-0 md:w-28",
103+
"relative aspect-[1377/267] w-24 flex-shrink-0 md:w-28",
104104
forceShowWordMark ? "block" : "none md:block",
105105
)}
106106
style={color ? { color } : undefined}

apps/dashboard/src/components/product-pages/common/GuideCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const GuideCard: React.FC<GuideCardProps> = ({
5151
_hover={{ opacity: 0.86 }}
5252
overflow="hidden"
5353
>
54-
<div className="aspect-[2400/1260] w-full">
54+
<div className="relative aspect-[2400/1260] w-full">
5555
<Box bg="rgba(0,0,0,.8)">
5656
<NextImage
5757
loading="lazy"

apps/dashboard/src/contract-ui/tabs/claim-conditions/components/snapshot-upload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export const SnapshotUpload: React.FC<SnapshotUploadProps> = ({
225225
<Flex flexGrow={1} align="center" overflow="auto">
226226
<Container maxW="container.page">
227227
<Flex gap={8} flexDir="column">
228-
<div className="aspect-[21/9] w-full">
228+
<div className="relative aspect-[21/9] w-full">
229229
<Center
230230
borderRadius="md"
231231
{...getRootProps()}

apps/dashboard/src/contract-ui/tabs/nfts/components/airdrop-upload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export const AirdropUpload: React.FC<AirdropUploadProps> = ({
204204
<Flex flexGrow={1} align="center" overflow="auto">
205205
<Container maxW="container.page">
206206
<Flex gap={8} flexDir="column">
207-
<div className="aspect-[21/9] w-full">
207+
<div className="relative aspect-[21/9] w-full">
208208
<Center
209209
borderRadius="md"
210210
{...getRootProps()}

apps/dashboard/src/contract-ui/tabs/overview/components/MarketplaceDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ const ListingCards: React.FC<ListingCardsProps> = ({
272272
_hover={{ opacity: 0.75, textDecoration: "none" }}
273273
>
274274
<Card p={0} position="relative">
275-
<div className="aspect-square w-full overflow-hidden rounded-xl">
275+
<div className="relative aspect-square w-full overflow-hidden rounded-xl">
276276
<Skeleton isLoaded={!isPending}>
277277
<NFTMediaWithEmptyState
278278
metadata={listing.asset.metadata}

apps/dashboard/src/contract-ui/tabs/overview/components/NFTCards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const NFTCards: React.FC<NFTCardsProps> = ({
7373
_hover={{ opacity: 0.75, textDecoration: "none" }}
7474
>
7575
<Card p={0} h="full">
76-
<div className="aspect-square w-full overflow-hidden rounded-xl">
76+
<div className="relative aspect-square w-full overflow-hidden rounded-xl">
7777
<Skeleton isLoaded={!isPending}>
7878
<NFTMediaWithEmptyState
7979
metadata={token.metadata}

0 commit comments

Comments
 (0)