Skip to content

Commit

Permalink
Merge pull request #49 from 9oormthon-univ/feature/#43
Browse files Browse the repository at this point in the history
Feature/#43
  • Loading branch information
seungsimdang authored Aug 2, 2024
2 parents 4eb1c71 + 3e29bf4 commit f35ecaa
Show file tree
Hide file tree
Showing 46 changed files with 1,468 additions and 3 deletions.
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#ffffff" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script
type="text/javascript"
src="//dapi.kakao.com/v2/maps/sdk.js?appkey=96604ec037f2dfedf241ad7e007d54c5&libraries=services,clusterer"
></script>
<title>Gieoghaebom</title>
</head>
<body>
Expand Down
21 changes: 21 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 @@ -25,6 +25,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"react-kakao-maps-sdk": "^1.1.27",
"react-lottie": "^1.2.4",
"react-router-dom": "^6.22.3",
"react-slick": "^0.30.2",
Expand Down
7 changes: 6 additions & 1 deletion src/apis/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ import axios, { AxiosInstance } from "axios";

export const imgInstance: AxiosInstance = axios.create({
baseURL: `https://picsum.photos/v2`,
timeout: 5000
timeout: 1000
});

export const instance = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL,
timeout: 50000
});

export const flaskInstance = axios.create({
baseURL: import.meta.env.VITE_API_FLASK_BASE_URL,
timeout: 50000
});
29 changes: 29 additions & 0 deletions src/apis/postAroundSeniorCenter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { MapProps } from "@components/KakaoMap/KakaoMap.types";
import { flaskInstance } from "./instance";

const postAroundSeniorCenter = async (latitude: number, longitude: number): Promise<MapProps> => {
const postAroundSeniorCenterURL = "/locations";

try {
const accessToken = sessionStorage.getItem("accessToken");

const requestBody = {
latitude,
longitude
};

const config = {
headers: {
Authorization: `Bearer ${accessToken}`
}
};

const response = await flaskInstance.post(postAroundSeniorCenterURL, requestBody, config);

return response.data;
} catch (error) {
throw error;
}
};

export default postAroundSeniorCenter;
29 changes: 29 additions & 0 deletions src/apis/postSeniorCenterList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { MapProps } from "@components/KakaoMap/KakaoMap.types";
import { flaskInstance } from "./instance";

const postSeniorCenterList = async (page: number, keyword: string): Promise<MapProps> => {
const postSeniorCenterListURL = "/search";

try {
const accessToken = sessionStorage.getItem("accessToken");

const requestBody = {
keyword,
page
};

const config = {
headers: {
Authorization: `Bearer ${accessToken}`
}
};

const response = await flaskInstance.post(postSeniorCenterListURL, requestBody, config);

return response.data;
} catch (error) {
throw error;
}
};

export default postSeniorCenterList;
3 changes: 3 additions & 0 deletions src/assets/icons/backArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/icons/listIcon.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/icons/mapIcon.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/icons/phoneIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/assets/icons/positionIcon.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/icons/retryIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/icons/sadIcon.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/icons/searchIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/icons/smileIcon.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/icons/timerIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/icons/whiteListIcon.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/icons/whiteMapIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions src/components/KakaoMap/KakaoMap.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import styled from "@emotion/styled";

export const Pin = styled.button`
min-width: 70px;
max-width: 106px;
height: 38px;
flex-shrink: 0;
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding: 2px 8px;
margin: 0 16px;
${({ theme }) => theme.text.detail2_bold};
color: ${({ theme }) => theme.colors.gray[600]};
border-radius: 71px;
background-color: #fff;
transition: all 0.2s ease;
border: 1px solid #00b207;
filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
&::after {
content: "";
position: absolute;
bottom: -14px;
left: 50%;
transform: translateX(-50%);
border-top: 14px solid #fff;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 1px solid transparent;
}
&[data-selected="true"] {
color: #fff;
border: 1px solid #fff;
background-color: #00b207;
&::after {
border-top: 14px solid #00b207;
}
}
`;

export const SearchButton = styled.button`
position: absolute;
top: 100px;
left: 50%;
transform: translateX(-50%);
display: flex;
padding: 6px 12px;
align-items: center;
gap: 4px;
border-radius: 50px;
background: #fff;
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.15), 0px 1px 2px 1px rgba(0, 0, 0, 0.15);
z-index: 1001;
`;

export const SearchBtnTxt = styled.p`
color: #176d1b;
${({ theme }) => theme.text.detail2_reg};
`;

export const clustererStyles = {
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "80px",
height: "80px",
padding: "10px",
border: "2px solid #fff",
borderRadius: "50%",
background:
"linear-gradient(102deg, rgba(58, 200, 244, 0.90) 10.91%, rgba(94, 155, 243, 0.90) 89.69%)",
boxShadow: "0px 2px 18px 3px rgba(0, 0, 0, 0.10)",
fontSize: "20px",
fontWeight: 600,
color: "#fff"
};
Loading

0 comments on commit f35ecaa

Please sign in to comment.