diff --git a/public/images/section7_phone2.png b/public/images/section7_phone2.png new file mode 100644 index 00000000..a094779f Binary files /dev/null and b/public/images/section7_phone2.png differ diff --git a/public/sw.js.map b/public/sw.js.map index 6de2758f..b280aeba 100644 --- a/public/sw.js.map +++ b/public/sw.js.map @@ -1 +1,32 @@ -{"version":3,"file":"sw.js","sources":["../../../../../private/var/folders/k1/dqklgtzs47vckvrkl74mxsxc0000gn/T/92653e5fe2ebf991a1b5d4056a74e5d3/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/eugene/dev/front/ListyWave-front/node_modules/next-pwa/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from '/Users/eugene/dev/front/ListyWave-front/node_modules/next-pwa/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from '/Users/eugene/dev/front/ListyWave-front/node_modules/next-pwa/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/eugene/dev/front/ListyWave-front/node_modules/next-pwa/node_modules/workbox-core/clientsClaim.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\nimportScripts(\n \n);\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n\nworkbox_routing_registerRoute(\"/\", new workbox_strategies_NetworkFirst({ \"cacheName\":\"start-url\", plugins: [{ cacheWillUpdate: async ({ request, response, event, state }) => { if (response && response.type === 'opaqueredirect') { return new Response(response.body, { status: 200, statusText: 'OK', headers: response.headers }) } return response } }] }), 'GET');\nworkbox_routing_registerRoute(/.*/i, new workbox_strategies_NetworkOnly({ \"cacheName\":\"dev\", plugins: [] }), 'GET');\n\n\n\n\n"],"names":["importScripts","self","skipWaiting","workbox_core_clientsClaim","workbox_routing_registerRoute","workbox_strategies_NetworkFirst","plugins","cacheWillUpdate","request","response","event","state","type","Response","body","status","statusText","headers","workbox_strategies_NetworkOnly"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAa,EAEZ,CAAA;EAQDC,CAAI,CAAA,CAAA,CAAA,CAACC,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA;AAElBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAyB,EAAE,CAAA;AAI3BC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAA6B,CAAC,CAAA,CAAA,CAAG,CAAE,CAAA,CAAA,CAAA,CAAA,CAAIC,oBAA+B,CAAC,CAAA;EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,EAAC,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EAAEC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAO,EAAE,CAAC,CAAA;GAAEC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA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klgtzs47vckvrkl74mxsxc0000gn/T/92653e5fe2ebf991a1b5d4056a74e5d3/sw.js" + ], + "sourcesContent": [ + "import {registerRoute as workbox_routing_registerRoute} from '/Users/eugene/dev/front/ListyWave-front/node_modules/next-pwa/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from '/Users/eugene/dev/front/ListyWave-front/node_modules/next-pwa/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {NetworkOnly as workbox_strategies_NetworkOnly} from '/Users/eugene/dev/front/ListyWave-front/node_modules/next-pwa/node_modules/workbox-strategies/NetworkOnly.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/eugene/dev/front/ListyWave-front/node_modules/next-pwa/node_modules/workbox-core/clientsClaim.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\nimportScripts(\n \n);\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n\nworkbox_routing_registerRoute(\"/\", new workbox_strategies_NetworkFirst({ \"cacheName\":\"start-url\", plugins: [{ cacheWillUpdate: async ({ request, response, event, state }) => { if (response && response.type === 'opaqueredirect') { return new Response(response.body, { status: 200, statusText: 'OK', headers: response.headers }) } return response } }] }), 'GET');\nworkbox_routing_registerRoute(/.*/i, new workbox_strategies_NetworkOnly({ \"cacheName\":\"dev\", plugins: [] }), 'GET');\n\n\n\n\n" + ], + "names": [ + "importScripts", + "self", + "skipWaiting", + "workbox_core_clientsClaim", + "workbox_routing_registerRoute", + "workbox_strategies_NetworkFirst", + "plugins", + "cacheWillUpdate", + "request", + "response", + "event", + "state", + "type", + "Response", + "body", + "status", + "statusText", + "headers", + "workbox_strategies_NetworkOnly" + ], + "mappings": ";;;;;;;;;;;;;;;;;;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A,CAAA,CAAA,CAACQ,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAA;EAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAOR,QAAQ,CAAA;EAAC,CAAA,CAAA,CAAA,CAAA,CAAA;KAAG,CAAA;AAAE,CAAA,CAAA,CAAC,CAAC,CAAA,CAAE,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,CAAA;AACxWL,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAA6B,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAE,CAAA,CAAA,CAAA,CAAA,CAAIc,mBAA8B,CAAC,CAAA;EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,EAAC,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA;EAAEZ,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAO,EAAE,CAAA,CAAA;EAAG,CAAC,CAAC,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA;;" +} diff --git a/public/videos/record_video.mp4 b/public/videos/record_video.mp4 new file mode 100644 index 00000000..01318b29 Binary files /dev/null and b/public/videos/record_video.mp4 differ diff --git a/public/videos/video_section3.mp4 b/public/videos/video_section3.mp4 new file mode 100644 index 00000000..f22182b6 Binary files /dev/null and b/public/videos/video_section3.mp4 differ diff --git a/src/app/intro/_components/Footer.tsx b/src/app/intro/_components/Footer.tsx index 1c707240..c7ce2c89 100644 --- a/src/app/intro/_components/Footer.tsx +++ b/src/app/intro/_components/Footer.tsx @@ -40,7 +40,8 @@ function Footer() {

{introLocale[language].privacy}

-

listywave8@gmail.com

+

에잇(Eight)

+

Makers : 에잇(Eight, listywave8@gmail.com)

Copyright ©Listywave - All rights reserved

diff --git a/src/app/intro/_components/MotionWrapper.tsx b/src/app/intro/_components/MotionWrapper.tsx index aed5b6cd..49d0ed0e 100644 --- a/src/app/intro/_components/MotionWrapper.tsx +++ b/src/app/intro/_components/MotionWrapper.tsx @@ -32,7 +32,7 @@ function MotionWrapper({ children, delay, variantsType = 'vertical' }: MotionWra const ref = useIntersectionObserver(() => { controls.start('visible'); - }, 0.5); + }, 0.4); return ( {introLocale[language].section.message6}
- {introLocale[language].section.createListImage} +
diff --git a/src/app/intro/_components/Section7.tsx b/src/app/intro/_components/Section7.tsx index 9b0b4bd4..a68dda76 100644 --- a/src/app/intro/_components/Section7.tsx +++ b/src/app/intro/_components/Section7.tsx @@ -36,7 +36,7 @@ function Section7() {
listywave.com/user/1
{introLocale[language].section.cellphoneImage} void; + setActiveNickname: (userName?: string) => void; activeNickname?: string | null; handleSetCommentId: (id: number | undefined) => void; + handleSetComment: (comment: string) => void; listId?: number; commentId?: number; currentUserInfo?: UserType; @@ -36,17 +37,18 @@ interface CommentProps { function Comment({ comment, - onUpdate, + setActiveNickname: onUpdate, handleSetCommentId, + handleSetComment, listId, commentId, currentUserInfo, - handleEdit, }: CommentProps) { const { language } = useLanguage(); const queryClient = useQueryClient(); const { setCommentId } = useCommentId(); + const { setStatusCreateReply, setStatusEdit } = useCommentStatus(); //현재 작성중인 답글의 원댓글 정보를 업데이트 하는 로직 const handleActiveNicknameAndIdUpdate = () => { @@ -55,11 +57,15 @@ function Comment({ if (!currentUserName && !currentCommentId) { return null; } + handleSetComment(''); + setStatusCreateReply(); onUpdate(currentUserName); handleSetCommentId(currentCommentId); }; + //수정하기 버튼을 누르면 실행되는 함수 const handleEditButtonClick = (comment: string) => { + setStatusEdit(); handleEdit(comment); setCommentId(commentId as number); }; diff --git a/src/app/list/[listId]/_components/ListDetailOuter/CommentForm.tsx b/src/app/list/[listId]/_components/ListDetailOuter/CommentForm.tsx index b1b3069a..7717f2ff 100644 --- a/src/app/list/[listId]/_components/ListDetailOuter/CommentForm.tsx +++ b/src/app/list/[listId]/_components/ListDetailOuter/CommentForm.tsx @@ -1,21 +1,23 @@ -import { ChangeEvent } from 'react'; +import { ChangeEvent, useEffect } from 'react'; import { useUser } from '@/store/useUser'; -import { useIsEditing } from '@/store/useComment'; -import * as styles from './Comments.css'; -import CancelButton from '/public/icons/cancel_button.svg'; -import { vars } from '@/styles/theme.css'; -import Airplane from '/public/icons/airplane_send.svg'; +import { useIsEditing, useCommentStatus } from '@/store/useComment'; import { useLanguage } from '@/store/useLanguage'; +import useResizeTextarea from '@/hooks/useResizeTextarea'; import { commentPlaceholder } from '@/lib/constants/placeholder'; import { commentLocale } from '@/app/list/[listId]/locale'; +import { vars } from '@/styles/theme.css'; +import * as styles from './Comments.css'; +import CancelButton from '/public/icons/cancel_button.svg'; +import Airplane from '/public/icons/airplane_send.svg'; + interface CommentFormProps { comment?: string; activeNickname?: string | null; - handleSubmit?: (e: React.FormEvent) => void; + handleSubmit: (e: React.FormEvent | React.KeyboardEvent) => void; handleUpdate?: () => void; - handleChange: (e: ChangeEvent) => void; + handleChange: (e: ChangeEvent) => void; imageSrc?: string; isEditing?: boolean; isPending: boolean; @@ -31,16 +33,84 @@ function CommentForm({ handleUpdate, handleCancel, }: CommentFormProps) { + const { status } = useCommentStatus(); const { language } = useLanguage(); const { isEditing } = useIsEditing(); + const { textareaRef, handleResizeHeight } = useResizeTextarea(); + + const handleResetTextArea = () => { + if (textareaRef.current !== null) { + textareaRef.current.style.height = '20px'; + } + }; + + const handleTextareaChange = (e: ChangeEvent) => { + handleChange(e); + handleResizeHeight(); + }; + + const handleSubmitForm = (e: React.FormEvent) => { + handleSubmit(e); + // handleResizeHeight(); + handleResetTextArea(); + }; + + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === 'Enter' && !e.shiftKey && !isPending) { + // handleResizeHeight(); + handleResetTextArea(); + e.preventDefault(); + handleSubmit(e); + } + }; + + const handleCancelForm = () => { + handleCancel(); + handleResizeHeight(); + }; + + const textAreaHeight = () => { + if (textareaRef.current === null) { + return false; + } + if (textareaRef.current.scrollHeight >= 30) { + return true; + } + }; const { user } = useUser(); const userId = user.id; + useEffect(() => { + const textarea = textareaRef.current; + + const handleBlur = () => { + handleResizeHeight(); + }; + + const handleFocus = () => { + handleResizeHeight(); + }; + + if (textarea) { + textarea.addEventListener('blur', handleBlur); + textarea.addEventListener('focus', handleFocus); + } + + return () => { + if (textarea) { + textarea.removeEventListener('blur', handleBlur); + textarea.removeEventListener('focus', handleFocus); + } + }; + }, [textareaRef, handleResizeHeight]); + return (
-
- {activeNickname && ( +
+ {status === 'createReply' && activeNickname && (
{language === 'ko' @@ -57,28 +127,31 @@ function CommentForm({ />
)} - {isEditing && ( + {status === 'edit' && isEditing && (
{commentLocale[language].editing}
)} -
- +