-
Notifications
You must be signed in to change notification settings - Fork 1
[feat] card view assignment css #77
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
Changes from all commits
218f490
8660fd5
dfce15f
b35e67d
ab830cb
7efd798
59110a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ์ ์นด๋ ํด๋ฆญํ๋ฉด ๋ชจ๋ฌ๋์ธ๋ ค๊ณ ํ๋๋ฐ ์๊ฐํด๋ณด๋๊น ์ด๋ถ๋ถ ์ถฉ๋์ํ์ฑ ๋๋ค์ใ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| .assignment { | ||
| padding: 6px 16px; | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| border-radius: 8px; | ||
| border: 1px solid var(--gray-300); | ||
| background: var(--white); | ||
| } | ||
|
|
||
| .wrapper { | ||
| display: flex; | ||
| gap: 62px; | ||
| } | ||
|
|
||
| .assignee { | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: flex-start; | ||
| } | ||
|
|
||
| .label { | ||
| color: var(--black); | ||
| font-size: 12px; | ||
| font-weight: 600; | ||
| line-height: 20px; | ||
| } | ||
|
|
||
| .description { | ||
| color: var(--black-100); | ||
| font-size: 12px; | ||
| font-weight: 400; | ||
| } | ||
|
|
||
| .assignee .description { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 8px; | ||
| } | ||
|
|
||
| .avatar { | ||
| width: 26px; | ||
| height: 26px; | ||
| } | ||
|
|
||
| .dueDate .description { | ||
| margin-top: 8px; | ||
| } | ||
|
|
||
| @media screen and (min-width: 768px) { | ||
| .assignment { | ||
| padding: 13px; | ||
| } | ||
|
|
||
| .wrapper { | ||
| flex-direction: column; | ||
| gap: 16px; | ||
| } | ||
|
|
||
| .avatar { | ||
| width: 34px; | ||
| height: 34px; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import type { CardData } from '@/types/dashboardView'; | ||
| import Avatar from '@/components/Avatar'; | ||
| import { formatDateToCustomFormat } from '@/utils/dateUtils'; | ||
| import styles from './Assignment.module.css'; | ||
|
|
||
| interface AssignmentProps { | ||
| card: Pick<CardData, 'dueDate' | 'assignee'>; | ||
| } | ||
|
|
||
| export default function Assignment({ card }: AssignmentProps) { | ||
| if (!card) return null; | ||
|
|
||
| // const { assignee, dueDate } = { | ||
| // dueDate: '2024-11-30 12:00', | ||
| // assignee: { profileImageUrl: null, nickname: 'manta', id: 1 }, | ||
| // }; | ||
|
|
||
| const { assignee, dueDate } = card; | ||
|
|
||
| return ( | ||
| <section className={styles.assignment}> | ||
| <dl className={styles.wrapper}> | ||
| {assignee && ( | ||
| <div className={styles.assignee}> | ||
| <dt className={styles.label}>๋ด๋น์</dt> | ||
| <dd className={styles.description}> | ||
| <Avatar | ||
| name={assignee.nickname} | ||
| profileImageUrl={assignee.profileImageUrl} | ||
| className={styles.avatar} | ||
| /> | ||
| <span>{assignee.nickname}</span> | ||
| </dd> | ||
| </div> | ||
| )} | ||
| {dueDate && ( | ||
| <div className={styles.dueDate}> | ||
| <dt className={styles.label}>๋ง๊ฐ์ผ</dt> | ||
| <dd className={styles.description}> | ||
| {formatDateToCustomFormat(dueDate)} | ||
| </dd> | ||
| </div> | ||
| )} | ||
| </dl> | ||
| </section> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| .cardInfo { | ||
| margin-top: 20px; | ||
| } | ||
|
|
||
| @media screen and (min-width: 768px) { | ||
| .cardInfo { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| gap: 14px; | ||
| } | ||
|
|
||
| .assignmentContainer { | ||
| order: 1; | ||
| flex: 3; | ||
| } | ||
|
|
||
| .infoContainer { | ||
| flex: 7; | ||
| } | ||
| } | ||
|
|
||
| @media screen and (min-width: 1200px) { | ||
| .cardInfo { | ||
| gap: 39px; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { CardData } from '@/types/dashboardView'; | ||
| import Assignment from './Assignment'; | ||
| import styles from './CardInfo.module.css'; | ||
|
|
||
| export default function CardInfo({ card }: { card: CardData }) { | ||
| return ( | ||
| <div className={styles.cardInfo}> | ||
| <div className={styles.assignmentContainer}> | ||
| <Assignment card={card} /> | ||
| </div> | ||
| <div className={styles.infoContainer}>์นด๋ ์์ธ๋ด์ฉ + ๋๊ธ ์์ญ</div> | ||
| </div> | ||
| ); | ||
| } |
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๋ฌดํ์คํฌ๋กค ์ปค์คํ
ํ
์ผ๋ก ๋นผ์ ๊ฑฐ ์ข๋ค์ ๐๐ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { useEffect, useRef } from 'react'; | ||
|
|
||
| export const useIntersectionObserver = ( | ||
| onIntersect: () => void, | ||
| isLoading: boolean, | ||
| cursorId: number | null, | ||
| threshold: number = 0.5 | ||
| ) => { | ||
| const observerRef = useRef<HTMLDivElement | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| const observer = new IntersectionObserver( | ||
| (entries) => { | ||
| if (entries[0].isIntersecting && cursorId != null && !isLoading) { | ||
| onIntersect(); | ||
| } | ||
| }, | ||
| { threshold } | ||
| ); | ||
|
|
||
| const current = observerRef.current; | ||
| if (current) observer.observe(current); | ||
|
|
||
| return () => { | ||
| if (current) observer.unobserve(current); | ||
| }; | ||
| }, [isLoading, cursorId, onIntersect]); | ||
|
|
||
| return observerRef; | ||
| }; |
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.
svg ํ์ผ ๋ญ ๋ฐ๊พธ์ ๊ฑด๊ฐ์?
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.
์๊น์ ๋ฐ๊ฟจ์ด์!