-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from DDD-Community/feature/screenshot
[FEATURE] 보드 공유를 위한 폴라로이드 선택, 스크린샷 기능 추가
- Loading branch information
Showing
32 changed files
with
1,379 additions
and
135 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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.
This file contains 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
42 changes: 42 additions & 0 deletions
42
src/app/board/[boardId]/_components/Header/DefaultHeader.tsx
This file contains 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,42 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import Header from '@/components/Header' | ||
import PinIcon from 'public/icons/pinFilled.svg' | ||
import Hamburger from '@/components/HamburgerMenu' | ||
import Tutorial from '@/app/board/[boardId]/_components/Tutorial' | ||
import { Step1Tooltip } from '@/app/board/[boardId]/_components/Tutorial/Tooltips' | ||
import ShareBtn from '@/app/board/[boardId]/_components/Share' | ||
import { useSession } from 'next-auth/react' | ||
import { useBoard } from '@/app/board/[boardId]/_contexts/BoardContext' | ||
import { twMerge } from 'tailwind-merge' | ||
|
||
const DefaultHeader = ({ className }: { className: string }) => { | ||
const { data: session } = useSession() | ||
const { board } = useBoard() | ||
|
||
return ( | ||
<Header | ||
title={ | ||
<div className="flex items-center justify-center gap-[3px] text-center"> | ||
<PinIcon /> | ||
<h1 className="text-md font-semiBold leading-6">{board.title}</h1> | ||
</div> | ||
} | ||
leftButton={<Hamburger />} | ||
rightButton={ | ||
session ? ( | ||
<Tutorial step={1} tooltip={<Step1Tooltip />} hasNext> | ||
<ShareBtn /> | ||
</Tutorial> | ||
) : ( | ||
<ShareBtn /> | ||
) | ||
} | ||
className={twMerge('bg-transparent', className)} | ||
shadow={false} | ||
/> | ||
) | ||
} | ||
|
||
export default DefaultHeader |
30 changes: 30 additions & 0 deletions
30
src/app/board/[boardId]/_components/Header/SelectModeHeader.tsx
This file contains 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,30 @@ | ||
import React from 'react' | ||
import Header from '@/components/Header' | ||
import { useSelect } from '@/app/board/[boardId]/_contexts/SelectModeContext' | ||
import { useBoard } from '@/app/board/[boardId]/_contexts/BoardContext' | ||
import { twMerge } from 'tailwind-merge' | ||
|
||
const SelectModeHeader = ({ className }: { className: string }) => { | ||
const { selectedIds, MAX_SELECT_COUNT } = useSelect() | ||
const { board } = useBoard() | ||
const maxLength = Math.min(board.items.length, MAX_SELECT_COUNT) | ||
|
||
return ( | ||
<Header | ||
title={ | ||
<div className="flex flex-col items-center justify-center gap-[3px] text-center text-md font-semiBold leading-6"> | ||
<h1>꾸미고 싶은 폴라로이드를 골라주세요</h1> | ||
<h2 className="flex gap-0.5"> | ||
<span className="text-gray-400">{selectedIds.length}</span> | ||
<span className="text-gray-400">/</span> | ||
<span>{maxLength}</span> | ||
</h2> | ||
</div> | ||
} | ||
className={twMerge('bg-transparent', className)} | ||
shadow={false} | ||
/> | ||
) | ||
} | ||
|
||
export default SelectModeHeader |
This file contains 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,22 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import { useSelect } from '@/app/board/[boardId]/_contexts/SelectModeContext' | ||
import DefaultHeader from '@/app/board/[boardId]/_components/Header/DefaultHeader' | ||
import SelectModeHeader from '@/app/board/[boardId]/_components/Header/SelectModeHeader' | ||
import { useBoard } from '@/app/board/[boardId]/_contexts/BoardContext' | ||
import { BOARDTHEMAS } from '@/lib/constants/boardConfig' | ||
|
||
const Header = () => { | ||
const { isSelectMode } = useSelect() | ||
const { board } = useBoard() | ||
const boardTheme = BOARDTHEMAS[board.options.THEMA].theme | ||
const className = boardTheme === 'LIGHT' ? 'text-gray-900' : 'text-gray-0' | ||
|
||
if (isSelectMode) { | ||
return <SelectModeHeader className={className} /> | ||
} | ||
return <DefaultHeader className={className} /> | ||
} | ||
|
||
export default Header |
This file contains 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 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
110 changes: 83 additions & 27 deletions
110
src/app/board/[boardId]/_components/PolaroidList/index.tsx
This file contains 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
17 changes: 17 additions & 0 deletions
17
src/app/board/[boardId]/_components/Share/CopyCompleteToast.tsx
This file contains 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,17 @@ | ||
import React from 'react' | ||
import Toast from '@/components/Toast' | ||
|
||
interface CopyCompleteToastProps { | ||
show: boolean | ||
close: () => void | ||
} | ||
|
||
const CopyCompleteToast = ({ show, close }: CopyCompleteToastProps) => { | ||
return ( | ||
<Toast isOpen={show} setClose={close}> | ||
클립보드에 링크가 복사되었어요! | ||
</Toast> | ||
) | ||
} | ||
|
||
export default CopyCompleteToast |
22 changes: 22 additions & 0 deletions
22
src/app/board/[boardId]/_components/Share/NoPolaroidToSelectToast.tsx
This file contains 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,22 @@ | ||
import React from 'react' | ||
import Toast from '@/components/Toast' | ||
|
||
interface CopyCompleteToastProps { | ||
show: boolean | ||
close: () => void | ||
} | ||
|
||
const CopyCompleteToast = ({ show, close }: CopyCompleteToastProps) => { | ||
return ( | ||
<Toast isOpen={show} setClose={close}> | ||
<div className=""> | ||
<div> | ||
보드를 꾸미기 위해 <span className="font-semiBold">1장 이상</span>의 | ||
</div> | ||
<div>폴라로이드를 업로드 해주세요!</div> | ||
</div> | ||
</Toast> | ||
) | ||
} | ||
|
||
export default CopyCompleteToast |
This file contains 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
Oops, something went wrong.