-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat] 회원가입 추가기능
- Loading branch information
Showing
23 changed files
with
597 additions
and
197 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
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,54 @@ | ||
import axios from "axios"; | ||
|
||
const schoolAPI = { | ||
async getSchoolName(word: string) { | ||
const response = await axios.get( | ||
"https://open.neis.go.kr/hub/schoolInfo", | ||
{ | ||
params: { | ||
KEY: process.env.NEXT_PUBLIC_SCHOOL_API_KEY, | ||
Type: "json", | ||
pIndex: 1, | ||
pSize: 20, | ||
SCHUL_NM: word | ||
} | ||
} | ||
); | ||
return response.data; | ||
}, | ||
async getUnivName(word: string) { | ||
const response = await axios.get( | ||
"https://www.career.go.kr/cnet/openapi/getOpenApi", | ||
{ | ||
params: { | ||
apiKey: process.env.NEXT_PUBLIC_UNIV_API_KEY, | ||
svcType: "api", | ||
svcCode: "SCHOOL", | ||
contentType: "json", | ||
gubun: "univ_list", | ||
searchSchulNm: word | ||
} | ||
} | ||
); | ||
return response.data; | ||
}, | ||
async getMajorName(word: string) { | ||
const response = await axios.get( | ||
"https://www.career.go.kr/cnet/openapi/getOpenApi", | ||
{ | ||
params: { | ||
apiKey: process.env.NEXT_PUBLIC_UNIV_API_KEY, | ||
svcType: "api", | ||
svcCode: "MAJOR", | ||
contentType: "json", | ||
gubun: "univ_list", | ||
univSe: "univ", | ||
searchTitle: word | ||
} | ||
} | ||
); | ||
return response.data; | ||
} | ||
}; | ||
|
||
export default schoolAPI; |
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,27 @@ | ||
const CheckImage = () => { | ||
return ( | ||
<svg | ||
width="104" | ||
height="105" | ||
viewBox="0 0 104 105" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<circle | ||
cx="52" | ||
cy="52.2441" | ||
r="52" | ||
fill="white" | ||
fillOpacity="0.05" | ||
/> | ||
<path | ||
d="M31 52.2441L47.8 67.2441L73 37.2441" | ||
stroke="white" | ||
strokeWidth="7.5" | ||
strokeLinecap="round" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default CheckImage; |
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
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,56 @@ | ||
"use client"; | ||
|
||
import styled from "styled-components"; | ||
import { useState } from "react"; | ||
import Flex from "../common/Flex"; | ||
import Text from "../common/Text"; | ||
import { colors } from "styles/theme"; | ||
import { motion } from "framer-motion"; | ||
import { dropdown } from "src/constants/animation"; | ||
|
||
export interface OptionProps { | ||
options: any; | ||
value?: string; | ||
setState?: any; | ||
defaultValue?: string; | ||
} | ||
|
||
const Option = (props: OptionProps) => { | ||
const [open, setOpen] = useState<boolean>(true); | ||
return ( | ||
<Flex direction="column" align="start" gap={8}> | ||
<Options | ||
initial="hide" | ||
animate={open ? "show" : "hide"} | ||
variants={dropdown} | ||
> | ||
{props.options.map((option: any) => ( | ||
<OptionItem | ||
key={option.value} | ||
onClick={() => { | ||
props.setState(option.name); | ||
setOpen(!open); | ||
}} | ||
> | ||
<Text typo="Subtitle1r">{option.name}</Text> | ||
</OptionItem> | ||
))} | ||
</Options> | ||
</Flex> | ||
); | ||
}; | ||
|
||
const Options = styled(motion.ul)` | ||
width: 100%; | ||
max-height: 212px; | ||
border-radius: 0 0 10px 10px; | ||
overflow: scroll; | ||
`; | ||
|
||
const OptionItem = styled.li` | ||
width: 100%; | ||
padding: 1rem; | ||
background: ${colors.light_gray3}; | ||
`; | ||
|
||
export default Option; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
import { useInfiniteQuery, useQuery } from "@tanstack/react-query"; | ||
import schoolAPI from "src/apis/school"; | ||
|
||
const useGetMajorQuery = (word: string) => { | ||
// const { data, fetchNextPage, hasNextPage, isFetched } = useInfiniteQuery( | ||
// ["school"], | ||
// ({ pageParam = 0 }) => getUserQuestions(id, qtype, pageParam, 10), | ||
// { | ||
// getNextPageParam: (lastPage) => { | ||
// return lastPage.data.count > lastPage.idx + 10 | ||
// ? lastPage.idx + 10 | ||
// : undefined; | ||
// } | ||
// } | ||
// ); | ||
|
||
// return { data, fetchNextPage, hasNextPage, isFetched }; | ||
const { data, isLoading, refetch } = useQuery( | ||
["major"], | ||
() => schoolAPI.getMajorName(word), | ||
{ | ||
onError: (error: any) => { | ||
alert(error); | ||
} | ||
} | ||
); | ||
|
||
return { data, isLoading, refetch }; | ||
}; | ||
|
||
export default useGetMajorQuery; |
Oops, something went wrong.