= ({ selectedRole }) => {
- const statusList = useSuspenseQuery({
- queryKey: [API_GET_PARTY_STATUS_KEY, { role: selectedRole }],
- queryFn: () => getPartyStatus({ role: selectedRole }),
- });
- if (!statusList.data.length) {
- return (
-
-
-
- );
- }
- return statusList.data.map((status) => );
-};
-
-export default PartySituationItemList;
diff --git a/src/components/profile/ProfileInfo.tsx b/src/components/profile/ProfileInfo.tsx
index 29a170d..2c85610 100644
--- a/src/components/profile/ProfileInfo.tsx
+++ b/src/components/profile/ProfileInfo.tsx
@@ -1,117 +1,114 @@
-import React from "react";
-import styled from "@emotion/styled";
-import Progressbar from "@components/common/ProgressBar";
-import Image from "next/image";
-import { DefaultText } from "@components/common/DefaultText";
-import GenderIcon from "@components/icons/profile/Gender.icon";
-import InfoIcon from "@components/icons/profile/Info.icon";
-import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
-import { API_GET_PROFILE_KEY } from "src/api/getProfile";
-import getProfile from "src/api/getProfile";
-import { PARTY_GENDER_LABEL } from "src/constants/options";
-import { labelDataConvert } from "@utils/labelDataConvert";
+import React, { useMemo } from 'react';
+import styled from '@emotion/styled';
+import Progressbar from '@components/common/ProgressBar';
+import Image from 'next/image';
+import { DefaultText } from '@components/common/DefaultText';
+import GenderIcon from '@components/icons/profile/Gender.icon';
+import InfoIcon from '@components/icons/profile/Info.icon';
+import { useQuery, useSuspenseQuery } from '@tanstack/react-query';
+import { API_GET_PROFILE_KEY } from 'src/api/getProfile';
+import getProfile from 'src/api/getProfile';
+import { PARTY_GENDER_LABEL } from 'src/constants/options';
+import { labelDataConvert } from '@utils/labelDataConvert';
const Container = styled.div`
- display: flex;
- width: 100%;
- flex-direction: column;
- padding-bottom: 20px;
- background-color: white;
+ display: flex;
+ width: 100%;
+ flex-direction: column;
+ padding-bottom: 20px;
+ background-color: white;
`;
const ProfileImgContainer = styled.div`
- width: 200px;
- display: flex;
- justify-content: center;
- align-items: center;
+ width: 200px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
`;
const ProfileDetailContainer = styled.div`
- width: 200px;
- display: flex;
- width: 100%;
- flex-direction: row;
- padding: 20px 0;
- z-index: 99;
- background-color: white;
+ width: 200px;
+ display: flex;
+ width: 100%;
+ flex-direction: row;
+ padding: 20px 0;
+ z-index: 99;
+ background-color: white;
`;
const MannerDegreeContainer = styled.div`
- display: flex;
- flex-direction: row;
- gap: 16px;
- align-items: center;
+ display: flex;
+ flex-direction: row;
+ gap: 16px;
+ align-items: center;
`;
const UserInfo = styled.div`
- display: flex;
- flex-direction: row;
- align-items: center;
- gap: 8px;
- margin-bottom: 8px;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ gap: 8px;
+ margin-bottom: 8px;
`;
const Name = styled.div`
- margin-bottom: 16px;
+ margin-bottom: 16px;
`;
const ProfileDetail = styled.div`
- display: flex;
- flex-direction: column;
- justify-content: center;
- width: 60%;
- padding: 20px;
- gap: 8px;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ width: 60%;
+ padding: 20px;
+ gap: 8px;
`;
-const userId = 11;
-// 로그인 기능 연결후 userid 받아올 예정
-
const ProfileInfo = () => {
- const { data } = useSuspenseQuery({
- queryKey: [API_GET_PROFILE_KEY],
- queryFn: () => getProfile(),
- });
+ const { data } = useSuspenseQuery({
+ queryKey: [API_GET_PROFILE_KEY],
+ queryFn: getProfile,
+ });
- if (!data) {
- return;
- }
+ const { gender, age, nickname, imgUrl, negativeReviewCount, positiveReviewCount } = data;
- const { gender, age, socialType, nickname, imgUrl } = data;
+ const mannerDegree = useMemo(() => {
+ const basicDegree = 36.5;
+ return basicDegree + (negativeReviewCount * -0.5 + positiveReviewCount * 0.5);
+ }, [negativeReviewCount, positiveReviewCount]);
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {30}°C
- {/* 매너온도는 후기기능에 포함되어 보류 */}
-
-
-
-
- );
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {mannerDegree}°C
+
+
+
+
+ );
};
export default ProfileInfo;
diff --git a/src/components/profile/ProfileTab.tsx b/src/components/profile/ProfileTab.tsx
index da4b23d..a209254 100644
--- a/src/components/profile/ProfileTab.tsx
+++ b/src/components/profile/ProfileTab.tsx
@@ -2,11 +2,11 @@ import styled from '@emotion/styled';
import { useRouter } from 'next/router';
import { useMemo } from 'react';
import { useSearchParam } from 'react-use';
-import PartySituation from './PartySituation';
+import PartySituation from './party/status/PartySituation';
import TabComponent from './TabComponent';
-import PartyRequest from './PartyRequest';
-import ReviewList from './ProfileReviewList';
-import ProfileReviewList from './ProfileReviewList';
+import PartyRequest from './party/request/PartyRequest';
+import ReviewList from './review/ProfileReviewList';
+import ProfileReviewList from './review/ProfileReviewList';
interface CategoryItemType {
id: CategoryIdType;
@@ -78,7 +78,7 @@ const ProfileTab = () => {
replace({ query: { category: id, role: 'SENDER' } });
return;
}
- replace({ query: { category: id, role: 'HOST' } });
+ replace({ query: { category: id, role: 'VOLUNTEER', status: 'RECRUIT' } });
};
return (
diff --git a/src/components/profile/ProfileTabPanel.tsx b/src/components/profile/ProfileTabPanel.tsx
deleted file mode 100644
index d8cc737..0000000
--- a/src/components/profile/ProfileTabPanel.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import Box from "@mui/material/Box";
-import QuerySuspenseErrorBoundary from "@components/hoc/QuerySuspenseErrorBoundary";
-import ProfileError from "./ProfileError";
-import ProfileLoading from "./ProfileLoading";
-
-interface TabPanelProps {
- children?: React.ReactNode;
- index: number;
- value: number;
-}
-
-const ProfileTabPanel = (props: TabPanelProps) => {
- const { children, value, index, ...other } = props;
-
- return (
- }
- >
-
- {value === index && {children}}
-
-