-
Notifications
You must be signed in to change notification settings - Fork 0
Feature#24 Feed Card UI 작성 #25
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
10 commits
Select commit
Hold shift + click to select a range
03184e2
feat(package): next, react 버전 업그레이드
kimgho a8aa254
feat(shared): 뱃지 및 여백 공용 컴포넌트 추가
kimgho 1cb6ab0
feat(feed): feedcard header추가
kimgho 9c5e9c9
feat(feed): feedcard content 추가
kimgho 90d7de3
feat(feed): feedcard footer 추가
kimgho 5137a4a
feat(feed): feed card 컴포넌트 추가
kimgho 27ea1fd
fix(shared): container padding 수정
kimgho e4a98e8
feat(page): feed section 추가
kimgho 48b26c1
fix(feed): 좋아요를 button태그로 변경
kimgho 47f5865
fix(feed): h3태그로 변경
kimgho 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { FeedCard } from "@/entities/feed/ui/FeedCard"; | ||
|
|
||
| import { Container } from "@/shared/container/Container"; | ||
|
|
||
| import * as styles from "./feedSection.css"; | ||
|
|
||
| //TODO - 반응형해야함 | ||
| export const FeedSection = () => { | ||
| return ( | ||
| <Container> | ||
| <header className={styles.header}> | ||
| <h2 className={styles.h2}>잡만리에서 지금 화제인 글</h2> | ||
| <span className={styles.span}>실시간 좋아요 & 트렌드</span> | ||
| </header> | ||
|
|
||
| <div className={styles.cardGrid}> | ||
| <FeedCard /> | ||
| <FeedCard /> | ||
| <FeedCard /> | ||
| <FeedCard /> | ||
| <FeedCard /> | ||
| </div> | ||
| </Container> | ||
| ); | ||
| }; |
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,41 @@ | ||
| import { style } from "@vanilla-extract/css"; | ||
|
|
||
| export const header = style({ | ||
| display: "flex", | ||
| flexDirection: "row", | ||
| justifyContent: "space-between", | ||
| alignItems: "center", | ||
| "@media": { | ||
| "screen and (max-width: 768px)": { | ||
| flexDirection: "column", | ||
| alignItems: "flex-start", | ||
| padding: "16px 0", | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| export const h2 = style({ | ||
| fontSize: "24px", | ||
| fontWeight: 600, | ||
| "@media": { | ||
| "screen and (max-width: 768px)": { | ||
| margin: "4px 0", | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| export const span = style({ | ||
| color: "gray", | ||
| }); | ||
|
|
||
| export const cardGrid = style({ | ||
| display: "grid", | ||
| gridTemplateColumns: "repeat(3, 1fr)", | ||
| gap: "1rem", | ||
| "@media": { | ||
| "screen and (max-width: 768px)": { | ||
| gridTemplateColumns: "repeat(2,1fr)", | ||
| gap: "0.5rem", | ||
| }, | ||
| }, | ||
| }); |
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 |
|---|---|---|
| @@ -1,5 +1,14 @@ | ||
| import { Spacing } from "@/shared/ui/spacing"; | ||
|
|
||
| import { CompanyListSection } from "./_components/CompanyListSection"; | ||
| import { FeedSection } from "./_components/FeedSection"; | ||
|
|
||
| export default function Home() { | ||
| return <CompanyListSection />; | ||
| return ( | ||
| <> | ||
| <CompanyListSection /> | ||
| <Spacing direction="vertical" size={30} /> | ||
| <FeedSection /> | ||
| </> | ||
| ); | ||
| } |
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,13 @@ | ||
| import { FeedContent, FeedFooter, FeedHeader } from "@/entities/feed/ui"; | ||
|
|
||
| import * as styles from "./feedCard.css"; | ||
|
|
||
| export const FeedCard = () => { | ||
| return ( | ||
| <article className={styles.cardContainer}> | ||
| <FeedHeader /> | ||
| <FeedContent /> | ||
| <FeedFooter /> | ||
| </article> | ||
| ); | ||
| }; |
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,15 @@ | ||
| import { Badge } from "@/shared/ui/badge/Badge"; | ||
|
|
||
| import * as styles from "./feedContent.css"; | ||
|
|
||
| export const FeedContent = () => { | ||
| return ( | ||
| <section className={styles.contentContainer}> | ||
| <p className={styles.contentBody}>피드 내용</p> | ||
| <div className={styles.hashtagContainer}> | ||
| <Badge>태그1</Badge> | ||
| <Badge>태그2</Badge> | ||
| </div> | ||
| </section> | ||
| ); | ||
| }; |
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,38 @@ | ||
| "use client"; | ||
| import { useState } from "react"; | ||
|
|
||
| import { Heart, MessageCircle } from "lucide-react"; | ||
|
|
||
| import * as styles from "./feedFooter.css"; | ||
|
|
||
| export const FeedFooter = () => { | ||
| const [isLiked, setIsLiked] = useState(false); | ||
| return ( | ||
| <footer className={styles.footerContainer}> | ||
| <div className={styles.statsContainer}> | ||
| <button className={styles.likeContainer} aria-label={isLiked ? "좋아요 취소" : "좋아요"}> | ||
| <Heart | ||
| size={16} | ||
| className={styles.likeButton} | ||
| onClick={() => setIsLiked(!isLiked)} | ||
| fill={isLiked ? "#EF4444" : "none"} | ||
| stroke={isLiked ? "none" : "#64748B"} | ||
| aria-hidden="true" | ||
| /> | ||
| {/** TODO - 좋아요,댓글 수 props */} | ||
| <span>좋아요</span> | ||
| <span aria-label={`현재 좋아요 개수 ${112}개`}>112</span> | ||
| </button> | ||
| <div className={styles.commentCount}> | ||
| <MessageCircle size={16} /> | ||
| <span>댓글</span> | ||
| <span>7</span> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div className={styles.messageContainer}> | ||
| <button className={styles.messageButton}>쪽지 보내기</button> | ||
| </div> | ||
| </footer> | ||
| ); | ||
| }; |
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,19 @@ | ||
| import { Badge } from "@/shared/ui/badge/Badge"; | ||
|
|
||
| import * as styles from "./feedHeader.css"; | ||
|
|
||
| export const FeedHeader = () => { | ||
| return ( | ||
| <div className={styles.headerContainer}> | ||
| <header className={styles.cardHeader}> | ||
| <Badge>태그</Badge> | ||
| <span className={styles.tagText}>피드 분류</span> | ||
| </header> | ||
| <h3 className={styles.cardTitle}>피드 제목</h3> | ||
| <div className={styles.cardMeta}> | ||
| <span>작성자</span> | ||
| <span>날짜</span> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; |
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,18 @@ | ||
| import { style } from "@vanilla-extract/css"; | ||
|
|
||
| export const cardContainer = style({ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| gap: "12px", | ||
| padding: "24px", | ||
| border: "1px solid #E2E8F0", | ||
| borderRadius: "16px", | ||
| backgroundColor: "white", | ||
| boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)", | ||
| transition: "box-shadow 0.2s", | ||
| maxWidth: "350px", | ||
| width: "100%", | ||
| ":hover": { | ||
| boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)", | ||
| }, | ||
| }); |
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,19 @@ | ||
| import { style } from "@vanilla-extract/css"; | ||
|
|
||
| export const contentContainer = style({ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| gap: "12px", | ||
| }); | ||
|
|
||
| export const contentBody = style({ | ||
| fontSize: "16px", | ||
| lineHeight: "1.6", | ||
| margin: 0, | ||
| }); | ||
|
|
||
| export const hashtagContainer = style({ | ||
| display: "flex", | ||
| flexWrap: "wrap", | ||
| gap: "8px", | ||
| }); |
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,77 @@ | ||
| import { style, keyframes } from "@vanilla-extract/css"; | ||
|
|
||
| const heartBeat = keyframes({ | ||
| "0%": { transform: "scale(1)" }, | ||
| "25%": { transform: "scale(1.2)" }, | ||
| "50%": { transform: "scale(1.1)" }, | ||
| "100%": { transform: "scale(1)" }, | ||
| }); | ||
|
|
||
| export const footerContainer = style({ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| gap: "8px", | ||
| paddingTop: "16px", | ||
| }); | ||
|
|
||
| export const statsContainer = style({ | ||
| display: "flex", | ||
| gap: "8px", | ||
| alignItems: "center", | ||
| "@media": { | ||
| "screen and (max-width: 768px)": { | ||
| flexDirection: "column", | ||
| alignItems: "flex-start", | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| export const likeContainer = style({ | ||
| display: "flex", | ||
| alignItems: "center", | ||
| gap: "4px", | ||
| padding: "0", | ||
| border: "none", | ||
| backgroundColor: "transparent", | ||
| fontSize: "14px", | ||
| color: "#64748B", | ||
| }); | ||
|
|
||
| export const likeButton = style({ | ||
| cursor: "pointer", | ||
| }); | ||
|
|
||
| export const commentCount = style({ | ||
| display: "flex", | ||
| alignItems: "center", | ||
| gap: "6px", | ||
| fontSize: "14px", | ||
| color: "#64748B", | ||
| }); | ||
|
|
||
| export const messageContainer = style({ | ||
| display: "flex", | ||
| }); | ||
|
|
||
| export const messageButton = style({ | ||
| padding: "10px 16px", | ||
| backgroundColor: "#F1F5F9", | ||
| color: "#64748B", | ||
| border: "none", | ||
| borderRadius: "8px", | ||
| fontSize: "14px", | ||
| fontWeight: 500, | ||
| cursor: "pointer", | ||
| ":hover": { | ||
| backgroundColor: "#E2E8F0", | ||
| }, | ||
| }); | ||
|
|
||
| export const heartIcon = style({ | ||
| transition: "all 0.3s ease", | ||
| cursor: "pointer", | ||
| }); | ||
|
|
||
| export const heartIconLiked = style({ | ||
| animation: `${heartBeat} 0.4s ease`, | ||
| }); |
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,33 @@ | ||
| import { style } from "@vanilla-extract/css"; | ||
|
|
||
| export const headerContainer = style({ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| gap: "8px", | ||
| }); | ||
|
|
||
| export const cardHeader = style({ | ||
| display: "inline-flex", | ||
| flexDirection: "row", | ||
| gap: "8px", | ||
| alignItems: "center", | ||
| }); | ||
|
|
||
| export const tagText = style({ | ||
| color: "#64748B", | ||
| fontSize: "14px", | ||
| }); | ||
|
|
||
| export const cardTitle = style({ | ||
| fontSize: "24px", | ||
| fontWeight: 600, | ||
| margin: "4px 0", | ||
| }); | ||
|
|
||
| export const cardMeta = style({ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| gap: "4px", | ||
| fontSize: "14px", | ||
| color: "#94A3B8", | ||
| }); |
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,4 @@ | ||
| export { FeedContent } from "./FeedContent"; | ||
| export { FeedFooter } from "./FeedFooter"; | ||
| export { FeedHeader } from "./FeedHeader"; | ||
| export { FeedCard } from "./FeedCard"; |
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,16 @@ | ||
| import { ReactNode } from "react"; | ||
| import { RecipeVariants } from "@vanilla-extract/recipes"; | ||
|
|
||
| import * as styles from "./badge.css"; | ||
|
|
||
| type BadgeVariants = NonNullable<RecipeVariants<typeof styles.badge>>; | ||
|
|
||
| interface BadgeProps { | ||
| children: ReactNode; | ||
| variant?: BadgeVariants["variant"]; | ||
| size?: BadgeVariants["size"]; | ||
| } | ||
|
|
||
| export const Badge = ({ children, variant, size }: BadgeProps) => { | ||
| return <span className={styles.badge({ variant, size })}>{children}</span>; | ||
| }; |
Oops, something went wrong.
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.
좋아요개수나 댓글개수는 추후에 props 로 뚫는게 좋겠네요
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.
현재 생각중인건
FeedSection에서 data를 props로 내려주는 방식을 고려중입니닷