-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [FIX] 사용하지 않는 기능 UI 제거 (#577) * [FIX] 원래 코드 복구 (#568) * fix: 기존 작업 코드 복구 * fix: build 위해 안쓰는 파일 주석 * [DESIGN] 픽 생성시 zIndex 추가 (#570) * [FIX] 현재 완전히 구현되지 않은 기능 UI 제거 (#576) --------- Co-authored-by: kimminkyeu <[email protected]> * [FIX] 현재 PickRecord에서 조회 안되는 문제 수정 (#581) * fix: 깃 충돌 방지를 위한 테스트 커믹 * fix: 충돌 방지를 위한 테스트 커밋 * fix: 깃 머지 테스트를 위한 commit * fix: 깃 머지 테스트를 위한 commit * fix: 깃 머지 테스트를 위한 commit * fix: 깃 머지 테스트를 위한 commit * [FIX] 원래 코드 복구 (#568) * fix: 기존 작업 코드 복구 * fix: build 위해 안쓰는 파일 주석 * [DESIGN] 픽 생성시 zIndex 추가 (#570) * [FIX] 현재 완전히 구현되지 않은 기능 UI 제거 (#576) * [FIX] PickRecord에서 태그가 보이지 않는 문제 수정 (#580) * refactor: PickTagPicker 이름 변경 * feat: PickRecord에서 수정시 더블 클릭되게 변경 * fix: 페이지 변경시마다 tagList 불러오기 --------- Co-authored-by: kimminkyeu <[email protected]> * feat: add context menu item 공유하기 - icon, text 추가. 기능 x * feat: share folder api - 스키마 정의, res는 아직 수정중이라셔서 any로 받음 - api 호출, 에러핸들링 관련 명세가 없어서 로그만 남김 * refactor: shareFolder API 함수 콜 로직 변경 - 기존: store에 정의된 shareFolderById()를 호출하여 shareFolder API 콜 - 변경: 뷰에서 shareFolder API를 바로 호출 - 이유: 뷰의 props로 id만 주어진 줄 알았는데 requestDTO에 필요한 name도 함께 주어져 store에 비지니스 로직을 따로 둘 필요가 사라짐 * feat: Share Folder Dialog - 공유하기 다이얼로그 팝업 - Copy 버튼 클릭시 uuid를 포함한 share link 복사 - "내설정" 링크 클릭시 공유된 폴더 링크로 이동(라우팅 경로 아직 안만듦) * feat: routing share page - /share/[uuid]로 라우팅 되도록 라우팅 디렉토리 생성 * fix: Share Folder Link 경로 수정 - 기존: domain/folder/uuid - 변경: domain/share/uuid * chore: import 순서 --------- Co-authored-by: dmdgpdi <[email protected]> Co-authored-by: kimminkyeu <[email protected]>
- Loading branch information
1 parent
9a8521c
commit 4279abc
Showing
12 changed files
with
355 additions
and
2 deletions.
There are no files selected for viewing
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
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,23 @@ | ||
import { HTTPError } from 'ky'; | ||
import { apiClient, returnErrorFromHTTPError } from '@/apis'; | ||
import { API_URLS } from '../apiConstants'; | ||
import { ShareFolderRequestType, ShareFolderResponseType } from '@/types'; | ||
|
||
export const shareFolder = async (shareFolderInfo: ShareFolderRequestType) => { | ||
try { | ||
const response = await apiClient.post<ShareFolderResponseType>( | ||
API_URLS.SHARE_FOLDER, | ||
{ | ||
json: shareFolderInfo, | ||
} | ||
); | ||
const data = await response.json(); | ||
return data; | ||
} catch (httpError) { | ||
if (httpError instanceof HTTPError) { | ||
const error = await returnErrorFromHTTPError(httpError); | ||
throw error; | ||
} | ||
throw httpError; | ||
} | ||
}; |
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,5 @@ | ||
import React from 'react'; | ||
|
||
export default function page() { | ||
return <div>shared page</div>; | ||
} |
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
86 changes: 86 additions & 0 deletions
86
frontend/techpick/src/components/FolderTree/ShareFolderDialog.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,86 @@ | ||
import { useState } from 'react'; | ||
import Link from 'next/link'; | ||
import * as DialogPrimitive from '@radix-ui/react-dialog'; | ||
import { Settings } from 'lucide-react'; | ||
import { Popover, PopoverContent, PopoverTrigger } from '@/ui/Popover/Popover'; | ||
import { handleShareFolderLinkCopy } from '@/utils/handleShareFolderLinkCopy'; | ||
import * as styles from './shareFolderDialog.css'; | ||
|
||
export default function ShareFolderDialog({ | ||
uuid, | ||
onClose, | ||
}: ShareFolderDialogProps) { | ||
const [showPopover, setshowPopover] = useState<boolean>(false); | ||
const handleShowPopver = () => { | ||
setshowPopover(true); | ||
setTimeout(() => setshowPopover(false), 2000); | ||
}; | ||
const shareFolderLink = `${window.location.origin}/share/${uuid}`; | ||
|
||
return ( | ||
<DialogPrimitive.Root open={true}> | ||
<DialogPrimitive.Portal> | ||
<DialogPrimitive.Overlay | ||
className={styles.dialogOverlay} | ||
onClick={onClose} | ||
/> | ||
<DialogPrimitive.Content className={styles.dialogContent}> | ||
<DialogPrimitive.Title className={styles.dialogTitle}> | ||
폴더가 공유되었습니다. | ||
</DialogPrimitive.Title> | ||
<DialogPrimitive.Description className={styles.dialogDescription}> | ||
<Link href={`/share/${uuid}`} className={styles.myLinkPageLinkText}> | ||
<span className={styles.linkContent}> | ||
<Settings className={styles.icon} /> | ||
내설정 | ||
</span> | ||
</Link> | ||
에서 공유를 취소할 수 있습니다. | ||
</DialogPrimitive.Description> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
}} | ||
> | ||
{/** | ||
* @description: 이벤트 버블링으로 인해 드래그시 폴더가 이동하면서 다이얼로그가 닫히는 현상을 방지하기 위해 | ||
* onMouseDown 이벤트에 event.stopPropagation()을 추가 | ||
*/} | ||
<div | ||
className={styles.sharedFolderLink} | ||
onMouseDown={(event) => event.stopPropagation()} | ||
id="shared-folder-link" | ||
title={shareFolderLink} | ||
> | ||
{shareFolderLink} | ||
</div> | ||
<Popover open={showPopover}> | ||
<PopoverTrigger asChild> | ||
<button | ||
className={styles.copyButton} | ||
onClick={() => handleShareFolderLinkCopy(handleShowPopver)} | ||
> | ||
Copy | ||
</button> | ||
</PopoverTrigger> | ||
<PopoverContent className={styles.popoverStyle}> | ||
Copied | ||
</PopoverContent> | ||
</Popover> | ||
</div> | ||
<DialogPrimitive.Close className={styles.closeIcon} onClick={onClose}> | ||
× | ||
</DialogPrimitive.Close> | ||
</DialogPrimitive.Content> | ||
</DialogPrimitive.Portal> | ||
</DialogPrimitive.Root> | ||
); | ||
} | ||
|
||
interface ShareFolderDialogProps { | ||
uuid: string; | ||
onClose: () => void; | ||
} |
Oops, something went wrong.