Skip to content

Commit

Permalink
Merge pull request #52 from KUIT-Space/feat#48-pay-home
Browse files Browse the repository at this point in the history
Feat#48 pay home
  • Loading branch information
YangJJune authored Aug 9, 2024
2 parents 0a025f6 + 1893694 commit 7521262
Show file tree
Hide file tree
Showing 25 changed files with 1,117 additions and 14 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
}
],
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-unused-vars": [ "warn" ]
},
parserOptions: {
sourceType: "module",
Expand Down
29 changes: 25 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.24.1",
"styled-components": "^6.1.11",
"react-toastify": "^10.0.5",
"styled-components": "^6.1.12",
"styled-reset": "^4.5.2",
"vite-plugin-svgr": "^4.2.0"
},
Expand Down
44 changes: 36 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import VoiceRoomListPage from "@/pages/VoiceRoomPage/VoiceRoomListPage";
import GlobalStyle from "@/styles/GlobalStyles";
import { theme } from "@/styles/Theme";

import CompletePay from "./pages/PayPage/CompletePay";
import CreateRequestPage from "./pages/PayPage/CreateRequestPage";
import MyRequestPayPage from "./pages/PayPage/MyRequestPayPage";
import RequestedPayPage from "./pages/PayPage/RequestedPayPage";
import AccountManage from "./pages/SpacePage/AccountManage";
import AddSpacePage from "./pages/SpacePage/AddSpacePage";
import AlarmManage from "./pages/SpacePage/AlarmManage";
Expand Down Expand Up @@ -81,35 +85,59 @@ function Layout({ routes_children }: { routes_children: RouteChildren[] }) {
}

function App() {
const routes_children = [
{ path: "/", element: <HomePage />, hasBottomBar: true },
{ path: "/voiceroom", element: <VoiceRoomListPage />, hasBottomBar: true },
const routes_children_chat = [
{ path: "/chat", element: <ChatPage />, hasBottomBar: true },
{ path: "/chat/:id", element: <ChattingPage /> },
{ path: "/chat/create", element: <ChatCreatePage /> },
];

const routes_children_pay = [
{ path: "/pay", element: <PayPage />, hasBottomBar: true },
{ path: "/board", element: <BoardPage />, hasBottomBar: true },
{ path: "/pay/create", element: <CreateRequestPage />, hasBottomBar: false },
{ path: "/requestingpay", element: <MyRequestPayPage />, hasBottomBar: false },
{ path: "/requestingpay/:id", element: <MyRequestPayPage />, hasBottomBar: false },
{ path: "/requestedpay", element: <RequestedPayPage />, hasBottomBar: false },
{ path: "/completepay", element: <CompletePay />, hasBottomBar: false },
];

const routes_children_voice = [
{ path: "/voiceroom", element: <VoiceRoomListPage />, hasBottomBar: true },
{ path: "/createvoiceroom", element: <CreateVoiceRoomPage />, hasBottomBar: false },
{ path: "/joinvoiceroom", element: <JoinVoiceRoomPage />, hasBottombar: false },
{ path: "/editvoiceroom", element: <EditVoiceRoomPage />, hasBottombar: false },
];

const routes_children_space = [
{ path: "/space", element: <SpacePage /> },
{ path: "/space/addspace", element: <AddSpacePage /> },
{ path: "/space/spaceoption", element: <SpaceOption /> },
{ path: "/space/spaceoption/accountmanage", element: <AccountManage /> },
{ path: "/space/spaceoption/profilemanage", element: <ProfileManage /> },
{ path: "/space/spaceoption/alarmmanage", element: <AlarmManage /> },
{ path: "/createvoiceroom", element: <CreateVoiceRoomPage />, hasBottomBar: false },
{ path: "/joinvoiceroom", element: <JoinVoiceRoomPage />, hasBottombar: false },
{ path: "/editvoiceroom", element: <EditVoiceRoomPage />, hasBottombar: false },
];

const routes_children_login = [
{ path: "/login", element: <LoginPage />, hasBottombar: false },
{ path: "/signup", element: <SignUpPage />, hasBottombar: false },
];

const routes_children = [
{ path: "/", element: <HomePage />, hasBottomBar: true },
{ path: "/board", element: <BoardPage />, hasBottomBar: true },
...routes_children_chat,
...routes_children_pay,
...routes_children_voice,
...routes_children_space,
...routes_children_login,
];

const routes = [
{
element: <Layout routes_children={routes_children} />,
children: routes_children,
},
];
const router = createBrowserRouter(routes, { basename: "/KUIT-Space-front/" });

return <RouterProvider router={router} />;
}

Expand Down
3 changes: 3 additions & 0 deletions src/assets/PayPage/arrow_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/PayPage/bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/PayPage/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/PayPage/search_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/PayPage/test_bank.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions src/pages/PayPage/CompleteCreatePay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { BottomBtn } from "@/components/BottomBtn";
import Check from "@/assets/PayPage/check.svg";
import * as s from "@/pages/PayPage/PayPage.styled";
import { useNavigate } from "react-router-dom";

const CompleteCreatePay = () => {
const navigator = useNavigate();
return (
<>
{/* ์—ฌ๊ธฐ์— ์ง€๊ธˆ height ๋„ฃ์–ด์ค˜์•ผ */}
<s.ContainerDiv>
<div style={{ display: "flex", justifyContent: "center" }}>
<img src={Check}></img>
</div>
<s.LargeTxt style={{ flex: 1, textAlign: "center" }}>
<p>์ •์‚ฐ์š”์ฒญ์„</p>
<p>์™„๋ฃŒํ–ˆ์–ด์š”!</p>
</s.LargeTxt>

<BottomBtn
onClick={() => {
navigator("/pay");
}}
>
์ •์‚ฐ ํ™ˆ์œผ๋กœ
</BottomBtn>
</s.ContainerDiv>
</>
);
};

export default CompleteCreatePay;
51 changes: 51 additions & 0 deletions src/pages/PayPage/CompletePay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { BottomBtn } from "@/components/BottomBtn";
import Check from "@/assets/PayPage/check.svg";
import * as s from "@/pages/PayPage/PayPage.styled";
import { useNavigate } from "react-router-dom";

export type CompletePayType = {
money?: number;
account?: string;
};

const CompletePay = ({ money, account }: CompletePayType) => {
const navigator = useNavigate();
console.log(money);
console.log(account);
return (
<>
{/* ์—ฌ๊ธฐ์— ์ง€๊ธˆ height ๋„ฃ์–ด์ค˜์•ผ */}
<s.ContainerDiv>
<div style={{ display: "flex", justifyContent: "center" }}>
<img src={Check}></img>
</div>
<s.LargeTxt style={{ flex: 1, textAlign: "center" }}>
<p>์š”์ฒญ๋ฐ›์€ ์ •์‚ฐ์„</p>
<p>์™„๋ฃŒํ•˜์˜€์–ด์š”!</p>
</s.LargeTxt>
<s.RoundDiv>
<s.ColumnFlexDiv>
<s.RowFlexDiv>
<div>์ •์‚ฐ๊ธˆ์•ก</div>
<div>15000์›</div>
</s.RowFlexDiv>
<s.RowFlexDiv>
<div>์ž…๊ธˆ ๊ณ„์ขŒ</div>
<div>๊ตญ๋ฏผ 1234-14455-919293</div>
</s.RowFlexDiv>
</s.ColumnFlexDiv>
</s.RoundDiv>

<BottomBtn
onClick={() => {
navigator("/pay");
}}
>
์ •์‚ฐ ํ™ˆ์œผ๋กœ
</BottomBtn>
</s.ContainerDiv>
</>
);
};

export default CompletePay;
56 changes: 56 additions & 0 deletions src/pages/PayPage/CreatePayComponents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import CheckBox from "@/components/CheckBox";
import { Member } from "@/pages/ChatPage/ChatCreatePage/ChatCreatePage.styled";
import ReactImg from "@/assets/react.svg";
import { useState } from "react";

import * as s from "@/pages/PayPage/PayPage.styled";
interface payChatDivtype {
img: string;
name: string;
cnt: number;
}

const PayChatMemberDiv = () => {
return (
<s.RowFlexDiv style={{ alignItems: "center" }}>
<img style={{ width: "2.5rem", height: "2.5rem", marginLeft: "1.875rem" }} src={ReactImg} />
<span className="name" style={{ marginLeft: "0.75rem" }}>
์‹œํ—˜
</span>
<CheckBox></CheckBox>
</s.RowFlexDiv>
);
};
export const PayChatDiv = ({ img, name, cnt }: payChatDivtype) => {
const [flag, setFlag] = useState(false);
const controlFlag = () => {
setFlag(!flag);
};
return (
<s.ColumnFlexDiv>
<Member>
<section>
<img src={ReactImg} />
<span className="name">{name}</span>
<s.CountText className="count">{cnt}</s.CountText>
</section>
{flag ? (
<CheckBox
checked={true}
onClick={() => {
controlFlag();
}}
></CheckBox>
) : (
<CheckBox
checked={false}
onClick={() => {
controlFlag();
}}
></CheckBox>
)}
</Member>
<PayChatMemberDiv></PayChatMemberDiv>
</s.ColumnFlexDiv>
);
};
Loading

0 comments on commit 7521262

Please sign in to comment.