-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] 소셜, 알바찾기 컴포넌트 구현 #11
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
16 commits
Select commit
Hold shift + click to select a range
86f4f3f
feat : Navbar 아이콘 추가
kim3360 e8b1d10
Revert "feat : Navbar 아이콘 추가"
kim3360 4c94bf1
feat : FloatingActionButton 추가
kim3360 26bfd3b
feat : 소셜 카테고리 컴포넌트 추가
kim3360 1e1c816
feat : 소셜 페이지 구현
kim3360 2b513f6
feat : 소셜채팅 페이지 구현
kim3360 227b308
feat : 알바찾기 하단박스 컴포넌트
kim3360 845be20
Merge branch 'dev' into feat/ALT-163
kim3360 d93fbbe
fix : 라우팅 수정
kim3360 d47540c
feat : 알바찾기 하단박스 컴포넌트
kim3360 bebdb24
fix : 소셜 페이지 모바일레이아웃 제거
kim3360 a9a3714
feat : 소셜&알바찾기 스토리북 설정
kim3360 dd88583
fix : 소셜 페이지 넓이 수정
kim3360 b4c50e9
fix : shadcn drawer 하단박스 추가
kim3360 34d446c
fix: 빌드 오류 해결
dohy-eon 4b01b0a
fix: svg파일 임포트 경로 수정
dohy-eon 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,2 @@ | ||
| export { AlbaFindDrawer, type AlbaFindDrawerProps } from './ui/AlbaFindDrawer' | ||
| export { DrawerPeekStrip } from './ui/DrawerPeekStrip' |
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,63 @@ | ||
| import { useState } from 'react' | ||
|
|
||
| import { | ||
| Drawer, | ||
| DrawerContent, | ||
| DrawerDescription, | ||
| DrawerTitle, | ||
| } from '@/features/social/ui/drawer' | ||
| import { | ||
| AlbaFindCategoryBar, | ||
| type AlbaFindFilterId, | ||
| type AlbaFindMode, | ||
| } from '@/shared/ui/manager/alba-find/AlbaFindCategoryBar' | ||
| import { AlbaFindList } from '@/shared/ui/manager/alba-find/AlbaFindList' | ||
| import { | ||
| Albabox, | ||
| type AlbaboxProps, | ||
| } from '@/shared/ui/manager/alba-find/Albabox' | ||
|
Comment on lines
+16
to
+18
Member
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. Albabox가 없어요 뭘까요 |
||
|
|
||
| export type AlbaFindDrawerProps = { | ||
| open: boolean | ||
| onOpenChange: (open: boolean) => void | ||
| jobs: AlbaboxProps[] | ||
| } | ||
|
|
||
| export function AlbaFindDrawer({ | ||
| open, | ||
| onOpenChange, | ||
| jobs, | ||
| }: AlbaFindDrawerProps) { | ||
| const [mode, setMode] = useState<AlbaFindMode>('nearby') | ||
| const [activeFilter, setActiveFilter] = useState<AlbaFindFilterId>('sort') | ||
|
|
||
| return ( | ||
| <Drawer open={open} onOpenChange={onOpenChange}> | ||
| <DrawerContent className="flex max-h-[90vh] flex-col gap-0 p-0"> | ||
| <div className="sr-only"> | ||
| <DrawerTitle>알바 찾기</DrawerTitle> | ||
| <DrawerDescription> | ||
| 주변 또는 지역 기준으로 알바 공고를 확인할 수 있습니다. | ||
| </DrawerDescription> | ||
| </div> | ||
|
|
||
| <div className="shrink-0 px-4 pb-4 pt-1"> | ||
| <AlbaFindCategoryBar | ||
| mode={mode} | ||
| onModeChange={setMode} | ||
| activeFilter={activeFilter} | ||
| onFilterChange={setActiveFilter} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="flex min-h-0 flex-1 flex-col"> | ||
| <AlbaFindList className="px-4 pb-6"> | ||
| {jobs.map((job, index) => ( | ||
| <Albabox key={`${job.title}-${index}`} {...job} /> | ||
| ))} | ||
| </AlbaFindList> | ||
| </div> | ||
| </DrawerContent> | ||
| </Drawer> | ||
| ) | ||
| } | ||
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 @@ | ||
| export type DrawerHandleBarProps = { | ||
| className?: string | ||
| size?: 'sm' | 'md' | ||
| } | ||
|
|
||
| export function DrawerHandleBar({ | ||
| className, | ||
| size = 'md', | ||
| }: DrawerHandleBarProps) { | ||
| return ( | ||
| <div | ||
| className={`mx-auto shrink-0 rounded-full bg-line-2 ${size === 'sm' ? 'h-1.5 w-10' : 'h-2 w-[100px]'} ${className ?? ''}`.trim()} | ||
| aria-hidden | ||
| /> | ||
| ) | ||
| } |
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,82 @@ | ||
| import { useRef, type PointerEvent } from 'react' | ||
|
|
||
| import { DrawerHandleBar } from './DrawerHandleBar' | ||
|
|
||
| type DrawerPeekStripProps = { | ||
| show: boolean | ||
| onRequestOpen: () => void | ||
| dragThresholdPx?: number | ||
| } | ||
|
|
||
| export function DrawerPeekStrip({ | ||
| show, | ||
| onRequestOpen, | ||
| dragThresholdPx = 40, | ||
| }: DrawerPeekStripProps) { | ||
| const dragRef = useRef<{ pointerId: number; startY: number } | null>(null) | ||
|
|
||
| const handlePointerDown = (event: PointerEvent<HTMLDivElement>) => { | ||
| dragRef.current = { | ||
| pointerId: event.pointerId, | ||
| startY: event.clientY, | ||
| } | ||
| event.currentTarget.setPointerCapture(event.pointerId) | ||
| } | ||
|
|
||
| const handlePointerMove = (event: PointerEvent<HTMLDivElement>) => { | ||
| if (!dragRef.current || dragRef.current.pointerId !== event.pointerId) | ||
| return | ||
| const deltaUp = dragRef.current.startY - event.clientY | ||
| if (deltaUp >= dragThresholdPx) { | ||
| onRequestOpen() | ||
| dragRef.current = null | ||
| try { | ||
| event.currentTarget.releasePointerCapture(event.pointerId) | ||
| } catch { | ||
| // noop | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const endDrag = (event: PointerEvent<HTMLDivElement>) => { | ||
| if (!dragRef.current || dragRef.current.pointerId !== event.pointerId) | ||
| return | ||
| dragRef.current = null | ||
| try { | ||
| event.currentTarget.releasePointerCapture(event.pointerId) | ||
| } catch { | ||
| // noop | ||
| } | ||
| } | ||
|
|
||
| if (!show) return null | ||
|
|
||
| return ( | ||
| <div | ||
| className="fixed inset-x-0 bottom-0 z-30 cursor-grab touch-none select-none active:cursor-grabbing" | ||
| onPointerDown={handlePointerDown} | ||
| onPointerMove={handlePointerMove} | ||
| onPointerUp={endDrag} | ||
| onPointerCancel={endDrag} | ||
| role="button" | ||
| tabIndex={0} | ||
| aria-label="손잡이를 누른 채 위로 드래그하여 패널 열기" | ||
| onKeyDown={event => { | ||
| if (event.key === 'Enter' || event.key === ' ') { | ||
| event.preventDefault() | ||
| onRequestOpen() | ||
| } | ||
| }} | ||
| > | ||
| <div className="mx-auto max-w-lg rounded-t-[12px] border border-b-0 border-line-2 bg-white px-4 pb-0 pt-3 shadow-[0_-8px_24px_rgba(0,0,0,0.08)]"> | ||
| <div className="flex flex-col items-center"> | ||
| <DrawerHandleBar size="sm" className="bg-[#dcdcdc]" /> | ||
| <div | ||
| className="mt-2.5 h-2 w-full rounded-t-[4px] bg-bg-dark" | ||
| aria-hidden | ||
| /> | ||
| </div> | ||
| </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,112 @@ | ||
| import * as React from 'react' | ||
| import { Drawer as DrawerPrimitive } from 'vaul' | ||
|
|
||
| import { DrawerHandleBar } from './DrawerHandleBar' | ||
|
|
||
| const Drawer = ({ | ||
| shouldScaleBackground = true, | ||
| ...props | ||
| }: React.ComponentProps<typeof DrawerPrimitive.Root>) => ( | ||
| <DrawerPrimitive.Root | ||
| shouldScaleBackground={shouldScaleBackground} | ||
| {...props} | ||
| /> | ||
| ) | ||
| Drawer.displayName = 'Drawer' | ||
|
|
||
| const DrawerTrigger = DrawerPrimitive.Trigger | ||
|
|
||
| const DrawerPortal = DrawerPrimitive.Portal | ||
|
|
||
| const DrawerClose = DrawerPrimitive.Close | ||
|
|
||
| const DrawerOverlay = React.forwardRef< | ||
| React.ElementRef<typeof DrawerPrimitive.Overlay>, | ||
| React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay> | ||
| >(({ className, ...props }, ref) => ( | ||
| <DrawerPrimitive.Overlay | ||
| ref={ref} | ||
| className={`fixed inset-0 z-50 bg-black/80 ${className ?? ''}`.trim()} | ||
| {...props} | ||
| /> | ||
| )) | ||
| DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName | ||
|
|
||
| const DrawerContent = React.forwardRef< | ||
| React.ElementRef<typeof DrawerPrimitive.Content>, | ||
| React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> | ||
| >(({ className, children, ...props }, ref) => ( | ||
| <DrawerPortal> | ||
| <DrawerOverlay /> | ||
| <DrawerPrimitive.Content | ||
| ref={ref} | ||
| className={`fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto max-h-[96vh] flex-col rounded-t-[10px] border border-line-2 bg-white ${className ?? ''}`.trim()} | ||
| {...props} | ||
| > | ||
| <div className="mt-4"> | ||
| <DrawerHandleBar size="md" /> | ||
| </div> | ||
| {children} | ||
| </DrawerPrimitive.Content> | ||
| </DrawerPortal> | ||
| )) | ||
| DrawerContent.displayName = 'DrawerContent' | ||
|
|
||
| const DrawerHeader = ({ | ||
| className, | ||
| ...props | ||
| }: React.HTMLAttributes<HTMLDivElement>) => ( | ||
| <div | ||
| className={`grid gap-1.5 p-4 text-center sm:text-left ${className ?? ''}`.trim()} | ||
| {...props} | ||
| /> | ||
| ) | ||
| DrawerHeader.displayName = 'DrawerHeader' | ||
|
|
||
| const DrawerFooter = ({ | ||
| className, | ||
| ...props | ||
| }: React.HTMLAttributes<HTMLDivElement>) => ( | ||
| <div | ||
| className={`mt-auto flex flex-col gap-2 p-4 ${className ?? ''}`.trim()} | ||
| {...props} | ||
| /> | ||
| ) | ||
| DrawerFooter.displayName = 'DrawerFooter' | ||
|
|
||
| const DrawerTitle = React.forwardRef< | ||
| React.ElementRef<typeof DrawerPrimitive.Title>, | ||
| React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title> | ||
| >(({ className, ...props }, ref) => ( | ||
| <DrawerPrimitive.Title | ||
| ref={ref} | ||
| className={`typography-headline03 text-text-100 ${className ?? ''}`.trim()} | ||
| {...props} | ||
| /> | ||
| )) | ||
| DrawerTitle.displayName = DrawerPrimitive.Title.displayName | ||
|
|
||
| const DrawerDescription = React.forwardRef< | ||
| React.ElementRef<typeof DrawerPrimitive.Description>, | ||
| React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description> | ||
| >(({ className, ...props }, ref) => ( | ||
| <DrawerPrimitive.Description | ||
| ref={ref} | ||
| className={`typography-body02-regular text-text-70 ${className ?? ''}`.trim()} | ||
| {...props} | ||
| /> | ||
| )) | ||
| DrawerDescription.displayName = DrawerPrimitive.Description.displayName | ||
|
|
||
| export { | ||
| Drawer, | ||
| DrawerPortal, | ||
| DrawerOverlay, | ||
| DrawerTrigger, | ||
| DrawerClose, | ||
| DrawerContent, | ||
| DrawerHeader, | ||
| DrawerFooter, | ||
| DrawerTitle, | ||
| DrawerDescription, | ||
| } |
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.
Fix unresolved
Albaboximport (currently breaks TypeScript build).Line 18 imports
@/shared/ui/manager/alba-find/Albabox, but CI reports TS2307 for this module. Please align the import path/casing with the actual file/export name sotsccan resolve it on case-sensitive environments.🧰 Tools
🪛 GitHub Actions: CI
[error] 18-18: TypeScript (tsc) build failed: TS2307 Cannot find module '@/shared/ui/manager/alba-find/Albabox' or its corresponding type declarations.
🪛 GitHub Check: quality
[failure] 18-18:
Cannot find module '@/shared/ui/manager/alba-find/Albabox' or its corresponding type declarations.
🤖 Prompt for AI Agents