-
Notifications
You must be signed in to change notification settings - Fork 3
feat: useDraggable 훅 생성 #24
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2393143
chore: 병합 전 커밋
tkyoun0421 64fcd60
resolve: feat/project merge 충돌 제거
tkyoun0421 070ab61
chore: 병합 전 커밋
tkyoun0421 fcbf4e0
Merge branch 'develop' into feat/search
tkyoun0421 4e9a79e
feat: useDraggable 훅 생성
tkyoun0421 0aaf46a
feat: useDaggable 훅 생성
tkyoun0421 7171293
chore: 빌드 실패 수정
tkyoun0421 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,315 @@ | ||
| import AccessTimeIcon from "@mui/icons-material/AccessTime"; | ||
| import LocationPinIcon from "@mui/icons-material/LocationPin"; | ||
| import PeopleAltIcon from "@mui/icons-material/PeopleAlt"; | ||
| import { | ||
| Button, | ||
| Card, | ||
| CardContent, | ||
| Chip, | ||
| Divider, | ||
| Stack, | ||
| styled, | ||
| Typography, | ||
| Box, | ||
| useMediaQuery, | ||
| useTheme, | ||
| } from "@mui/material"; | ||
| import type { JSX } from "react"; | ||
| import { Link } from "react-router-dom"; | ||
|
|
||
| import type { ProjectListRes } from "@entities/projects/types/projects"; | ||
|
|
||
| import DragScrollContainer from "@shared/ui/DragScrollContainer"; | ||
| import UserProfileAvatar from "@shared/user/ui/UserProfileAvatar"; | ||
| import UserProfileWithNamePosition from "@shared/user/ui/UserProfileWithNamePosition"; | ||
|
|
||
| const ProjectCard = (): JSX.Element => { | ||
| const theme = useTheme(); | ||
| const isMobile = useMediaQuery(theme.breakpoints.up("sm")); | ||
|
|
||
| const mock: ProjectListRes = { | ||
| id: "1", | ||
| userId: "1", | ||
| userName: "John Doe", | ||
| status: "모집중", | ||
| title: "Project Title", | ||
| userRole: "frontend", | ||
| avatar: "https://via.placeholder.com/150", | ||
| oneLineInfo: "Project One Line Info", | ||
| simpleInfo: "Project Simple Info", | ||
| techStack: [ | ||
| "React", | ||
| "Node.js", | ||
| "MongoDB", | ||
| "TypeScript", | ||
| "JavaScript", | ||
| "Vue.js", | ||
| "Angular", | ||
| "Svelte", | ||
| "Next.js", | ||
| "Nuxt.js", | ||
| "Tailwind CSS", | ||
| "Bootstrap", | ||
| "Material UI", | ||
| "Chakra UI", | ||
| "Ant Design", | ||
| "Styled Components", | ||
| "Emotion", | ||
| "Tailwind CSS", | ||
| "Bootstrap", | ||
| "Material UI", | ||
| "Chakra UI", | ||
| "Ant Design", | ||
| "Styled Components", | ||
| "Emotion", | ||
| ], | ||
| teamSize: 4, | ||
| expectedPeriod: "1개월", | ||
| description: "Project Description", | ||
| workflow: "Project Workflow", | ||
| requirements: ["React", "Node.js", "MongoDB"], | ||
| preferentialTreatment: ["React", "Node.js", "MongoDB"], | ||
| positions: [ | ||
| { | ||
| position: "Frontend", | ||
| count: 2, | ||
| experience: "1년 이상", | ||
| }, | ||
| ], | ||
| applicants: ["asdfasdfsf2", "asdzxc1er", "bsdfgh12", "cbvscbatfg"], | ||
| }; | ||
|
|
||
| return ( | ||
| <StyledCard> | ||
| <StyledCardContent> | ||
| <ProjectHeader> | ||
| <StatusChip label={mock.status} color="primary" size="small" /> | ||
| </ProjectHeader> | ||
|
|
||
| <ContentSection> | ||
| <ProjectTitle variant="h5" fontWeight={700}> | ||
| {mock.title} | ||
| </ProjectTitle> | ||
| <OneLineInfo variant="body1" color="primary" fontWeight={600}> | ||
| {mock.oneLineInfo} | ||
| </OneLineInfo> | ||
| <SimpleInfo variant="body2" color="text.secondary"> | ||
| {mock.simpleInfo} | ||
| </SimpleInfo> | ||
| </ContentSection> | ||
| <Stack flexDirection={"row"} gap={"0.8rem"} alignItems={"flex-start"}> | ||
| {isMobile ? ( | ||
| <UserProfileAvatar | ||
| name={mock.userName} | ||
| userRole={mock.userRole} | ||
| avatar={mock.avatar} | ||
| flexDirection="row" | ||
| /> | ||
| ) : ( | ||
| <UserProfileWithNamePosition | ||
| name={mock.userName} | ||
| userRole={mock.userRole} | ||
| flexDirection="row" | ||
| /> | ||
| )} | ||
| </Stack> | ||
| <DragScrollContainer> | ||
| {mock.techStack.map((stack, index) => ( | ||
| <TechChip key={index} label={stack} size="small" /> | ||
| ))} | ||
| </DragScrollContainer> | ||
|
|
||
| <ProjectDetails> | ||
| <DetailItem> | ||
| <PeopleAltIcon fontSize="small" color="action" /> | ||
| <Typography variant="body2" color="text.secondary"> | ||
| {mock.teamSize}명 | ||
| </Typography> | ||
| </DetailItem> | ||
| <DetailItem> | ||
| <AccessTimeIcon fontSize="small" color="action" /> | ||
| <Typography variant="body2" color="text.secondary"> | ||
| {mock.expectedPeriod} | ||
| </Typography> | ||
| </DetailItem> | ||
| <DetailItem> | ||
| <LocationPinIcon fontSize="small" color="action" /> | ||
| <Typography variant="body2" color="text.secondary"> | ||
| 온라인 | ||
| </Typography> | ||
| </DetailItem> | ||
| </ProjectDetails> | ||
|
|
||
| <StyledDivider /> | ||
|
|
||
| <FooterSection> | ||
| <Typography variant="body1" color="textPrimary"> | ||
| <TextHighlight>{mock.applicants.length}명</TextHighlight> 지원 | ||
| </Typography> | ||
| <StyledLink to={`/project/${mock.id}`}> | ||
| <ActionButton variant="contained" color="primary" size="medium"> | ||
| 자세히 보기 | ||
| </ActionButton> | ||
| </StyledLink> | ||
| </FooterSection> | ||
| </StyledCardContent> | ||
| </StyledCard> | ||
| ); | ||
| }; | ||
|
|
||
| export default ProjectCard; | ||
|
|
||
| const StyledCard = styled(Card)(({ theme }) => ({ | ||
| height: "100%", | ||
| maxWidth: "40rem", | ||
| maxHeight: "50rem", | ||
| width: "100%", | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)", | ||
| cursor: "pointer", | ||
| border: `1px solid ${theme.palette.divider}`, | ||
|
|
||
| "&:hover": { | ||
| transform: "translateY(-0.4rem)", | ||
| boxShadow: | ||
| "0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)", | ||
| borderColor: theme.palette.primary.light, | ||
| }, | ||
|
|
||
| [theme.breakpoints.up("sm")]: { | ||
| maxWidth: "44rem", | ||
| maxHeight: "52rem", | ||
| "&:hover": { | ||
| transform: "translateY(-0.6rem)", | ||
| }, | ||
| }, | ||
|
|
||
| [theme.breakpoints.up("md")]: { | ||
| maxWidth: "48rem", | ||
| maxHeight: "54rem", | ||
| }, | ||
| })); | ||
|
|
||
| const StyledCardContent = styled(CardContent)(({ theme }) => ({ | ||
| height: "100%", | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| gap: theme.spacing(1), | ||
|
|
||
| [theme.breakpoints.up("sm")]: { | ||
| gap: theme.spacing(2), | ||
| }, | ||
| })); | ||
|
|
||
| const ProjectHeader = styled(Box)(() => ({ | ||
| display: "flex", | ||
| justifyContent: "flex-start", | ||
| alignItems: "center", | ||
| })); | ||
|
|
||
| const StatusChip = styled(Chip)(({ theme }) => ({ | ||
| fontWeight: 600, | ||
| letterSpacing: "0.025em", | ||
| backgroundColor: theme.palette.primary.main, | ||
| color: theme.palette.primary.contrastText, | ||
|
|
||
| "&:hover": { | ||
| backgroundColor: theme.palette.primary.dark, | ||
| }, | ||
| })); | ||
|
|
||
| const ContentSection = styled(Box)(({ theme }) => ({ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| gap: theme.spacing(0.8), | ||
| })); | ||
|
|
||
| const ProjectTitle = styled(Typography)(({ theme }) => ({ | ||
| lineHeight: 1.3, | ||
| letterSpacing: "-0.015em", | ||
| color: theme.palette.text.primary, | ||
| })); | ||
|
|
||
| const OneLineInfo = styled(Typography)(() => ({ | ||
| lineHeight: 1.4, | ||
| fontWeight: 600, | ||
| })); | ||
|
|
||
| const SimpleInfo = styled(Typography)(() => ({ | ||
| lineHeight: 1.5, | ||
| overflow: "hidden", | ||
| display: "-webkit-box", | ||
| WebkitLineClamp: 2, | ||
| WebkitBoxOrient: "vertical", | ||
| })); | ||
|
|
||
| const TechChip = styled(Chip)(({ theme }) => ({ | ||
| backgroundColor: theme.palette.background.default, | ||
| border: `1px solid ${theme.palette.divider}`, | ||
| fontWeight: 500, | ||
| fontSize: "1.1rem", | ||
| flexShrink: 0, | ||
| whiteSpace: "nowrap", | ||
|
|
||
| [theme.breakpoints.up("sm")]: { | ||
| fontSize: "1.2rem", | ||
| }, | ||
| })); | ||
|
|
||
| const ProjectDetails = styled(Stack)(({ theme }) => ({ | ||
| flexDirection: "row", | ||
| flexWrap: "wrap", | ||
| gap: theme.spacing(1.6), | ||
| marginTop: theme.spacing(0.8), | ||
|
|
||
| [theme.breakpoints.up("sm")]: { | ||
| gap: theme.spacing(2), | ||
| }, | ||
| })); | ||
|
|
||
| const DetailItem = styled(Stack)(({ theme }) => ({ | ||
| flexDirection: "row", | ||
| alignItems: "center", | ||
| gap: theme.spacing(0.6), | ||
| })); | ||
|
|
||
| const StyledDivider = styled(Divider)(({ theme }) => ({ | ||
| margin: `${theme.spacing(0.8)} 0`, | ||
| backgroundColor: theme.palette.divider, | ||
| })); | ||
|
|
||
| const FooterSection = styled(Stack)(({ theme }) => ({ | ||
| flexDirection: "row", | ||
| justifyContent: "space-between", | ||
| alignItems: "center", | ||
| marginTop: "auto", | ||
| gap: theme.spacing(1.2), | ||
| })); | ||
|
|
||
| const StyledLink = styled(Link)(() => ({ | ||
| textDecoration: "none", | ||
| flexShrink: 0, | ||
| })); | ||
|
|
||
| const ActionButton = styled(Button)(({ theme }) => ({ | ||
| fontWeight: 600, | ||
| letterSpacing: "0.025em", | ||
| borderRadius: theme.spacing(0.8), | ||
| boxShadow: "none", | ||
| transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)", | ||
|
|
||
| "&:hover": { | ||
| transform: "translateY(-0.1rem)", | ||
| boxShadow: "0 4px 8px -2px rgba(37, 99, 235, 0.3)", | ||
| }, | ||
|
|
||
| "&:active": { | ||
| transform: "translateY(0)", | ||
| }, | ||
| })); | ||
|
|
||
| const TextHighlight = styled("span")(({ theme }) => ({ | ||
| color: theme.palette.primary.main, | ||
| fontWeight: 600, | ||
| })); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 놓친 부분이 있었나보군요! 등록 api에 추가하도록 하겠습니다.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스탠딩 미팅에서 같이 맞춰봐야 할 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다~