Skip to content

Commit

Permalink
feat: signup works initially, perhaps additional exception handlings …
Browse files Browse the repository at this point in the history
…are required
  • Loading branch information
hookor committed Aug 7, 2023
1 parent 5e14960 commit e00d752
Show file tree
Hide file tree
Showing 15 changed files with 386 additions and 34 deletions.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,200,0,0" />

<title>TEMP</title>
</head>
Expand Down
121 changes: 121 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@fullcalendar/interaction": "^6.1.8",
"@fullcalendar/react": "^6.1.8",
"axios": "^1.4.0",
"date-fns": "^2.30.0",
"fullcalendar": "^6.1.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -32,6 +33,7 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"react-datepicker": "^4.16.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.2",
"vite": "^4.4.5",
Expand Down
28 changes: 15 additions & 13 deletions src/api/account.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { baseInstance, authInstance } from 'api/index'

//회원가입 -- base
export const signUp = async newAccount => {
const res = await baseInstance.post('/signup', newAccount)
export const signUp = async ({ password, email, hireDate, username }) => {
const res = await baseInstance.post('/signup', {
password: password,
email: email,
hireDate: hireDate,
username: username
})
return res.data
}

Expand All @@ -15,26 +20,23 @@ export const signIn = async (email: string, password: string) => {
return res
}

//로그아웃 -- auth -- API X => **remove token**
// export const signOut = async () => {
// const res = await authInstance.post('/signin')
// return res.data
// }

//이메일 중복체크 -- base
export const checkEmailAvailable = async (email: string) => {
const res = await baseInstance.post('/update', email)
const res = await baseInstance.get(`/emailCheck?email=${email}`)
return res.data
}

//정보 수정(update) -- auth
export const updateProfile = async account => {
const res = await authInstance.post('/findPassword', account)
export const updateProfile = async (profile: string, password: string) => {
const res = await authInstance.post('/update', {
profile: profile,
password: password
})
return res.data
}

//비밀번호 재설정(이메일 전송) -- auth
//비밀번호 재설정(이메일 전송) -- base
export const resetPassword = async (email: string) => {
const res = await authInstance.post('/findPassword', email)
const res = await baseInstance.post('/findPassword', { email: email })
return res.data
}
Binary file added src/assets/calendarIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions src/components/form/DatePickerForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { styled } from 'styled-components'
import DatePicker from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css'
import { TitleText } from 'components/index'
import { signupTexts } from 'constants/index'
import { ko } from 'date-fns/esm/locale'

export const DatePickerForm = ({ date, setDate }) => {
//코드 더러움 수정 필요
return (
<>
<DatePickerWrapper>
<TitleText>{signupTexts.hireDate}</TitleText>
<label>
<i>
<img src="/src/assets/calendarIcon.png" />
</i>
<DatePicker
locale={ko}
selected={date}
onChange={date => {
setDate(date)
}}
dateFormat="yyyy-MM-dd"></DatePicker>
</label>
</DatePickerWrapper>
</>
)
}

const DatePickerWrapper = styled.div`
position: relative;
img {
width: 25px;
height: 24px;
position: absolute;
z-index: 1;
top: 53px;
right: 40px;
cursor: pointer;
}
input {
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 10px;
padding-left: 10px;
width: 434px;
height: 60px;
margin-bottom: 6px;
&::placeholder {
font-size: 12px;
opacity: 0.75;
}
&:focus {
outline: 1px solid ${props => props.theme.colors.primaryBlue};
}
}
`
Loading

0 comments on commit e00d752

Please sign in to comment.