Skip to content

Commit

Permalink
[feat] 에디터 자동 저장 (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
Collection50 authored Sep 10, 2024
1 parent 4ec19e7 commit 70011bf
Show file tree
Hide file tree
Showing 15 changed files with 472 additions and 36 deletions.
38 changes: 38 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"cookies-next": "^4.2.1",
"date-fns": "^3.6.0",
"framer-motion": "^11.3.8",
"lottie-react": "^2.4.0",
"lowlight": "^3.1.0",
"lucide-react": "^0.411.0",
"next": "14.2.4",
Expand Down
297 changes: 297 additions & 0 deletions public/saving_dot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
{
"v": "5.4.3",
"fr": 25,
"ip": 0,
"op": 28,
"w": 1000,
"h": 1000,
"nm": "loading_1",
"ddd": 0,
"assets": [],
"layers": [
{
"ddd": 0,
"ind": 1,
"ty": 4,
"nm": "ball_3",
"sr": 1,
"ks": {
"o": { "a": 0, "k": 100, "ix": 11 },
"r": { "a": 0, "k": 0, "ix": 10 },
"p": {
"a": 1,
"k": [
{
"i": { "x": 0.667, "y": 1 },
"o": { "x": 0.333, "y": 0 },
"n": "0p667_1_0p333_0",
"t": 12,
"s": [754.951, 497.902, 0],
"e": [754.951, 415.902, 0],
"to": null,
"ti": null
},
{
"i": { "x": 0.667, "y": 1 },
"o": { "x": 0.333, "y": 0 },
"n": "0p667_1_0p333_0",
"t": 18,
"s": [754.951, 415.902, 0],
"e": [754.951, 497.902, 0],
"to": [0, 0, 0],
"ti": [0, -13.666672706604, 0]
},
{ "t": 24 }
],
"ix": 2
},
"a": { "a": 0, "k": [0, 0, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100, 100], "ix": 6 }
},
"ao": 0,
"shapes": [
{
"ty": "gr",
"it": [
{
"d": 1,
"ty": "el",
"s": { "a": 0, "k": [127.049, 127.049], "ix": 2 },
"p": { "a": 0, "k": [0, 0], "ix": 3 },
"nm": "Ellipse Path 1",
"mn": "ADBE Vector Shape - Ellipse",
"hd": false,
"_render": true
},
{
"ty": "fl",
"c": { "a": 0, "k": [0.6314, 0.6784, 0.7176, 1], "ix": 4 },
"o": { "a": 0, "k": 100, "ix": 5 },
"r": 1,
"bm": 0,
"nm": "Fill 1",
"mn": "ADBE Vector Graphic - Fill",
"hd": false,
"_render": true
},
{
"ty": "tr",
"p": { "a": 0, "k": [0, 0], "ix": 2 },
"a": { "a": 0, "k": [0, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100], "ix": 3 },
"r": { "a": 0, "k": 0, "ix": 6 },
"o": { "a": 0, "k": 100, "ix": 7 },
"sk": { "a": 0, "k": 0, "ix": 4 },
"sa": { "a": 0, "k": 0, "ix": 5 },
"nm": "Transform",
"_render": true
}
],
"nm": "Ellipse 1",
"np": 3,
"cix": 2,
"bm": 0,
"ix": 1,
"mn": "ADBE Vector Group",
"hd": false,
"_render": true
}
],
"ip": 0,
"op": 101,
"st": 0,
"bm": 0,
"completed": true
},
{
"ddd": 0,
"ind": 2,
"ty": 4,
"nm": "ball_2",
"sr": 1,
"ks": {
"o": { "a": 0, "k": 100, "ix": 11 },
"r": { "a": 0, "k": 0, "ix": 10 },
"p": {
"a": 1,
"k": [
{
"i": { "x": 0.667, "y": 1 },
"o": { "x": 0.333, "y": 0 },
"n": "0p667_1_0p333_0",
"t": 6,
"s": [497.451, 497.902, 0],
"e": [497.451, 415.902, 0],
"to": null,
"ti": null
},
{
"i": { "x": 0.667, "y": 1 },
"o": { "x": 0.333, "y": 0 },
"n": "0p667_1_0p333_0",
"t": 12,
"s": [497.451, 415.902, 0],
"e": [497.451, 497.902, 0],
"to": [0, 0, 0],
"ti": [0, -13.666672706604, 0]
},
{ "t": 18 }
],
"ix": 2
},
"a": { "a": 0, "k": [0, 0, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100, 100], "ix": 6 }
},
"ao": 0,
"shapes": [
{
"ty": "gr",
"it": [
{
"d": 1,
"ty": "el",
"s": { "a": 0, "k": [127.049, 127.049], "ix": 2 },
"p": { "a": 0, "k": [0, 0], "ix": 3 },
"nm": "Ellipse Path 1",
"mn": "ADBE Vector Shape - Ellipse",
"hd": false,
"_render": true
},
{
"ty": "fl",
"c": { "a": 0, "k": [0.6314, 0.6784, 0.7176, 1], "ix": 4 },
"o": { "a": 0, "k": 100, "ix": 5 },
"r": 1,
"bm": 0,
"nm": "Fill 1",
"mn": "ADBE Vector Graphic - Fill",
"hd": false,
"_render": true
},
{
"ty": "tr",
"p": { "a": 0, "k": [0, 0], "ix": 2 },
"a": { "a": 0, "k": [0, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100], "ix": 3 },
"r": { "a": 0, "k": 0, "ix": 6 },
"o": { "a": 0, "k": 100, "ix": 7 },
"sk": { "a": 0, "k": 0, "ix": 4 },
"sa": { "a": 0, "k": 0, "ix": 5 },
"nm": "Transform",
"_render": true
}
],
"nm": "Ellipse 1",
"np": 3,
"cix": 2,
"bm": 0,
"ix": 1,
"mn": "ADBE Vector Group",
"hd": false,
"_render": true
}
],
"ip": 0,
"op": 101,
"st": 0,
"bm": 0,
"completed": true
},
{
"ddd": 0,
"ind": 3,
"ty": 4,
"nm": "ball_1",
"sr": 1,
"ks": {
"o": { "a": 0, "k": 100, "ix": 11 },
"r": { "a": 0, "k": 0, "ix": 10 },
"p": {
"a": 1,
"k": [
{
"i": { "x": 0.667, "y": 1 },
"o": { "x": 0.333, "y": 0 },
"n": "0p667_1_0p333_0",
"t": 0,
"s": [239.951, 497.902, 0],
"e": [239.951, 415.902, 0],
"to": null,
"ti": null
},
{
"i": { "x": 0.667, "y": 1 },
"o": { "x": 0.333, "y": 0 },
"n": "0p667_1_0p333_0",
"t": 6,
"s": [239.951, 415.902, 0],
"e": [239.951, 497.902, 0],
"to": [0, 0, 0],
"ti": [0, -13.6666669845581, 0]
},
{ "t": 12 }
],
"ix": 2
},
"a": { "a": 0, "k": [0, 0, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100, 100], "ix": 6 }
},
"ao": 0,
"shapes": [
{
"ty": "gr",
"it": [
{
"d": 1,
"ty": "el",
"s": { "a": 0, "k": [127.049, 127.049], "ix": 2 },
"p": { "a": 0, "k": [0, 0], "ix": 3 },
"nm": "Ellipse Path 1",
"mn": "ADBE Vector Shape - Ellipse",
"hd": false,
"_render": true
},
{
"ty": "fl",
"c": { "a": 0, "k": [0.6314, 0.6784, 0.7176, 1], "ix": 4 },
"o": { "a": 0, "k": 100, "ix": 5 },
"r": 1,
"bm": 0,
"nm": "Fill 1",
"mn": "ADBE Vector Graphic - Fill",
"hd": false,
"_render": true
},
{
"ty": "tr",
"p": { "a": 0, "k": [0, 0], "ix": 2 },
"a": { "a": 0, "k": [0, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100], "ix": 3 },
"r": { "a": 0, "k": 0, "ix": 6 },
"o": { "a": 0, "k": 100, "ix": 7 },
"sk": { "a": 0, "k": 0, "ix": 4 },
"sa": { "a": 0, "k": 0, "ix": 5 },
"nm": "Transform",
"_render": true
}
],
"nm": "Ellipse 1",
"np": 3,
"cix": 2,
"bm": 0,
"ix": 1,
"mn": "ADBE Vector Group",
"hd": false,
"_render": true
}
],
"ip": 0,
"op": 101,
"st": 0,
"bm": 0,
"completed": true
}
],
"markers": [],
"__complete": true
}
8 changes: 8 additions & 0 deletions src/app/(sidebar)/write/[id]/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { usePutCardType } from '@/app/(sidebar)/write/[id]/api/usePutCardType/us
import { useQueryClient } from '@tanstack/react-query';
import { TypeTag } from '@/types/info';
import { useDeleteCard } from '@/app/(sidebar)/(my-info)/apis/useDeleteCard';
import { useRouter } from 'next/navigation';
import { usePutCardContent } from '@/app/(sidebar)/write/[id]/api/usePutCardContent/usePutCardContent';

export function useWrite(id: number) {
const {
Expand Down Expand Up @@ -39,6 +41,8 @@ export function useWrite(id: number) {
const { mutate: mutateDeleteCardTag } = useDeleteCardTag(id);
const { mutate: mutatePutCardType } = usePutCardType(id);
const { mutate: deleteCard } = useDeleteCard();
const { mutate: mutatePutCardContent, isPending, isSuccess } = usePutCardContent(id);
const { back } = useRouter();

const handlePutCardTitle = useCallback((value: string) => {
setTitle(value);
Expand Down Expand Up @@ -116,5 +120,9 @@ export function useWrite(id: number) {
disabledCount,
createdDate: createdDate.split(' ')[0].replaceAll(/-/g, '.'),
recruitTitle,
back,
mutatePutCardContent,
isPending,
isSuccess,
};
}
Loading

0 comments on commit 70011bf

Please sign in to comment.