Skip to content

Commit

Permalink
refactor(groups.tsx): make groups responsive for small and medium screen
Browse files Browse the repository at this point in the history
re #557
  • Loading branch information
yagopajarino committed Dec 17, 2024
1 parent abeb1ed commit a3c1b8d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 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,9 @@ export default function GroupsPage(): JSX.Element {
</Heading>
</HStack>

<HStack justifyContent="space-between" width="100%">
<Stack justifyContent="space-between" width="100%" direction={{ base: "column", md: "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 +124,7 @@ export default function GroupsPage(): JSX.Element {
>
Add group
</Button>
</HStack>
</Stack>

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

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

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

0 comments on commit a3c1b8d

Please sign in to comment.