-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from boostcampwm-2022/feat/write-course-request
feat ์ฝ์ค ๋ฑ๋ก API ์ฐ๋ / ์ฝ์ค ์ ๋ณด์ hName ์ ์ฅํ๋๋ก ์์
- Loading branch information
Showing
8 changed files
with
128 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Axios, { AxiosResponse } from "axios"; | ||
import { useCallback } from "react"; | ||
type RequestParams = { [key: string]: any }; | ||
const axios = Axios.create({ | ||
baseURL: "https://dapi.kakao.com/v2/local", | ||
headers: { | ||
Authorization: `KakaoAK ${process.env.REACT_APP_KAKAO_REST_KEY}`, | ||
}, | ||
}); | ||
const useLocalAPI = <D>(url: string) => { | ||
const query = useCallback((params: RequestParams): Promise<D> => { | ||
return axios.get<RequestParams, AxiosResponse<D>>(url, { params }).then((res) => res.data); | ||
}, []); | ||
|
||
return query; | ||
}; | ||
export default useLocalAPI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import styled from "styled-components"; | ||
import { COLOR } from "styles/color"; | ||
import { flexColumn } from "styles/flex"; | ||
|
||
export const CourseForm = styled.div` | ||
${flexColumn}; | ||
align-items: center; | ||
width: 100%; | ||
height: "240px"; | ||
box-shadow: 0px -4px 4px rgba(0, 0, 0, 0.25); | ||
padding: 15px 27px; | ||
div { | ||
margin-bottom: 10px; | ||
width: 100%; | ||
p { | ||
padding: 16px; | ||
border-bottom: 1px solid ${COLOR.BABY_BLUE}; | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export interface RegionResponse { | ||
documents: Region[]; | ||
meta: { total_count: number }; | ||
} | ||
|
||
interface Region { | ||
address_name: string; | ||
code: string; | ||
region_1depth_name: string; | ||
region_2depth_name: string; | ||
region_3depth_name: string; | ||
region_4depth_name: string; | ||
region_type: string; | ||
x: string; | ||
y: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { LatLng } from "#types/LatLng"; | ||
|
||
const getLatLngByPoint = (point: kakao.maps.LatLng): LatLng => { | ||
return { lat: point.getLat(), lng: point.getLng() }; | ||
}; | ||
|
||
export default getLatLngByPoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters