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

People Button Stack Responsive #17

Merged
merged 1 commit into from
Sep 2, 2024
Merged
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 frontend/components/People.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default function PeopleSection({
{members.map((member) =>
member.team === team ? (
<Card
key={`${member.first_name}_${member.last_name}`}
first_name={member.first_name}
last_name={member.last_name}
role={member.role}
Expand Down
22 changes: 18 additions & 4 deletions frontend/src/app/people/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
import { useEffect, useState } from "react";
import axios from "axios";
import PeopleSection from "../../../components/People";
import { Stack, HStack, Button } from "@chakra-ui/react";
import {
Stack,
HStack,
Button,
VStack,
useBreakpointValue,
Flex,
} from "@chakra-ui/react";
import { useQuery } from "react-query";
import { API_URL } from "../config";

Expand Down Expand Up @@ -85,6 +92,7 @@ export default function People() {
const [members, setMembers] = useState([]);
const [section, setSection] = useState("fdr");
const { isLoading, error, data } = useQuery("fetchMembers", fetchMembers);
const direction = useBreakpointValue({ base: "column", md: "row" });

useEffect(() => {
if (error || isLoading) {
Expand All @@ -95,8 +103,14 @@ export default function People() {
}, [error, data, isLoading]);

return (
<Stack alignItems={"center"}>
<HStack p={5}>
<Stack>
<Flex
p={5}
justifyContent={"center"}
gap={2}
direction={direction}
mt={10}
>
<Button
onClick={(event) => setSection("fdr")}
value={"fdr"}
Expand Down Expand Up @@ -139,7 +153,7 @@ export default function People() {
>
Alumni
</Button>
</HStack>
</Flex>
{renderSection({ members, section })}
</Stack>
);
Expand Down
Loading