diff --git a/src/api/getKaKaoInfo.ts b/src/apis/getKaKaoInfo.ts similarity index 100% rename from src/api/getKaKaoInfo.ts rename to src/apis/getKaKaoInfo.ts diff --git a/src/api/supabase/fetchSupabaseLogin.ts b/src/apis/supabase/fetchSupabaseLogin.ts similarity index 100% rename from src/api/supabase/fetchSupabaseLogin.ts rename to src/apis/supabase/fetchSupabaseLogin.ts diff --git a/src/api/supabase/useGetUserData.ts b/src/apis/supabase/getUserData.ts similarity index 82% rename from src/api/supabase/useGetUserData.ts rename to src/apis/supabase/getUserData.ts index 1709231..e4dd853 100644 --- a/src/api/supabase/useGetUserData.ts +++ b/src/apis/supabase/getUserData.ts @@ -1,4 +1,4 @@ -import { UserDataProps } from '@/types/type'; +import { UserDataResponse } from '@/types/userAPI'; import { unitripSupabase } from '@/utils/supabaseClient'; const getUserData = async (kakaoId: number) => { @@ -13,7 +13,7 @@ const getUserData = async (kakaoId: number) => { /* kakao_id에 해당하는 행이 존재하는지 확인 */ if (data.length) { - const response: UserDataProps = data[0]; + const response: UserDataResponse = data[0]; return response; } else { return null; diff --git a/src/api/supabase/getUserExistence.ts b/src/apis/supabase/getUserExistence.ts similarity index 100% rename from src/api/supabase/getUserExistence.ts rename to src/apis/supabase/getUserExistence.ts diff --git a/src/api/supabase/postAddUser.ts b/src/apis/supabase/postAddUser.ts similarity index 89% rename from src/api/supabase/postAddUser.ts rename to src/apis/supabase/postAddUser.ts index 94fe049..4b11ed3 100644 --- a/src/api/supabase/postAddUser.ts +++ b/src/apis/supabase/postAddUser.ts @@ -1,9 +1,9 @@ import { Region } from '@/components/SelectRegion'; -import { KakaoUserDataProps } from '@/types/type'; +import { KakaoUserDataResponse } from '@/types/userAPI'; import { unitripSupabase } from '@/utils/supabaseClient'; interface AddUserProps { - userData: KakaoUserDataProps; + userData: KakaoUserDataResponse; region: Region; travelerType: string[]; } diff --git a/src/api/usePostKakaoLogin.ts b/src/apis/usePostKakaoLogin.ts similarity index 100% rename from src/api/usePostKakaoLogin.ts rename to src/apis/usePostKakaoLogin.ts diff --git a/src/types/type.ts b/src/types/userAPI.ts similarity index 67% rename from src/types/type.ts rename to src/types/userAPI.ts index 9d112e1..338ffad 100644 --- a/src/types/type.ts +++ b/src/types/userAPI.ts @@ -1,11 +1,11 @@ -export interface UserDataProps { +export interface UserDataResponse { name: string; region: string; universal_type: string[]; favorite_list: number[]; } -export interface KakaoUserDataProps { +export interface KakaoUserDataResponse { id: number; nickname: string; thumbnail_image_url: string; diff --git a/src/views/Detail/components/review/ReviewCard.tsx b/src/views/Detail/components/review/ReviewCard.tsx index 0a729c9..9304508 100644 --- a/src/views/Detail/components/review/ReviewCard.tsx +++ b/src/views/Detail/components/review/ReviewCard.tsx @@ -18,14 +18,15 @@ const ReviewCard = (props: ReviewCardProps) => { const [showAll, setShowAll] = useState(false); const [isMoreButton, setIsMoreButton] = useState(false); - const descriptionRef = useRef(null); + const descriptionRef = useRef(null); // 5.25rem // 63 useEffect(() => { if ( + descriptionRef.current && descriptionRef.current?.scrollHeight > - descriptionRef.current?.offsetHeight + descriptionRef.current?.offsetHeight ) { setIsMoreButton(true); } @@ -72,9 +73,10 @@ export default ReviewCard; const containerCss = css` padding-bottom: 2rem; + border: 1px solid rgb(245 245 245 / 50%); border-radius: 2rem; - border; 1px solid rgba(245, 245, 245, 0.5); - box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.04); + + box-shadow: 0 4px 20px 0 rgb(0 0 0 / 4%); `; const contentContainerCss = css` @@ -88,9 +90,8 @@ const authorCss = css` const startContainerCss = css` display: flex; - align-items: center; - gap: 0.4rem; + align-items: center; color: ${COLORS.brand1}; ${FONTS.Small1}; @@ -109,16 +110,17 @@ const categoryCss = css` `; const contentCss = (showAll: boolean) => css` - position: relative; - display: -webkit-box; + position: relative; word-wrap: break-word; -webkit-line-clamp: ${showAll ? 'none' : 4}; -webkit-box-orient: vertical; text-overflow: ellipsis; + overflow: hidden; word-break: keep-all; + margin-top: 1.6rem; color: ${COLORS.brand1}; @@ -128,15 +130,14 @@ const contentCss = (showAll: boolean) => css` const imgContainerCss = css` display: flex; gap: 0.5rem; + overflow: auto; width: 100%; padding: 0 2rem; - overflow: auto; & > img { width: 12.3rem; height: 12.3rem; - border-radius: 1.1rem; } `; @@ -144,28 +145,26 @@ const imgContainerCss = css` const dateCss = css` margin: 1.6rem 0 0 2rem; + color: ${COLORS.gray4}; font-family: 'Apple SD Gothic Neo', sans-serif; font-style: normal; font-size: 1.4rem; font-weight: 400; line-height: 140%; - - color: ${COLORS.gray4}; `; const moreContentCss = css` display: flex; - position: absolute; - bottom: 0; right: 0; + bottom: 0; padding-left: 20px; background: linear-gradient( 90deg, - rgba(255, 255, 255, 0) 0%, - rgba(255, 255, 255, 1) 18% + rgb(255 255 255 / 0%) 0%, + rgb(255 255 255 / 100%) 18% ); color: ${COLORS.brand1}; diff --git a/src/views/Detail/components/review/write/CategoryBottomSheet.tsx b/src/views/Detail/components/review/write/CategoryBottomSheet.tsx index c1ac3c7..1b73cbd 100644 --- a/src/views/Detail/components/review/write/CategoryBottomSheet.tsx +++ b/src/views/Detail/components/review/write/CategoryBottomSheet.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - const CategoryBottomSheet = () => { return <>; }; diff --git a/src/views/Detail/components/review/write/Description.tsx b/src/views/Detail/components/review/write/Description.tsx index fc229ce..741d4a5 100644 --- a/src/views/Detail/components/review/write/Description.tsx +++ b/src/views/Detail/components/review/write/Description.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import React, { ReactNode } from 'react'; +import { ReactNode } from 'react'; import { COLORS, FONTS } from '@/styles/constants'; diff --git a/src/views/Login/components/LoginCallBack.tsx b/src/views/Login/components/LoginCallBack.tsx index ea24c1e..ad93b7d 100644 --- a/src/views/Login/components/LoginCallBack.tsx +++ b/src/views/Login/components/LoginCallBack.tsx @@ -1,4 +1,4 @@ -import usePostKakaoLogin from '../../../api/usePostKakaoLogin'; +import usePostKakaoLogin from '../../../apis/usePostKakaoLogin'; const LoginCallBack = () => { usePostKakaoLogin(); diff --git a/src/views/Login/components/UserType.tsx b/src/views/Login/components/UserType.tsx index 634cd28..c49fe7b 100644 --- a/src/views/Login/components/UserType.tsx +++ b/src/views/Login/components/UserType.tsx @@ -1,16 +1,16 @@ import { css } from '@emotion/react'; import { useNavigate } from 'react-router-dom'; -import postAddUser from '@/api/supabase/postAddUser'; +import postAddUser from '@/apis/supabase/postAddUser'; import BottomButton from '@/components/BottomButton'; import TravelerType from '@/components/TravelerType'; import { COLORS, FONTS } from '@/styles/constants'; -import { KakaoUserDataProps } from '@/types/type'; +import { KakaoUserDataResponse } from '@/types/userAPI'; import { useSignUpContext } from './SignUpContext'; interface UserTypeProps { - userData: KakaoUserDataProps; + userData: KakaoUserDataResponse; } const UserType = ({ userData }: UserTypeProps) => { diff --git a/src/views/Main/pages/MainPage.tsx b/src/views/Main/pages/MainPage.tsx index bc92439..1cbff82 100644 --- a/src/views/Main/pages/MainPage.tsx +++ b/src/views/Main/pages/MainPage.tsx @@ -1,17 +1,17 @@ import { css } from '@emotion/react'; import { useEffect, useState } from 'react'; -import getUserData from '@/api/supabase/useGetUserData'; +import getUserData from '@/apis/supabase/getUserData'; import MenuBar from '@/components/MenuBar'; import { COLORS, FONTS } from '@/styles/constants'; -import { UserDataProps } from '@/types/type'; +import { UserDataResponse } from '@/types/userAPI'; import Header from '../components/Header'; import NearbyTravel from '../components/NearbyTravel'; import RecommendedTravel from '../components/RecommendedTravel'; const MainPage = () => { - const [userData, setUserData] = useState(null); + const [userData, setUserData] = useState(null); const isLoggedIn = sessionStorage.getItem('kakao_id');