Skip to content

Commit

Permalink
Merge pull request #642 from yagopajarino/main
Browse files Browse the repository at this point in the history
refactor(groups.tsx): make groups responsive for small and medium screen
  • Loading branch information
vplasencia authored Dec 27, 2024
2 parents abeb1ed + 635c570 commit 22a8c5f
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions apps/dashboard/src/pages/groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
InputRightElement,
Spinner,
Text,
VStack
VStack,
Stack
} from "@chakra-ui/react"
import { useCallback, useContext, useEffect, useState } from "react"
import { FiSearch } from "react-icons/fi"
Expand Down Expand Up @@ -82,9 +83,14 @@ export default function GroupsPage(): JSX.Element {
</Heading>
</HStack>

<HStack justifyContent="space-between" width="100%">
<Stack
justifyContent="space-between"
width={{lg: "100%"}}
direction={{ base: "column", lg: "row" }}
spacing={2}
>
<HStack>
<InputGroup w="300px">
<InputGroup w={{ base: "250px", md: "300px" }}>
<InputRightElement h="48px" pointerEvents="none">
<FiSearch />
</InputRightElement>
Expand Down Expand Up @@ -123,7 +129,7 @@ export default function GroupsPage(): JSX.Element {
>
Add group
</Button>
</HStack>
</Stack>

{_isLoading && (
<Box pt="100px">
Expand All @@ -139,9 +145,13 @@ export default function GroupsPage(): JSX.Element {

{!_isLoading && _groups.length > 0 && (
<Grid
templateColumns="repeat(3, 1fr)"
templateColumns={{
base: "1fr",
md: "repeat(2, 1fr)",
xl: "repeat(3, 1fr)"
}}
gap={10}
w="100%"
w={{md:"100%"}}
mt="60px"
>
{_groups
Expand Down Expand Up @@ -186,9 +196,13 @@ export default function GroupsPage(): JSX.Element {

{!_isLoading && _allCredentialGroups.length > 0 && (
<Grid
templateColumns="repeat(3, 1fr)"
templateColumns={{
base: "1fr",
md: "repeat(2, 1fr)",
xl: "repeat(3, 1fr)"
}}
gap={10}
w="100%"
w={{md:"100%"}}
mt="60px"
>
{_allCredentialGroups
Expand Down

0 comments on commit 22a8c5f

Please sign in to comment.