Skip to content

Commit

Permalink
Chore: 파일명 및 폴더명 변경 (#58)
Browse files Browse the repository at this point in the history
* chore: 폴더 위치 변경

* chore:파일명 변경

* chore:변수명 변경

* fix: 빌드 오류 해결
  • Loading branch information
aazkgh authored Sep 25, 2024
1 parent dbdd134 commit e9c0988
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 32 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserDataProps } from '@/types/type';
import { UserDataResponse } from '@/types/userAPI';
import { unitripSupabase } from '@/utils/supabaseClient';

const getUserData = async (kakaoId: number) => {
Expand All @@ -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;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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[];
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/types/type.ts → src/types/userAPI.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
31 changes: 15 additions & 16 deletions src/views/Detail/components/review/ReviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement>(null);

// 5.25rem
// 63
useEffect(() => {
if (
descriptionRef.current &&
descriptionRef.current?.scrollHeight >
descriptionRef.current?.offsetHeight
descriptionRef.current?.offsetHeight
) {
setIsMoreButton(true);
}
Expand Down Expand Up @@ -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`
Expand All @@ -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};
Expand All @@ -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};
Expand All @@ -128,44 +130,41 @@ 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;
}
`;

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};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

const CategoryBottomSheet = () => {
return <></>;
};
Expand Down
2 changes: 1 addition & 1 deletion src/views/Detail/components/review/write/Description.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@emotion/react';
import React, { ReactNode } from 'react';
import { ReactNode } from 'react';

import { COLORS, FONTS } from '@/styles/constants';

Expand Down
2 changes: 1 addition & 1 deletion src/views/Login/components/LoginCallBack.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import usePostKakaoLogin from '../../../api/usePostKakaoLogin';
import usePostKakaoLogin from '../../../apis/usePostKakaoLogin';

const LoginCallBack = () => {
usePostKakaoLogin();
Expand Down
6 changes: 3 additions & 3 deletions src/views/Login/components/UserType.tsx
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
6 changes: 3 additions & 3 deletions src/views/Main/pages/MainPage.tsx
Original file line number Diff line number Diff line change
@@ -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<UserDataProps | null>(null);
const [userData, setUserData] = useState<UserDataResponse | null>(null);

const isLoggedIn = sessionStorage.getItem('kakao_id');

Expand Down

0 comments on commit e9c0988

Please sign in to comment.