Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard] Remove VStack - Need test so do not merge #4727

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/dashboard/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
"FormErrorMessage",
"MenuGroup",
"MenuItem",
"VStack",
// also the types
"ButtonProps",
"BadgeProps",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
Select,
Stack,
type UseDisclosureReturn,
VStack,
useDisclosure,
} from "@chakra-ui/react";
import { useQuery } from "@tanstack/react-query";
Expand Down Expand Up @@ -341,7 +340,7 @@ const ReceiveFundsModal = ({
<ModalHeader>Receive Funds</ModalHeader>
<ModalCloseButton />
<ModalBody>
<VStack spacing={4} pb={8}>
<div className="flex flex-col space-y-4 pb-8">
<Text w="full" textAlign="left">
Fund this address or QR code:
</Text>
Expand All @@ -355,7 +354,7 @@ const ReceiveFundsModal = ({
rounded="lg"
w={200}
/>
</VStack>
</div>
</ModalBody>
</ModalContent>
</Modal>
Expand Down
16 changes: 3 additions & 13 deletions apps/dashboard/src/components/hackathon/HacakthonEarnFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, Icon, VStack } from "@chakra-ui/react";
import { Flex, Icon } from "@chakra-ui/react";
import { ImMagicWand } from "@react-icons/all-files/im/ImMagicWand";
import { ChakraNextImage } from "components/Image";
import { useTrack } from "hooks/analytics/useTrack";
Expand All @@ -15,17 +15,7 @@ export const HackathonEarnFooter = ({
const trackEvent = useTrack();

return (
<VStack
bg='url("/assets/hackathon/footer-bg.png")'
bgSize="cover"
bgRepeat="no-repeat"
bgPosition="center"
w="100%"
py={20}
gap={10}
borderTopRadius="50px"
px={6}
>
<div className="flex flex-col items-center bg-[url('/assets/hackathon/footer-bg.png')] bg-cover bg-no-repeat bg-center w-full py-20 space-y-10 rounded-t-[50px] px-6">
<ChakraNextImage
src={require("../../../public/assets/landingpage/earnxtw.svg")}
alt="Hackathon"
Expand Down Expand Up @@ -108,6 +98,6 @@ export const HackathonEarnFooter = ({
Submission
</LinkButton>
</Flex>
</VStack>
</div>
);
};
16 changes: 3 additions & 13 deletions apps/dashboard/src/components/hackathon/HackathonFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, Icon, VStack } from "@chakra-ui/react";
import { Flex, Icon } from "@chakra-ui/react";
import { ImMagicWand } from "@react-icons/all-files/im/ImMagicWand";
import { ChakraNextImage } from "components/Image";
import { useTrack } from "hooks/analytics/useTrack";
Expand All @@ -15,17 +15,7 @@ export const HackathonFooter = ({
const trackEvent = useTrack();

return (
<VStack
bg='url("/assets/hackathon/footer-bg.png")'
bgSize="cover"
bgRepeat="no-repeat"
bgPosition="center"
w="100%"
py={20}
gap={10}
borderTopRadius="50px"
px={6}
>
<div className="flex flex-col items-center bg-[url('/assets/hackathon/footer-bg.png')] bg-cover bg-no-repeat bg-center w-full py-20 space-y-10 rounded-t-[50px] px-6">
kien-ngo marked this conversation as resolved.
Show resolved Hide resolved
<ChakraNextImage
src={require("../../../public/assets/landingpage/thirdwebw.svg")}
alt="hackathon-partner"
Expand Down Expand Up @@ -104,6 +94,6 @@ export const HackathonFooter = ({
Submission
</LinkButton>
</Flex>
</VStack>
</div>
);
};
6 changes: 3 additions & 3 deletions apps/dashboard/src/components/hackathon/Judges.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, SimpleGrid, VStack } from "@chakra-ui/react";
import { Flex, SimpleGrid } from "@chakra-ui/react";
import { Heading, Text, TrackedLink } from "tw-components";
import { MaskedAvatar } from "tw-components/masked-avatar";

Expand Down Expand Up @@ -35,7 +35,7 @@ export const Judges = ({ TRACKING_CATEGORY }: JudgesProps) => {
];

return (
<VStack spacing={8} position="relative">
<div className="space-y-8 relative flex flex-col">
kien-ngo marked this conversation as resolved.
Show resolved Hide resolved
<Heading size="title.2xl">Judges</Heading>
<SimpleGrid
columns={{ base: 1, lg: 4 }}
Expand Down Expand Up @@ -71,6 +71,6 @@ export const Judges = ({ TRACKING_CATEGORY }: JudgesProps) => {
</Flex>
))}
</SimpleGrid>
</VStack>
</div>
);
};
6 changes: 3 additions & 3 deletions apps/dashboard/src/components/hackathon/JudgesEarn.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, SimpleGrid, VStack } from "@chakra-ui/react";
import { Flex, SimpleGrid } from "@chakra-ui/react";
import { Heading, Text } from "tw-components";
import { MaskedAvatar } from "tw-components/masked-avatar";

Expand Down Expand Up @@ -27,7 +27,7 @@ export const JudgesEarn = () => {
];

return (
<VStack spacing={8} position="relative">
<div className="flex flex-col space-y-8 relative">
kien-ngo marked this conversation as resolved.
Show resolved Hide resolved
<Heading size="title.2xl">Judges</Heading>
<SimpleGrid
columns={{ base: 1, lg: 4 }}
Expand All @@ -52,6 +52,6 @@ export const JudgesEarn = () => {
</Flex>
))}
</SimpleGrid>
</VStack>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Avatar, Flex, VStack } from "@chakra-ui/react";
import { Avatar, Flex } from "@chakra-ui/react";
import { Heading, Text, TrackedLink } from "tw-components";

interface AvatarShowcaseProps {
Expand All @@ -18,7 +18,7 @@ export const AvatarShowcase: React.FC<AvatarShowcaseProps> = ({
trackingCategory,
}) => {
return (
<VStack spacing={12}>
<div className="flex flex-col spacing-y-12">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind the gap

<Heading size="title.2xl">{title}</Heading>
<Flex
maxW="container.md"
Expand Down Expand Up @@ -68,6 +68,6 @@ export const AvatarShowcase: React.FC<AvatarShowcaseProps> = ({
</Flex>
))}
</Flex>
</VStack>
</div>
);
};
6 changes: 3 additions & 3 deletions apps/dashboard/src/components/onboarding/General.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
import { Flex, FocusLock, VStack } from "@chakra-ui/react";
import { Flex, FocusLock } from "@chakra-ui/react";
import { AccountForm } from "components/settings/Account/AccountForm";
import { useState } from "react";
import { useActiveWallet, useDisconnect } from "thirdweb/react";
Expand Down Expand Up @@ -60,7 +60,7 @@ const OnboardingGeneral: React.FC<OnboardingGeneralProps> = ({
onDuplicateError={onDuplicate}
/>

<VStack justifyContent="center" w="full" gap={2}>
<div className="flex flex-col justify-center w-full gap-2">
{!existing ? (
<>
<Button
Expand Down Expand Up @@ -94,7 +94,7 @@ const OnboardingGeneral: React.FC<OnboardingGeneralProps> = ({
I don&apos;t have an account
</Button>
)}
</VStack>
</div>
</Flex>
</FocusLock>
);
Expand Down
11 changes: 4 additions & 7 deletions apps/dashboard/src/components/onboarding/Steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useApiKeys,
} from "@3rdweb-sdk/react/hooks/useApi";
import { useLoggedInUser } from "@3rdweb-sdk/react/hooks/useLoggedInUser";
import { Flex, HStack, VStack, useBreakpointValue } from "@chakra-ui/react";
import { Flex, HStack, useBreakpointValue } from "@chakra-ui/react";
import { ChakraNextImage } from "components/Image";
import { OPSponsoredChains } from "constants/chains";
import { useTrack } from "hooks/analytics/useTrack";
Expand Down Expand Up @@ -273,11 +273,8 @@ export const OnboardingSteps: React.FC<OnboardingStepsProps> = ({
overflow="hidden"
className="bg-muted/50"
>
<VStack
gap={2}
alignItems="flex-start"
p={6}
w={rightImageDark && !isMobile ? "60%" : "100%"}
<div
className={`gap-2 flex flex-col items-start p-6 ${rightImageDark && !isMobile ? "w-[60%]" : "w-full"}`}
kien-ngo marked this conversation as resolved.
Show resolved Hide resolved
>
<Heading size="title.sm">{title}</Heading>
<Text>{description}</Text>
Expand Down Expand Up @@ -308,7 +305,7 @@ export const OnboardingSteps: React.FC<OnboardingStepsProps> = ({
</Button>
)}
</HStack>
</VStack>
</div>
{rightImageDark && !isMobile && theme === "dark" && (
<ChakraNextImage src={rightImageDark} alt={""} w="50%" priority />
)}
Expand Down
5 changes: 2 additions & 3 deletions apps/dashboard/src/components/onboarding/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { VStack } from "@chakra-ui/react";
import { Heading, Text } from "tw-components";

interface OnboardingTitleProps {
Expand All @@ -11,14 +10,14 @@ export const OnboardingTitle: React.FC<OnboardingTitleProps> = ({
description,
}) => {
return (
<VStack alignItems="flex-start" gap={3}>
<div className="flex flex-col gap-3 items-start">
<Heading size="title.sm">{heading}</Heading>

{description && (
<Text size="body.md" fontWeight="medium">
{description}
</Text>
)}
</VStack>
</div>
);
};
23 changes: 4 additions & 19 deletions apps/dashboard/src/components/settings/Account/AccountForm.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { type Account, useUpdateAccount } from "@3rdweb-sdk/react/hooks/useApi";
import {
Flex,
FormControl,
HStack,
Input,
VStack,
useColorModeValue,
} from "@chakra-ui/react";
import { Flex, FormControl, HStack, Input } from "@chakra-ui/react";
import { zodResolver } from "@hookform/resolvers/zod";
import { ManageBillingButton } from "components/settings/Account/Billing/ManageButton";
import { useTrack } from "hooks/analytics/useTrack";
Expand Down Expand Up @@ -61,7 +54,6 @@ export const AccountForm: React.FC<AccountFormProps> = ({
showSubscription && !!account.email?.length,
);
const trackEvent = useTrack();
const bg = useColorModeValue("backgroundCardHighlight", "transparent");

const form = useForm<AccountValidationSchema>({
resolver: zodResolver(accountValidationSchema),
Expand Down Expand Up @@ -138,15 +130,8 @@ export const AccountForm: React.FC<AccountFormProps> = ({

return (
<form onSubmit={handleSubmit}>
<VStack
alignItems="flex-start"
w="full"
gap={horizontal ? 6 : 8}
borderRadius="xl"
borderColor="borderColor"
borderWidth={padded ? 1 : 0}
bg={bg}
p={padded ? 6 : 0}
<div
className={`items-start w-full ${horizontal ? "gap-6" : "gap-8"} rounded-xl ${padded ? "border border-border p-6" : "p-0"} bg-background`}
kien-ngo marked this conversation as resolved.
Show resolved Hide resolved
>
<Flex
gap={horizontal ? 4 : 8}
Expand Down Expand Up @@ -252,7 +237,7 @@ export const AccountForm: React.FC<AccountFormProps> = ({
</Button>
)}
</HStack>
</VStack>
</div>
</form>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type {
Account,
UsageBillableByService,
} from "@3rdweb-sdk/react/hooks/useApi";
import { VStack } from "@chakra-ui/react";
import { format } from "date-fns/format";
import { useMemo } from "react";
import { Text } from "tw-components";
Expand Down Expand Up @@ -38,7 +37,7 @@ export const BillingPeriod: React.FC<BillingPeriodProps> = ({
}

return (
<VStack alignItems={{ base: "flex-start", lg: "flex-end" }} gap={1}>
<div className="items-start lg:items-end flex flex-col gap-1">
<Text size="body.md" as="span">
Current billing period:
<Text as="span" color="bgBlack" pl={2} fontWeight="medium">
Expand All @@ -60,6 +59,6 @@ export const BillingPeriod: React.FC<BillingPeriodProps> = ({
{totalUsd}
</Text>
</Text>
</VStack>
</div>
);
};
22 changes: 11 additions & 11 deletions apps/dashboard/src/components/settings/Account/Usage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UsageBillableByService } from "@3rdweb-sdk/react/hooks/useApi";
import { SimpleGrid, Spinner, VStack } from "@chakra-ui/react";
import { SimpleGrid, Spinner } from "@chakra-ui/react";
import { useMemo } from "react";
import { Heading, Text } from "tw-components";
import { toNumber, toPercent, toSize } from "utils/number";
Expand Down Expand Up @@ -111,11 +111,11 @@ export const Usage: React.FC<UsageProps> = ({
}, [usageData]);

return (
<VStack gap={8} w="full">
<div className="w-full gap-8 flex flex-col">
{usageLoading && <Spinner size="sm" />}
{!usageLoading && (
<VStack w="full" gap={12}>
<VStack alignItems="flex-start" gap={6} w="full">
<div className="gap-12 w-full flex flex-col">
<div className="items-start gap-6 w-full flex flex-col">
<Heading as="h4" size="title.sm">
Infrastructure
</Heading>
Expand All @@ -141,9 +141,9 @@ export const Usage: React.FC<UsageProps> = ({
tooltip="Storage pinning usage is calculated by GB per file size."
/>
</SimpleGrid>
</VStack>
</div>

<VStack alignItems="flex-start" gap={6} w="full">
<div className="items-start gap-6 w-full flex flex-col">
<Heading as="h4" size="title.sm">
Wallets
</Heading>
Expand All @@ -159,9 +159,9 @@ export const Usage: React.FC<UsageProps> = ({
tooltip="Email wallet (with managed recovery code) usage is calculated by monthly active wallets (i.e. active as defined by at least 1 user log-in via email or social within the billing period month)."
/>
</SimpleGrid>
</VStack>
</div>

<VStack alignItems="flex-start" gap={6} w="full">
<div className="items-start gap-6 w-full flex flex-col">
<Heading as="h4" size="title.sm">
Payments
</Heading>
Expand All @@ -177,9 +177,9 @@ export const Usage: React.FC<UsageProps> = ({
tooltip="(Gasless, Paymaster, Bundler) usage is calculated by sponsored network fees."
/>
</SimpleGrid>
</VStack>
</VStack>
</div>
</div>
)}
</VStack>
</div>
);
};
Loading