Skip to content

Commit

Permalink
Merge pull request #302 from sharemindteam/dev
Browse files Browse the repository at this point in the history
0616 셰어마인드 도메인 배포
  • Loading branch information
rmdnps10 authored Jun 15, 2024
2 parents 2b8b347 + 031c353 commit 35fb101
Show file tree
Hide file tree
Showing 106 changed files with 2,744 additions and 1,578 deletions.
25 changes: 25 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@mui/material": "^5.15.6",
"@mui/styled-engine-sc": "^6.0.0-alpha.13",
"@stomp/stompjs": "^7.0.0",
"@tanstack/react-query": "^5.40.1",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
Expand Down
133 changes: 133 additions & 0 deletions src/App.Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import React from 'react';
import backgroundImage from 'assets/background/background.png';
import backgroundLogoImage from 'assets/background/background_logo.png';
import backgroundTextImage from 'assets/background/background_text.png';
import backgroundIconsImage from 'assets/background/background_sub_icons.png';
import backgroundButtonImage from 'assets/background/background_button.png';

import styled from 'styled-components';
import { Green } from 'styles/color';
import { Flex } from 'components/Common/Flex';
import { useNavigate } from 'react-router-dom';
//
//
//

interface AppLayoutProps {
children: React.ReactNode;
}

//
//
//

const BACKGROUND_LEFT_RIGHT_RATIO = 3;

const GROUND_HEIGHT = '24rem';

const LAYOUT_STYLES = {
width: '100vw',
height: '100vh',
display: 'flex',
backgroundImage: `url(${backgroundImage})`,
backgroundSize: 'cover',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
};

const LeftSection = styled.div`
position: relative;
flex: ${BACKGROUND_LEFT_RIGHT_RATIO};
display: flex;
justify-content: center;
`;

const RightSection = styled.div`
position: relative;
flex: 1;
flex-direction: column;
`;

const IconWrapper = styled.div`
display: flex;
flex-direction: column;
justify-content: space-between;
max-width: 40rem;
padding: 0;
@media (min-width: 768px) {
padding: 0 2rem;
}
`;

const ButtonWrapper = styled.div`
max-width: 40rem;
padding: 0;
@media (min-width: 768px) {
padding: 0 2rem;
}
`;

const StyledImg = styled.img`
max-width: 100%;
height: auto;
`;

const BottomGreenBox = styled.div`
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: ${GROUND_HEIGHT};
bottom: 0;
background-color: ${Green};
`;

//
//
//

const AppLayout = ({ children }: AppLayoutProps) => {
const navigate = useNavigate();

//
//
//

return (
<div style={LAYOUT_STYLES}>
<LeftSection>
<IconWrapper>
<Flex direction="column" gap="1rem" style={{ flex: 1 }}>
<StyledImg src={backgroundTextImage} alt="bg-text" />
<StyledImg src={backgroundLogoImage} alt="bg-logo" />
</Flex>
<StyledImg
src={backgroundIconsImage}
alt="bg-icons"
style={{ marginBottom: GROUND_HEIGHT }}
/>
</IconWrapper>
<BottomGreenBox>
<ButtonWrapper>
<StyledImg
src={backgroundButtonImage}
alt="bg-button"
onClick={() => {
navigate('/service');
}}
/>
</ButtonWrapper>
</BottomGreenBox>
</LeftSection>
<div style={{ flex: 1 }}>{children}</div>
<RightSection>
<BottomGreenBox />
</RightSection>
</div>
);
};

export default AppLayout;
12 changes: 10 additions & 2 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { SellerMypageModifyProfile } from 'pages/Seller/SellerMyPageModifyProfil
import { SellerMypageViewProfile } from 'pages/Seller/SellerMyPageViewProfile';
import { SellerMypage } from 'pages/Seller/SellerMypage';
import { SellerLetterWrite } from 'pages/Seller/SellerLetterWrite';
import { Routes, Route } from 'react-router-dom';
import { Routes, Route, Navigate } from 'react-router-dom';
import { SellerMyPageReview } from 'pages/Seller/SellerMyPageReview';
import { BuyerSignupComplete } from 'pages/Buyer/BuyerSignupComplete';
import { BuyerFindInfo } from 'pages/Buyer/BuyerFindInfo';
Expand Down Expand Up @@ -51,16 +51,24 @@ import { BuyerOpenPaymentDetail } from 'pages/Buyer/BuyerOpenPaymentDetail';
import BuyerWriteOpenConsult from 'pages/Buyer/BuyerWriteOpenConsult';
import BuyerOpenConsultDetail from 'pages/Buyer/BuyerOpenConsultDetail';
import BuyerFinishPayment from 'pages/Buyer/BuyerFinishPayment';
import BuyerOpenConsultLikes from 'pages/Buyer/BuyerOpenConsultLikes';
import BuyerOpenConsultRecents from 'pages/Buyer/BuyerOpenConsultRecents';

const Router = () => {
return (
<Routes>
{/* admin */}
<Route path="/admin" element={<Admin />} />
{/* minder(buyer) */}
<Route path="/share" element={<BuyerHome />} />
<Route path="/" element={<BuyerHome />} />
<Route path="/" element={<Navigate to="/share" />} />
<Route path="/consult" element={<BuyerConsult />} />
<Route path="/open-consult" element={<BuyerOpenConsult />} />
<Route path="/open-consult/likes" element={<BuyerOpenConsultLikes />} />
<Route
path="/open-consult/recents"
element={<BuyerOpenConsultRecents />}
/>
<Route path="/open-consult/:id" element={<BuyerOpenConsultDetail />} />
<Route path="/profile/:id" element={<BuyerCounselorProfile />} />
<Route path="/search" element={<BuyerSearch />} />
Expand Down
117 changes: 117 additions & 0 deletions src/api/axios.deprecated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { instance, publicInstance } from './axios';

//
//
//

export const getInstance = async (url: string, params?: any) => {
try {
const data = await instance.get(url, params);
return data;
} catch (error) {
return error;
}
};
export const postInstance = async (url: string, body: any, params?: any) => {
try {
const data = await instance.post(url, body, params);
return data;
} catch (error) {
return error;
}
};
export const putInstance = async (url: string, body: any, params: any) => {
try {
const data = await instance.put(url, body, params);
return data;
} catch (error) {
return error;
}
};

export const patchInstance = async (url: string, body?: any, params?: any) => {
try {
const data = await instance.patch(url, body, params);
return data;
} catch (error) {
return error;
}
};

export const deleteInstance = async (url: string, body?: any) => {
try {
const config = {
data: body,
};
const data = await instance.delete(url, config);
return data;
} catch (error) {
return error;
}
};

//
//
//

export const getPublicInstance = async (url: string, params?: any) => {
try {
const data = await publicInstance.get(url, params);
return data;
} catch (error) {
return error;
}
};
export const postPublicInstance = async (
url: string,
body: any,
params?: any,
) => {
try {
const data = await publicInstance.post(url, body, params);
return data;
} catch (error) {
return error;
}
};
export const putPublicInstance = async (
url: string,
body: any,
params: any,
) => {
try {
const data = await publicInstance.put(url, body, params);
return data;
} catch (error) {
return error;
}
};

export const patchPublicInstance = async (
url: string,
body?: any,
params?: any,
) => {
try {
const data = await publicInstance.patch(url, body, params);
return data;
} catch (error) {
return error;
}
};

export const deletePublicInstance = async (url: string, body?: any) => {
try {
const config = {
data: body,
};
const data = await publicInstance.delete(url, config);
return data;
} catch (error) {
return error;
}
};

//
//
//
Loading

0 comments on commit 35fb101

Please sign in to comment.