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

refactor(groups.tsx): make groups responsive for small and medium screen #642

Merged
merged 3 commits into from
Dec 27, 2024
Merged
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
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