Skip to content

Commit

Permalink
Merge pull request #123 from KUIT-Space/feat#96-space-home
Browse files Browse the repository at this point in the history
Feat#96 space home
  • Loading branch information
YangJJune authored Aug 20, 2024
2 parents acb6ed0 + 76abc83 commit 9b5a74a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
13 changes: 5 additions & 8 deletions src/pages/PayPage/MyRequestPayPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ const MyRequestPayPage = () => {
{ name: "๋ฏธ์ •์‚ฐ", content: "Tab menu ONE" },
{ name: "์ •์‚ฐ์™„๋ฃŒ", content: "Tab menu TWO" },
];
const dataArr = [
{ image: "aa", name: "๋ฐ•๊ทœํ™˜", amount: "15000์›", chk: true },
{ image: "aa", name: "๋ฐ•๊ทœํ™˜", amount: "15000์›", chk: true },
];
const selectMenuHandler = (index: number) => {
setTabIndex(index);
};
Expand All @@ -53,13 +49,14 @@ const MyRequestPayPage = () => {
if (detailData.payTargetInfoDtoList !== undefined) {
detailData.payTargetInfoDtoList.map((value, index) => {
{
value.isComplete
value.complete
? setCompleteTargetList((activeVrList) => [...(activeVrList || []), value])
: setInCompleteTargetList((inactiveVrList) => [...(inactiveVrList || []), value]);
}
});
}
}
console.log(detailData);
}, [detailData]);

useEffect(() => {
Expand Down Expand Up @@ -125,7 +122,7 @@ const MyRequestPayPage = () => {
<s.AllPriceDiv> / {totalAmount}์›</s.AllPriceDiv>
</s.RowFlexDiv>
{/* TODO date */}
<s.GrayTextDiv>์š”์ฒญ ๋‚ ์งœ 2024.06.12</s.GrayTextDiv>
<s.GrayTextDiv>์š”์ฒญ ๋‚ ์งœ 2024.08.20</s.GrayTextDiv>
</s.CompletePayDiv>
<s.TabMenu>
{menuArr.map((value, index) => (
Expand All @@ -142,7 +139,7 @@ const MyRequestPayPage = () => {
<s.RoundDiv style={{ margin: "0.75rem 1.25rem 0.75rem 1.25rem" }}>
{completeTargetList.length === 0 ? (
<>
<s.NoAlertDiv>๋ฏธ์ •์‚ฐ ๋œ ์œ ์ €๊ฐ€ ์—†์–ด์š”!</s.NoAlertDiv>
<s.NoAlertDiv>์ •์‚ฐ์™„๋ฃŒ ๋œ ์œ ์ €๊ฐ€ ์—†์–ด์š”!</s.NoAlertDiv>
</>
) : (
<>
Expand All @@ -156,7 +153,7 @@ const MyRequestPayPage = () => {
<s.RoundDiv style={{ margin: "0.75rem 1.25rem 0.75rem 1.25rem" }}>
{inCompleteTargetList.length === 0 ? (
<>
<s.NoAlertDiv>์ •์‚ฐ์™„๋ฃŒ ๋œ ์œ ์ €๊ฐ€ ์—†์–ด์š”!</s.NoAlertDiv>
<s.NoAlertDiv>๋ฏธ์ •์‚ฐ ๋œ ์œ ์ €๊ฐ€ ์—†์–ด์š”!</s.NoAlertDiv>
</>
) : (
<>
Expand Down
5 changes: 2 additions & 3 deletions src/pages/PayPage/PayPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export type payTargetInfoDtoList = {
targetUserName: string;
targetUserProfileImg: string;
requestAmount: number;
isComplete: boolean;
complete: boolean;
};
const PayRequestInfo = ({ data }: { data: PayRequestInfo }) => {
const res: number = data.totalTargetNum - data.receiveTargetNum;
Expand Down Expand Up @@ -79,8 +79,7 @@ const PayPage = () => {
// RequestPayInfo(setReqData, setRecData);
}, [reqData]);
useEffect(() => {
// const str = localStorage.getItem("SpaceId");
const str = "3";
const str = localStorage.getItem("spaceId");

if (str !== null) {
const SpaceID = Number.parseInt(str);
Expand Down
9 changes: 5 additions & 4 deletions src/pages/PayPage/PayResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import * as s from "@/pages/PayPage/PayPage.styled";
import bell from "@/assets/PayPage/bell.svg";
import check from "@/assets/PayPage/check.svg";
import ReactImg from "@/assets/react.svg";
import { payTargetInfoDtoList } from "./PayPage";
import { addComma, payTargetInfoDtoList } from "./PayPage";
import { getUserDefaultImageURL } from "@/utils/getUserDefaultImageURL";

const PayResult = ({ props }: { props: payTargetInfoDtoList }) => {
const price = addComma(props.requestAmount);
return (
<s.RowFlexDiv style={{ alignItems: "center", padding: "0.25rem" }}>
<img
Expand All @@ -17,12 +18,12 @@ const PayResult = ({ props }: { props: payTargetInfoDtoList }) => {
width={"40px"}
height={"40px"}
></img>
<s.ColumnFlexDiv style={{ marginLeft: "0.75rem", justifyContent: "left" }}>
<s.ColumnFlexDiv style={{ marginLeft: "0.75rem", justifyContent: "start" }}>
<s.TextDiv>{props.targetUserName}</s.TextDiv>
<s.BoldText>{props.requestAmount}</s.BoldText>
<s.BoldText style={{ textAlign: "start" }}>{price}์›</s.BoldText>
</s.ColumnFlexDiv>
<img
src={props.isComplete ? check : bell}
src={props.complete ? check : bell}
width={"36px"}
height={"36px"}
style={{ marginLeft: "auto" }}
Expand Down
7 changes: 6 additions & 1 deletion src/pages/PayPage/RequestedPayPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ const RequestedPayPage = () => {
const [currentData, setCurrentData] = useState<PayReceiveInfo[] | undefined>([]);
const [completeData, setCompleteData] = useState<PayReceiveInfo[] | undefined>([]);
useEffect(() => {
payReceiveApi(3, setCurrentData, setCompleteData);
const str = localStorage.getItem("spaceId");

if (str !== null) {
const spaceId = Number.parseInt(str);
payReceiveApi(spaceId, setCurrentData, setCompleteData);
}
}, []);
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SpacePage/SpacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const SpacePage = () => {

useEffect(() => {
//TODO : ์ž„์‹œ๋กœ ์ดˆ๋Œ€๋ฐ›์€ ์ŠคํŽ˜์ด์Šค๋ฅผ ๋ฐฐ์—ด์— ์ถ”๊ฐ€ (ex. spaceId: 3, 6, 9)
const tempInviteSpace = [3, 6, 9, 11];
const tempInviteSpace = [3, 202];
Promise.all(
tempInviteSpace.map(async (spaceId) => {
let spaceInfo: SpaceInfo = {
Expand Down
6 changes: 5 additions & 1 deletion src/pages/VoiceRoomPage/VoiceRoomListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ const VoiceRoomListPage = () => {
}, []);

useEffect(() => {
filterVrList();
if (vrList?.length !== 0) {
filterVrList();
} else {
setIsLoading(false);
}
}, [vrList]);

useEffect(() => {
Expand Down

0 comments on commit 9b5a74a

Please sign in to comment.