Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## ์™€ํ”Œ์ŠคํŠœ๋””์˜ค ๋ฆฌํฌ๋ฃจํŒ… ํŽ˜์ด์ง€ ๋ฆฌ๋‰ด์–ผ

# Table of Content
# Table of Contents

- [Usage](#Usage)

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"format": "prettier --check .",
"typecheck": "tsc --noEmit",
"preview": "vite preview",
"check-all": "yarn lint && yarn format && yarn typecheck"
"check-all": "yarn lint && yarn format && yarn typecheck",
"format:fix": "prettier --write ."
},
"dependencies": {
"@codemirror/lang-cpp": "^6.0.2",
Expand Down
3 changes: 3 additions & 0 deletions public/icon/arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icon/arrow_outward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icon/arrow_up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icon/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icon/forward_left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icon/forward_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
300 changes: 300 additions & 0 deletions src/features/member/MemberGrid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
import styled from "styled-components";
import { members } from "@/mocks/member";
import { sponsors } from "@/mocks/sponsor";
import { useState } from "react";

export default function MemberGrid() {
const [selectedPosition, setSelectedPosition] = useState<string>("์ „์ฒด");
const [sortOrder, setSortOrder] = useState<"asc" | "desc">("desc");
const [sortOpen, setSortOpen] = useState(false);
const positions = ["์ „์ฒด", "Android", "IOS", "Frontend", "Backend", "Design"];
const filtered = members.filter((member) =>
selectedPosition === "์ „์ฒด"
? true
: member.member_position === selectedPosition,
);

const sorted = [...filtered].sort((a, b) => {
const getGen = (gen: string) => parseFloat(gen.replace("๊ธฐ", ""));
return sortOrder === "asc"
? getGen(a.member_generation) - getGen(b.member_generation)
: getGen(b.member_generation) - getGen(a.member_generation);
});

return (
<Wrapper>
<Title1>์™€ํ”Œ์ŠคํŠœ๋””์˜ค์˜ ๋ฐœ์ „์„ ์œ„ํ•ด ๋…ธ๋ ฅํ•ด์ฃผ์‹  ๋ถ„๋“ค</Title1>
<Flex>
{sponsors.map((sponsor) => (
<div key={sponsor.id}>{`${sponsor.name} ๋‹˜`}</div>
))}
</Flex>
<Title2>์™€ํ”Œ์ŠคํŠœ๋””์˜ค ๋ฉค๋ฒ„</Title2>
<Filter>
<FilterBar>
{positions.map((pos) => (
<FilterButton
key={pos}
$active={selectedPosition === pos}
onClick={() => setSelectedPosition(pos)}
>
{pos}
{pos !== "์ „์ฒด" && positionColors[pos] && (
<ColorDot color={positionColors[pos]} />
)}
</FilterButton>
))}
</FilterBar>
<FilterBar>
<Sort>๊ธฐ์ˆ˜ ์ •๋ ฌ</Sort>
<SortButton onClick={() => setSortOpen((prev) => !prev)}>
{sortOrder === "desc" ? (
<>
<SortOrder>๋‚ด๋ฆผ์ฐจ์ˆœ</SortOrder>
<img src="/icon/arrow_down.svg" />
</>
) : (
<>
<SortOrder>์˜ค๋ฆ„์ฐจ์ˆœ</SortOrder>
<img src="/icon/arrow_up.svg" />
</>
)}
</SortButton>
</FilterBar>
{sortOpen && (
<Dropdown>
<li onClick={() => setSortOrder("asc")}>์˜ค๋ฆ„์ฐจ์ˆœ</li>
<li onClick={() => setSortOrder("desc")}>๋‚ด๋ฆผ์ฐจ์ˆœ</li>
</Dropdown>
)}
</Filter>

<Grid>
{sorted.map((member) => (
<Card key={member.id}>
{positionColors[member.member_position] && (
<ColorDot color={positionColors[member.member_position]} />
)}
<HeaderRow>
<LeftInfo>
<span>{member.member_name}</span>
</LeftInfo>
<RightInfo>
<span>{member.member_generation}</span>
<span>{member.member_position}</span>
</RightInfo>
</HeaderRow>
</Card>
))}
</Grid>
</Wrapper>
);
}

const positionColors: Record<string, string> = {
Android: "#876E00",
IOS: "#E69754",
Frontend: "#37007F",
Backend: "#00CD48",
Design: "#FF2C4C",
};

const ColorDot = styled.div<{ color: string }>`
position: absolute;
right: 0px;
top: 0px;
width: 10px;
height: 10px;
aspect-ratio: 1/1;
border-top-right-radius: 0.5rem;
background-color: ${({ color }) => color};
`;

const Sort = styled.div`
color: var(--black-900, #121212);
text-align: center;
font-family: "Pretendard Variable";
font-size: 1.6rem;
font-style: normal;
font-weight: 600;
line-height: 150%;
letter-spacing: -0.16px;
`;
const SortOrder = styled.div`
color: #121212;
text-align: center;
font-family: "Pretendard Variable";
font-size: 1.6rem;
font-style: normal;
font-weight: 500;
line-height: 150%;
letter-spacing: -0.16px;
`;
const Flex = styled.div`
display: flex;
flex-direction: column;
align-items: center;
gap: 1.6rem;
width: 12.8rem;
margin-bottom: 5rem;
`;
const Wrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
padding: 5rem 0;
gap: 5rem;
`;

const FilterBar = styled.div`
display: flex;
align-items: center;
gap: 1rem;
flex-wrap: wrap;
`;
const Filter = styled(FilterBar)`
&& {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
width: 100%;

@media (max-width: 1160px) {
flex-direction: column;
gap: 2rem;
align-items: center;
}
}
`;

const FilterButton = styled.button<{ $active: boolean }>`
position: relative;
background-color: ${({ $active }) => ($active ? "#000" : "#f5f5f5")};
color: ${({ $active }) => ($active ? "#fff" : "#000")};
border: none;
border-radius: 0.5rem;
padding: 0.5rem 1rem;
font-size: 1.6rem;
cursor: pointer;
text-align: center;
font-family: "Pretendard Variable";
font-style: normal;
font-weight: 500;
line-height: 150%;
letter-spacing: -0.16px;
display: flex;
width: 10.8rem;
padding: 0.4rem 0;
justify-content: center;
align-items: center;
gap: 1rem;
`;

const Dropdown = styled.ul`
position: absolute;
margin-top: 0.5rem;
border: 1px solid #ccc;
background-color: white;
list-style: none;
padding: 0.5rem 0;
border-radius: 0.5rem;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);

li {
padding: 0.5rem 1rem;
cursor: pointer;
font-size: 0.875rem;
&:hover {
background-color: #f3f4f6;
}
}
`;

const Title2 = styled.div`
font-size: 3.2rem;
color: #000;
text-align: center;
font-family: "Pretendard Variable";
font-style: normal;
font-weight: 700;
line-height: 150%;
letter-spacing: -0.32px;
`;
const Title1 = styled.div`
padding-top: 6rem;
font-size: 3.2rem;
text-align: center;
color: #000;
font-family: "Pretendard Variable";
font-style: normal;
font-weight: 700;
line-height: 150%; /* 48px */
letter-spacing: -0.32px;
flex-wrap: wrap;
`;

const SortButton = styled.div`
font-size: 0.875rem;
display: flex;
width: 10.8rem;
padding: 0.4rem 0.8rem 0.4rem 1.2rem;
justify-content: space-between;
align-items: center;
border-radius: 3px;
border: 0.1rem solid var(--black-700, #5f656f);
background: var(--white, #fff);
`;
const Grid = styled.div`
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
padding: 1.5rem;
`;

const Card = styled.div`
position: relative;
display: flex;
flex-direction: column;
gap: 0.5rem;
background-color: #f3f4f6; /* ์—ฐํ•œ ํšŒ์ƒ‰ */
border-radius: 0.5rem;
padding: 1rem;
transition: background-color 0.3s;
cursor: pointer;
width: 22.2rem;
padding: 1.6rem 2.2rem;
align-items: flex-start;
gap: 2.5rem;
`;

const HeaderRow = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
align-self: stretch;
`;

const LeftInfo = styled.div`
display: flex;
gap: 0.5rem;
color: #121212;
font-family: "Pretendard Variable";
font-size: 1.6rem;
font-style: normal;
font-weight: 600;
line-height: 150%; /* 24px */
letter-spacing: -0.16px;
`;

const RightInfo = styled.div`
display: flex;
gap: 0.5rem;
color: #5f656f;
font-family: "Pretendard Variable";
font-size: 1.3rem;
font-style: normal;
font-weight: 500;
line-height: 150%; /* 19.5px */
letter-spacing: -0.13px;
`;
31 changes: 31 additions & 0 deletions src/features/project/Close.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import styled from "styled-components";
import { useRouteNavigation } from "@/shared/routes/useRouteNavigation";

export default function Close() {
const { toProjectList } = useRouteNavigation();
return (
<CloseBar onClick={toProjectList}>
<Icon src="/icon/close.svg" alt="๋‹ซ๊ธฐ" />
</CloseBar>
);
}

const CloseBar = styled.div`
position: fixed;
bottom: 0;
display: flex;
width: 100%;
height: 5rem;
padding: 5px 0px;
justify-content: center;
align-items: center;
background: var(--green, #00cd48);
cursor: pointer;
`;

const Icon = styled.img`
width: 2.2944rem;
height: 2.2944rem;
flex-shrink: 0;
aspect-ratio: 22.94/22.94;
`;
Loading