-
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.
- Loading branch information
Showing
35 changed files
with
2,280 additions
and
606 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,38 @@ | ||
import { createContext, useReducer ,useEffect} from 'react' | ||
|
||
export const UserContext = createContext(null); | ||
|
||
const initialState = { | ||
isLogin: false, | ||
user:{} | ||
} | ||
|
||
const reducer = (state, action) => { | ||
const { status, payload } = action; | ||
|
||
switch (status) { | ||
case 'login': | ||
localStorage.setItem('token', payload.token) | ||
return { | ||
isLogin: true, | ||
user: payload | ||
} | ||
case 'logout': | ||
localStorage.removeItem('token') | ||
return { | ||
isLogin: false, | ||
user: {} | ||
} | ||
default: | ||
throw new Error(); | ||
} | ||
} | ||
|
||
export const UserContextProvider = ({ children}) => { | ||
const [state, dispatch] = useReducer(reducer, initialState) | ||
return ( | ||
< UserContext.Provider value={{ state, dispatch }} > | ||
{children} | ||
</UserContext.Provider> | ||
) | ||
} |
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,78 @@ | ||
import styled from "styled-components"; | ||
|
||
|
||
export const Wrappper = styled.div` | ||
width:84.8%; | ||
margin:0 auto; | ||
margin-top: 73px; | ||
h1 { | ||
padding-left: 25px; | ||
font-size: 36px; | ||
} | ||
input{ | ||
font-family: 'Montserrat', sans-serif; | ||
border-radius: 5px; | ||
border: 2px solid #766C6C; | ||
background: rgba(210, 210, 210, 0.25); | ||
padding-left: 10px; | ||
max-width:100%; | ||
margin-bottom: 27px; | ||
} | ||
.first { | ||
max-width : 927px; | ||
width:100%; | ||
height:50px; | ||
} | ||
.firsts { | ||
max-width : 903px; | ||
width:100%; | ||
height:50px; | ||
} | ||
.second { | ||
font-family: 'Montserrat', sans-serif; | ||
max-width: 213px; | ||
width:100%; | ||
height: 50px; | ||
border-radius: 5px; | ||
border: 2px solid #766C6C; | ||
background: rgba(210, 210, 210, 0.25); | ||
} | ||
.secondbtn { | ||
padding:0px 40px; | ||
font-weight: bold; | ||
border:none; | ||
color:white; | ||
font-size: 14px; | ||
line-height: 19px; | ||
font-family: 'Montserrat', sans-serif; | ||
display:flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
width: 222px; | ||
height: 50px; | ||
background: #433434; | ||
border-radius: 5px; | ||
} | ||
.third { | ||
width: 1157px; | ||
height: 50px; | ||
} | ||
label{ | ||
display:flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding:10px; | ||
img{ | ||
height:30px; | ||
} | ||
} | ||
` | ||
|
||
export const Flexx = styled.div` | ||
display:flex; | ||
${props => props.btwn ? ` | ||
justify-content:space-between; | ||
gap:1rem; | ||
`: null} | ||
/* margin-bottom: 27px; */ | ||
` |
Oops, something went wrong.