diff --git a/src/components/Home/Home.module.scss b/src/components/Home/Home.module.scss index 41c5821..606134c 100644 --- a/src/components/Home/Home.module.scss +++ b/src/components/Home/Home.module.scss @@ -22,37 +22,38 @@ bottom: 0; z-index: 0; } +} - .HomeTitle { - padding-top: 5rem; - padding-bottom: 1.25rem; +.HomeTop { + z-index: 1; +} - display: flex; - flex-direction: column; - gap: 0.625rem; - z-index: 1; +.HomeTitle { + padding-top: 3.75rem; + display: flex; + flex-direction: column; + gap: 0.625rem; - & > h1 { - white-space: pre-line; - } + & > h1 { + white-space: pre-line; } +} - .HomeImage { - display: flex; - justify-content: center; - align-items: center; - z-index: 1; +.HomeImage { + display: flex; + justify-content: center; + align-items: center; + margin-top: 3.75rem; - & > img { - width: 16.25rem; - height: 16.25rem; - } + & > img { + width: 14.375rem; + height: 14.375rem; } +} - .HomeBottom { - display: flex; - align-items: center; - gap: 0.875rem; - z-index: 1; - } +.HomeBottom { + display: flex; + align-items: center; + gap: 0.875rem; + z-index: 1; } diff --git a/src/components/Home/Home.tsx b/src/components/Home/Home.tsx index f79d86e..4f9860a 100644 --- a/src/components/Home/Home.tsx +++ b/src/components/Home/Home.tsx @@ -29,17 +29,20 @@ const Home = () => { return (
-
- - {`영수증으로\nAI 음식 리뷰 남겨요`} - - - 손쉬운 음식 리뷰 작성 - -
-
- mainLogo +
+
+ + {`영수증으로\nAI 음식 리뷰 남겨요`} + + + 손쉬운 음식 리뷰 작성 + +
+
+ mainLogo +
+
span { + & > p { margin-top: 0.375rem; } } @@ -9,7 +9,7 @@ .ButtonWrapper { display: flex; align-items: center; - gap: 0.625rem; + gap: 0.25rem; margin-top: 1.5rem; & > button { @@ -19,11 +19,13 @@ .ShowButtonWrapper { display: flex; - align-items: center; + align-items: flex-end; justify-content: center; + justify-self: center; gap: 0.375rem; - margin-top: 0.75rem; - width: 100%; + margin-top: 0.25rem; + width: 6.6875rem; + height: 1.75rem; cursor: pointer; & > svg > path { diff --git a/src/components/ReceiptEdit/ReceiptEdit.tsx b/src/components/ReceiptEdit/ReceiptEdit.tsx index 005b443..f1fba86 100644 --- a/src/components/ReceiptEdit/ReceiptEdit.tsx +++ b/src/components/ReceiptEdit/ReceiptEdit.tsx @@ -17,7 +17,10 @@ const ReceiptEdit = () => { const { setOcrText } = useCreateReviewStore(); - const [formData, setFormData] = useState<{ [key: string]: string }[]>([]); + const [formData, setFormData] = useState<{ [key: string]: string }[]>([ + { test: "abc" }, + { test2: "aadsasf" }, + ]); const [focusState, setFocusState] = useState<{ [key: string]: boolean }>({}); useEffect(() => { diff --git a/src/components/ReviewResult/ReviewResult.module.scss b/src/components/ReviewResult/ReviewResult.module.scss index 24b5190..7accca6 100644 --- a/src/components/ReviewResult/ReviewResult.module.scss +++ b/src/components/ReviewResult/ReviewResult.module.scss @@ -1,7 +1,6 @@ .ReviewResult { - padding: 1.25rem; - padding-bottom: 2.5rem; - height: calc(100vh - 2.75rem); + padding: 3.75rem 1.25rem 2.5rem; + height: 100vh; overflow: hidden; position: relative; display: flex; diff --git a/src/components/SelectStyle/SelectStyle.tsx b/src/components/SelectStyle/SelectStyle.tsx index eb89f9d..bc9de02 100644 --- a/src/components/SelectStyle/SelectStyle.tsx +++ b/src/components/SelectStyle/SelectStyle.tsx @@ -20,15 +20,15 @@ interface StyleProps { } const IMG_STYLE_DATA = [ - { name: "친절한 미식가", image: "/assets/img/img-style-friendly.png" }, - { name: "믿음직한 미식가", image: "/assets/img/img-style-trust.png" }, - { name: "귀여운 미식가", image: "/assets/img/img-style-cute.png" }, + { name: "친근한 말투", image: "/assets/img/img-style-friendly.png" }, + { name: "믿음직한 말투", image: "/assets/img/img-style-trust.png" }, + { name: "유쾌한 말투", image: "/assets/img/img-style-cute.png" }, ]; const STYLE_NAME_MAPPING: { [key: string]: string } = { - "친절한 미식가": "FRIENDLY", - "귀여운 미식가": "CUTE", - "믿음직한 미식가": "PROFESSIONAL", + "친근한 말투": "FRIENDLY", + "유쾌한 말투": "CUTE", + "믿음직한 말투": "PROFESSIONAL", }; const SelectStyle = () => { @@ -72,11 +72,11 @@ const SelectStyle = () => { return (
- - 나는 어떤 미식가인가요? + + 어떤 말투로 작성할까요? - 선택지에 따라 리뷰 어조가 달라져요 + 선택지에 따라 리뷰 말투가 달라져요
diff --git a/src/components/SelectTag/SelectTag.module.scss b/src/components/SelectTag/SelectTag.module.scss index 0342d81..16a0eda 100644 --- a/src/components/SelectTag/SelectTag.module.scss +++ b/src/components/SelectTag/SelectTag.module.scss @@ -36,7 +36,7 @@ display: flex; flex-wrap: wrap; gap: 0.625rem; - margin-top: 2.5rem; + margin-top: 1.5rem; } } diff --git a/src/components/SelectTag/SelectTag.tsx b/src/components/SelectTag/SelectTag.tsx index 606cb3f..3733a60 100644 --- a/src/components/SelectTag/SelectTag.tsx +++ b/src/components/SelectTag/SelectTag.tsx @@ -87,6 +87,7 @@ const SelectTag = () => { diff --git a/src/components/SelectTag/TagSheet/TagSheet.module.scss b/src/components/SelectTag/TagSheet/TagSheet.module.scss index 5bad5c9..1e67aeb 100644 --- a/src/components/SelectTag/TagSheet/TagSheet.module.scss +++ b/src/components/SelectTag/TagSheet/TagSheet.module.scss @@ -51,6 +51,7 @@ .LengthText { display: flex; margin-top: 0.625rem; + font-family: "Pretendard", sans-serif; } @keyframes slide-in-from-bottom { diff --git a/src/components/SelectTag/TagSheet/TagSheet.tsx b/src/components/SelectTag/TagSheet/TagSheet.tsx index 86d4050..9d48911 100644 --- a/src/components/SelectTag/TagSheet/TagSheet.tsx +++ b/src/components/SelectTag/TagSheet/TagSheet.tsx @@ -15,16 +15,19 @@ import { useFocus } from "@/hooks/common/useFocus"; interface TagSheetProps { isOpen: boolean; + tagList: string[]; handleClose: () => void; handleTagAdd: (newTag: string) => void; } -const TagSheet = ({ isOpen, handleClose, handleTagAdd }: TagSheetProps) => { +const TagSheet = ({ isOpen, tagList, handleClose, handleTagAdd }: TagSheetProps) => { const { isFocus, onFocus, onBlur } = useFocus({ defaultFocus: true }); const [newTag, setNewTag] = useState(""); - const isInputError = newTag.length > 20; + const modalRef = useRef(null); + + const isInputError = newTag.length > 20 || tagList.includes(newTag); const isInputEmpty = newTag.length === 0; useEffect(() => { @@ -37,7 +40,12 @@ const TagSheet = ({ isOpen, handleClose, handleTagAdd }: TagSheetProps) => { setNewTag(e.target.value); }; - const modalRef = useRef(null); + const handleAddTag = () => { + if (!isInputError) { + handleTagAdd(newTag); + setNewTag(""); + } + }; useOnClickOutside(modalRef, handleClose); @@ -78,7 +86,7 @@ const TagSheet = ({ isOpen, handleClose, handleTagAdd }: TagSheetProps) => {
{isInputError ? ( - *20글자 이내로 입력할 수 있어요. + *{newTag.length > 20 ? "20글자 이내로 입력할 수 있어요." : "이미 있는 키워드에요."} ) : ( <> @@ -95,11 +103,7 @@ const TagSheet = ({ isOpen, handleClose, handleTagAdd }: TagSheetProps) => { )}
- ); diff --git a/src/components/ui/IconButton/IconButton.module.scss b/src/components/ui/IconButton/IconButton.module.scss index b135f57..cad698d 100644 --- a/src/components/ui/IconButton/IconButton.module.scss +++ b/src/components/ui/IconButton/IconButton.module.scss @@ -13,7 +13,7 @@ } &.size-sm { - gap: 0.125rem; + gap: 0.25rem; height: 2.375rem; padding: 0.5rem 0.875rem; background-color: var(--color-text-primary); diff --git a/src/components/ui/Input/Input.module.scss b/src/components/ui/Input/Input.module.scss index 6394df4..b974222 100644 --- a/src/components/ui/Input/Input.module.scss +++ b/src/components/ui/Input/Input.module.scss @@ -1,30 +1,46 @@ @use "@/styles/_mixins.scss" as *; .InputWrapper { + position: relative; + display: flex; + align-items: center; + + button { + position: absolute; + right: 0.875rem; + color: var(--color-primary-purple); + line-height: 1.3125rem; + + @include bodySm; + } +} + +.Input { width: 100%; height: 3rem; border-radius: 0.875rem; padding: 0.75rem 0.875rem; border: 1px solid transparent; - display: flex; - align-items: center; - gap: 0.625rem; + color: var(--color-text-primary); + line-height: 1.5rem; + + @include bodyM; + + &::placeholder { + color: var(--color-text-tertiary); + } &.style-primary { background-color: var(--color-white); box-shadow: 0 0.125rem 1rem rgba(0, 0, 0, 0.04); - - & > input { - width: calc(100% - 2.25rem); - } } &.style-secondary { background-color: var(--color-gray100); + } - & > input { - width: 100%; - } + &:focus { + border-color: var(--color-primary-purple); } &.Focused { @@ -34,22 +50,6 @@ &.Error { border-color: var(--color-text-error); } - - .Input { - @include bodyM; - color: var(--color-text-primary); - line-height: 1.5rem; - - &::placeholder { - color: var(--color-text-tertiary); - } - } - - button { - @include bodySm; - color: var(--color-primary-purple); - line-height: 1.3125rem; - } } .InputStory { diff --git a/src/components/ui/Input/Input.tsx b/src/components/ui/Input/Input.tsx index 52cc319..854bf31 100644 --- a/src/components/ui/Input/Input.tsx +++ b/src/components/ui/Input/Input.tsx @@ -1,4 +1,4 @@ -import { forwardRef } from "react"; +import { forwardRef, useEffect, useState } from "react"; import classNames from "classnames"; @@ -6,20 +6,43 @@ import styles from "@/components/ui/Input/Input.module.scss"; import type { InputProps } from "@/components/ui/Input/Input.types"; const Input = forwardRef( - ({ className, type, variant = "primary", isFocus, isError, ...props }, ref) => { + ({ className, type, variant = "primary", onFocus, isFocus, onBlur, isError, ...props }, ref) => { + const [focused, setFocused] = useState(isFocus || false); + + const inputRef = ref as React.RefObject; + + const handleFocus = (e: React.FocusEvent) => { + setFocused(true); + onFocus && onFocus(e); + }; + + const handleBlur = (e: React.FocusEvent) => { + setFocused(false); + onBlur && onBlur(e); + }; + + useEffect(() => { + if (isFocus !== undefined) { + setFocused(isFocus); + } + }, [isFocus]); + return ( -
- +
+ {variant === "primary" && }
); diff --git a/src/components/ui/Text/Text.module.scss b/src/components/ui/Text/Text.module.scss index 4cec6b0..e3442af 100644 --- a/src/components/ui/Text/Text.module.scss +++ b/src/components/ui/Text/Text.module.scss @@ -4,7 +4,17 @@ line-height: 1.5; @each $color-name - in ("white", "black", "primary", "secondary", "tertiary", "quarternary", "gradient", "error") + in ( + "white", + "black", + "primary", + "secondary", + "tertiary", + "quarternary", + "gradient", + "error", + "purpleGradient" + ) { @if $color-name == "gradient" { &.color-#{$color-name} { @@ -13,6 +23,13 @@ background-clip: text; -webkit-text-fill-color: transparent; } + } @else if $color-name == "purpleGradient" { + &.color-#{$color-name} { + background: var(--color-text-purpleGradient); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; + } } @else { &.color-#{$color-name} { color: var(--color-text-#{$color-name}); diff --git a/src/components/ui/Text/Text.types.ts b/src/components/ui/Text/Text.types.ts index 8b7120c..b831c88 100644 --- a/src/components/ui/Text/Text.types.ts +++ b/src/components/ui/Text/Text.types.ts @@ -20,7 +20,8 @@ type TextColor = | "tertiary" | "quarternary" | "gradient" - | "error"; + | "error" + | "purpleGradient"; export interface TextProps extends React.HTMLAttributes { as?: React.ElementType; diff --git a/src/components/ui/Toast/Toast.module.scss b/src/components/ui/Toast/Toast.module.scss index 52576ab..578449f 100644 --- a/src/components/ui/Toast/Toast.module.scss +++ b/src/components/ui/Toast/Toast.module.scss @@ -27,7 +27,6 @@ background-color: white; padding: 0.875rem 1.125rem; - transform: translateY(-20px); transition: opacity 0.3s, transform 0.3s; diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index b1dd408..4d43dc4 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -2,22 +2,14 @@ import Navbar from "@/components/common/Navbar/Navbar"; import Home from "@/components/Home/Home"; import { AppBridgeMessageType } from "@/components/provider/AppBridgeProvider/AppBridgeMessage.types"; import { useAppBridge } from "@/components/provider/AppBridgeProvider/AppBridgeProvider"; -import Icon from "@/components/ui/Icon/Icon"; import Text from "@/components/ui/Text/Text"; -import { useRoute } from "@/hooks/common/useRoute"; - const HomePage = () => { const { send } = useAppBridge(); - const { navigateToHome } = useRoute(); - return ( <> - - - send({ type: AppBridgeMessageType.SHARE, payload: "" })}> 앱 공유하기 diff --git a/src/pages/ReceiptEditPage.tsx b/src/pages/ReceiptEditPage.tsx index 7251cc6..c0d0817 100644 --- a/src/pages/ReceiptEditPage.tsx +++ b/src/pages/ReceiptEditPage.tsx @@ -5,7 +5,6 @@ import Icon from "@/components/ui/Icon/Icon"; import { useRoute } from "@/hooks/common/useRoute"; const ReceiptEditPage = () => { - // 이후 영수증 인식 네이티브 라우팅으로 변경 const { navigateToHome } = useRoute(); return ( diff --git a/src/pages/ReviewResultPage.tsx b/src/pages/ReviewResultPage.tsx index 148008c..cffc64d 100644 --- a/src/pages/ReviewResultPage.tsx +++ b/src/pages/ReviewResultPage.tsx @@ -1,16 +1,10 @@ import { useEffect, useState } from "react"; -import Navbar from "@/components/common/Navbar/Navbar"; import CreateReviewLoading from "@/components/CreateReviewLoading/CreateReviewLoading"; import ReviewResult from "@/components/ReviewResult/ReviewResult"; -import Icon from "@/components/ui/Icon/Icon"; - -import { useRoute } from "@/hooks/common/useRoute"; // 로딩 코드 api 연결 후 삭제 export default function ReviewResultPage() { - const { navigateToBack } = useRoute(); - const [isLoading, setIsLoading] = useState(true); useEffect(() => { @@ -25,18 +19,5 @@ export default function ReviewResultPage() { return ; } - return ( - <> - {!isLoading && ( - <> - - - - - - - - )} - - ); + return <>{!isLoading && }; } diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss index 4603c72..d0c9898 100644 --- a/src/styles/_variables.scss +++ b/src/styles/_variables.scss @@ -24,6 +24,11 @@ var(--color-primary-purple) ); --color-text-error: #d45085; + --color-text-purpleGradient: radial-gradient( + circle, + var(--color-primary-purple), + var(--color-gray600) + ); --color-white: #ffffff; --color-black: #000000; diff --git a/src/styles/global.scss b/src/styles/global.scss index 01a5b27..852b28b 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -1,3 +1,39 @@ +@font-face { + font-family: "Pretendard"; + src: + url("/fonts/woff2/Pretendard-Regular.woff2") format("woff2"), + url("/fonts/woff/Pretendard-Regular.woff") format("woff"); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Pretendard"; + src: + url("/fonts/woff2/Pretendard-Medium.woff2") format("woff2"), + url("/fonts/woff/Pretendard-Medium.woff") format("woff"); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: "Pretendard"; + src: + url("/fonts/woff2/Pretendard-SemiBold.woff2") format("woff2"), + url("/fonts/woff/Pretendard-SemiBold.woff") format("woff"); + font-weight: 600; + font-style: normal; +} + +@font-face { + font-family: "Pretendard"; + src: + url("/fonts/woff2/Pretendard-Bold.woff2") format("woff2"), + url("/fonts/woff/Pretendard-Bold.woff") format("woff"); + font-weight: 700; + font-style: normal; +} + * { font-family: "Pretendard", sans-serif; padding: 0;