-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: subspace node 추가 * refactor: autofit 로직 별도 훅으로 분리 * feat: 노드 생성 시 노트 생성 기능 구현 * feat: 노트 노드 클릭 시 해당 노트로 이동 기능 구현 * fix: 누락된 prop 전달 값 추가 --------- Co-authored-by: Hogyun Jeon <[email protected]>
- Loading branch information
Showing
5 changed files
with
64 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { API_V1_URL } from "./constants"; | ||
import http from "./http"; | ||
|
||
type CreateNoteRequestBody = { | ||
userId: string; | ||
noteName: string; | ||
}; | ||
|
||
type CreateNoteResponseBody = { | ||
urlPath: [string]; | ||
}; | ||
|
||
export async function createNote(body: CreateNoteRequestBody) { | ||
const response = await http.post<CreateNoteResponseBody>( | ||
`${API_V1_URL}/note`, | ||
{ body: JSON.stringify(body) }, | ||
); | ||
return response.data; | ||
} |
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,24 @@ | ||
import { RefObject } from "react"; | ||
|
||
import useYjsConnection from "@/hooks/yjs/useYjsConnection"; | ||
import { YjsStoreProvider } from "@/store/yjs"; | ||
|
||
import SpaceView from "./SpaceView"; | ||
|
||
type YjsSpaceViewProps = { | ||
spaceId: string; | ||
autofitTo?: Element | RefObject<Element>; | ||
}; | ||
|
||
export default function YjsSpaceView({ | ||
spaceId, | ||
autofitTo, | ||
}: YjsSpaceViewProps) { | ||
const { yDoc, yProvider, setYDoc, setYProvider } = useYjsConnection(spaceId); | ||
|
||
return ( | ||
<YjsStoreProvider value={{ yDoc, yProvider, setYDoc, setYProvider }}> | ||
<SpaceView spaceId={spaceId} autofitTo={autofitTo} /> | ||
</YjsStoreProvider> | ||
); | ||
} |
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