Skip to content

Commit

Permalink
Merge pull request #646 from yagopajarino/fix/559
Browse files Browse the repository at this point in the history
refactor: make new group responsive
  • Loading branch information
vplasencia authored Jan 9, 2025
2 parents 5ea14b4 + c1cae25 commit 0c30d3c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 18 deletions.
2 changes: 0 additions & 2 deletions apps/dashboard/src/components/group-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export default function GroupCard({
justify="space-between"
fontFamily="DM Sans, sans-serif"
p="24px"
minW="330px"
maxW="370px"
h="280px"
>
<Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ export default function AccessModeStep({

return (
<>
<HStack>
<HStack
overflowX={{ base: "scroll" }}
width={{ base: "100%", md: "auto" }}
>
{accessModes.map((accessMode: any) => (
<VStack
borderColor={
Expand All @@ -88,12 +91,13 @@ export default function AccessModeStep({
borderWidth="2px"
borderRadius="8px"
w="260px"
h="210px"
h={{ base: "250px", lg: "210px" }}
align="left"
spacing="0"
cursor="pointer"
onClick={() => setAccessMode(accessMode)}
key={accessMode}
minW="200px"
>
<HStack
bgColor={
Expand All @@ -106,7 +110,7 @@ export default function AccessModeStep({
borderTopRadius="8px"
justify="space-between"
>
<HStack spacing="3">
<HStack spacing="3" h="50px">
<Icon
color={
_accessMode === accessMode
Expand Down Expand Up @@ -331,7 +335,7 @@ export default function AccessModeStep({
<>
<Text pb="20px">Choose credentials</Text>

<SimpleGrid columns={2} spacing={10}>
<SimpleGrid columns={2} spacing={10} minW="300px">
<VStack>
<Text>Credentials</Text>
<VStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function FinalPreviewStep({
Group preview
</Heading>

<Box zIndex="1">
<Box zIndex="1" w="350px">
<GroupCard {...group} />
</Box>
</VStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
Box,
ChakraProvider,
extendTheme,
Tooltip
Tooltip,
Stack
} from "@chakra-ui/react"
import { FiHardDrive, FiZap } from "react-icons/fi"
import { FaInfoCircle } from "react-icons/fa"
Expand Down Expand Up @@ -72,7 +73,7 @@ export default function GeneralInfoStep({
<>
<Text>What type of group is this?</Text>

<HStack>
<Stack direction={{ base: "column", lg: "row" }}>
{groupTypes.map((groupType: any) => (
<VStack
borderColor={
Expand All @@ -82,8 +83,8 @@ export default function GeneralInfoStep({
}
borderWidth="2px"
borderRadius="8px"
w="252px"
h="210px"
w={{ base: "100%", md: "252px" }}
h={{ base: "auto", md: "210px" }}
align="left"
spacing="0"
cursor="pointer"
Expand Down Expand Up @@ -144,7 +145,7 @@ export default function GeneralInfoStep({
</Text>
</VStack>
))}
</HStack>
</Stack>

{group.type === "off-chain" && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export default function GroupSizeStep({
<>
<Text>How big is your group?</Text>

<HStack w="764px" py="16px" overflowX="scroll">
<HStack
w={{ base: "100%", xl: "764px" }}
py="16px"
overflowX="scroll"
>
{groupSizes.map((groupSize) => (
<VStack
borderColor={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ export default function StepperNav({
>
{i + 1}
</Text>
<Text>{step}</Text>
<Text
display={{
base: i === index ? "block" : "none",
md: "block"
}}
>
{step}
</Text>
{i !== steps.length - 1 && (
<Icon as={MdOutlineKeyboardArrowRight} boxSize={5} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ export default function StepperPreview({
<VStack
align="left"
position="relative"
w="374px"
w={{ base: "100%", md: "374px" }}
h="483px"
bgImg={`url(${image2})`}
bgRepeat="no-repeat"
bgSize={{ base: "cover", md: "contain" }}
p="20px"
borderRadius="8px"
>
Expand Down
11 changes: 8 additions & 3 deletions apps/dashboard/src/pages/new-group.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Container, Heading, HStack, VStack } from "@chakra-ui/react"
import { Container, Heading, HStack, VStack, Stack } from "@chakra-ui/react"
import { useCallback, useState } from "react"
import { useNavigate } from "react-router-dom"
import AccessModeStep from "../components/new-group-stepper/access-mode-step"
Expand Down Expand Up @@ -61,7 +61,11 @@ export default function NewGroupPage(): JSX.Element {
}
/>

<HStack w="100%" align="start">
<Stack
w="100%"
align="start"
direction={{ base: "column-reverse", md: "row" }}
>
{(_group.type === "off-chain" && _currentStep !== 3) ||
(_group.type === "on-chain" && _currentStep !== 1) ? (
<>
Expand All @@ -74,6 +78,7 @@ export default function NewGroupPage(): JSX.Element {
borderRadius="8px"
flex="1"
align="left"
width={{ base: "100%", md: "50%" }}
>
{_group.type === "off-chain" &&
(_currentStep === 0 ? (
Expand Down Expand Up @@ -113,7 +118,7 @@ export default function NewGroupPage(): JSX.Element {
onBack={() => finalPreviewBack()}
/>
)}
</HStack>
</Stack>
</VStack>
</Container>
)
Expand Down

0 comments on commit 0c30d3c

Please sign in to comment.