-
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 #73 from PLADI-ALM/feat/PDW-45-add-user-ui
[PDW-45/feat] 신규 직원 등록 모달 UI
- Loading branch information
Showing
11 changed files
with
250 additions
and
29 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,24 +1,43 @@ | ||
import React from "react"; | ||
import "react-datepicker/dist/react-datepicker.css"; | ||
import styled from "styled-components"; | ||
import ArrowDown from "assets/images/arrowDown.svg" | ||
|
||
export const Select = styled.select` | ||
const Select = styled.select` | ||
border-radius: 10px; | ||
border: 1px solid #717171; | ||
background: #F6F6F6; | ||
font-family: NanumSquare_ac; | ||
font-size: 18px; | ||
color: #757575; | ||
padding: 5px; | ||
padding: 0 10px; | ||
height: 35px; | ||
outline: none; | ||
` | ||
|
||
function SelectToggle(props) { | ||
const ModalSelect = styled(Select)` | ||
width: 280px; | ||
border: 2px solid #E6E6E6; | ||
appearance: none; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
background: url('${props => props.imgUrl}') no-repeat right center; | ||
background-position: right 10px center; | ||
padding: 0 44px 0 10px; | ||
` | ||
|
||
export function SelectToggleInModal(props) { | ||
return ( | ||
<Select onChange={props.change}> | ||
<ModalSelect imgUrl={ArrowDown} onChange={props.change}> | ||
{props.items} | ||
</Select> | ||
</ModalSelect> | ||
); | ||
} | ||
|
||
export default SelectToggle; | ||
export function SelectToggle(props) { | ||
return ( | ||
<Select onChange={props.change}> | ||
{props.items} | ||
</Select> | ||
); | ||
} |
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,84 @@ | ||
import styled from 'styled-components'; | ||
|
||
// Modal이 떴을 때의 배경 | ||
export const ModalBackdrop = styled.div` | ||
z-index: 1; //위치지정 요소 | ||
position: fixed; | ||
display : flex; | ||
justify-content : center; | ||
align-items : center; | ||
background-color: rgba(0,0,0,0.4); | ||
top : 0; | ||
left : 0; | ||
right : 0; | ||
bottom : 0; | ||
` | ||
|
||
// Modal창 | ||
export const ModalView = styled.div` | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
border-radius: 10px; | ||
width: 500px; | ||
background-color: #ffffff; | ||
padding: 30px 50px; | ||
box-sizing: border-box; | ||
` | ||
|
||
export const TitleContainer = styled.div` | ||
width: 100%; | ||
display : flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin-bottom: 20px; | ||
` | ||
|
||
export const ModalTitle = styled.h2` | ||
color: #8741CB; | ||
margin: 0; | ||
` | ||
|
||
export const ExitBtn = styled.button` | ||
background: none; | ||
width: 40px; | ||
height: 40px; | ||
font-family: NanumSquare_ac; | ||
font-size: 40px; | ||
border: none; | ||
color: #4C4C4C; | ||
cursor: pointer; | ||
display : flex; | ||
justify-content : center; | ||
align-items : center; | ||
` | ||
|
||
export const AttrsContainer = styled.div` | ||
width: 100%; | ||
` | ||
|
||
export const AttrContainer = styled.div` | ||
display : flex; | ||
align-items: center; | ||
margin-bottom: 20px; | ||
` | ||
|
||
export const AttrLabel = styled.div` | ||
width: 120px; | ||
font-size: 20px; | ||
text-align: left; | ||
line-height: 40px; | ||
` | ||
|
||
export const AttrInput = styled.input` | ||
border: 2px solid #E6E6E6; | ||
border-radius: 10px; | ||
height: 35px; | ||
width: 280px; | ||
font-family: NanumSquare_ac; | ||
font-size: 18px; | ||
color: #757575; | ||
padding: 0 10px; | ||
outline: none; | ||
box-sizing: border-box; | ||
` |
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
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 |
---|---|---|
@@ -1,23 +1,42 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import React, { useState } from 'react'; | ||
import { BookedLineTr } from 'pages/booking/bookedList/BookedList'; | ||
import RoleCapsule from 'components/capsule/RoleCapsule'; | ||
import MoreIcon from 'assets/images/moreIcon.svg' | ||
import styled from 'styled-components'; | ||
import { UserModal } from './UserModal'; | ||
|
||
function UserManageTableCell(props) { | ||
|
||
const MoreBtn = styled.img` | ||
cursor: pointer; | ||
display: flex; | ||
margin: auto; | ||
` | ||
|
||
function UserManageLine(props) { | ||
const [isOpen, setIsOpen] = useState(false) | ||
|
||
const openModalHandler = () => { | ||
setIsOpen(!isOpen) | ||
} | ||
|
||
return ( | ||
<BookedLineTr> | ||
<td width="5%">{props.name}</td> | ||
<td width="5%">{props.position}</td> | ||
<td width="15%">{props.email}</td> | ||
<td width="10%">{props.department}</td> | ||
<td width="10%">{props.officeJob}</td> | ||
<td width="5%"> | ||
<RoleCapsule role={props.role} /> | ||
</td> | ||
<td width="5%"></td> | ||
</BookedLineTr> | ||
<> | ||
<BookedLineTr> | ||
<td width="5%">{props.name}</td> | ||
<td width="5%">{props.position}</td> | ||
<td width="15%">{props.email}</td> | ||
<td width="10%">{props.department}</td> | ||
<td width="10%">{props.officeJob}</td> | ||
<td width="5%"><RoleCapsule role={props.role} /></td> | ||
<td width="5%"><MoreBtn src={MoreIcon} onClick={openModalHandler} /></td> | ||
|
||
</BookedLineTr> | ||
{isOpen ? | ||
<UserModal id={props.id} handler={openModalHandler} /> | ||
: null | ||
} | ||
</> | ||
) | ||
} | ||
|
||
export default UserManageTableCell; | ||
export default UserManageLine; |
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,75 @@ | ||
import { SelectToggleInModal } from 'components/capsule/SelectToggle'; | ||
import styled from 'styled-components'; | ||
import React, { useState, useEffect } from 'react'; | ||
import { AdminUsersAxios } from 'api/AxiosApi'; | ||
import { getToken } from 'utils/IsLoginUtil'; | ||
import { basicError } from 'utils/ErrorHandlerUtil'; | ||
import { AttrContainer, AttrInput, AttrLabel, AttrsContainer, ExitBtn, ModalBackdrop, ModalTitle, ModalView, TitleContainer } from 'components/modal/Modal'; | ||
|
||
export function UserModal(props) { | ||
const [positionOptionList, setPositionOptionList] = useState([]); | ||
const [departmentOptionList, setDepartmentOptionList] = useState([]); | ||
let deparments, positions; | ||
|
||
function getDpNPsList() { | ||
AdminUsersAxios.get("/ranks", { | ||
headers: { | ||
Authorization: getToken() | ||
} | ||
}) | ||
.then((response) => { | ||
deparments = response.data.data.departmentList | ||
positions = response.data.data.positionList | ||
setPositionOptionList(positions.map((position) => (<option>{position}</option>))) | ||
setDepartmentOptionList(deparments.map((deparment) => (<option>{deparment}</option>))) | ||
}) | ||
.catch((error) => { | ||
basicError(error) | ||
}) | ||
} | ||
useEffect(() => { | ||
getDpNPsList() | ||
}, []) | ||
|
||
|
||
return ( | ||
<ModalBackdrop onClick={props.handler}> | ||
<ModalView onClick={(e) => e.stopPropagation()}> | ||
<TitleContainer> | ||
<ModalTitle>신규 직원 등록</ModalTitle> | ||
<ExitBtn onClick={props.handler}>×</ExitBtn> | ||
</TitleContainer> | ||
<AttrsContainer> | ||
<AttrContainer> | ||
<AttrLabel>이름</AttrLabel> | ||
<AttrInput type='text'></AttrInput> | ||
</AttrContainer> | ||
<AttrContainer> | ||
<AttrLabel>이메일</AttrLabel> | ||
<AttrInput type='text'></AttrInput> | ||
</AttrContainer> | ||
<AttrContainer> | ||
<AttrLabel>비밀번호</AttrLabel> | ||
<AttrInput type='text'></AttrInput> | ||
</AttrContainer> | ||
<AttrContainer> | ||
<AttrLabel>부서</AttrLabel> | ||
<SelectToggleInModal items={departmentOptionList} /> | ||
</AttrContainer> | ||
<AttrContainer> | ||
<AttrLabel>직위</AttrLabel> | ||
<SelectToggleInModal items={positionOptionList} /> | ||
</AttrContainer> | ||
<AttrContainer> | ||
<AttrLabel>직책</AttrLabel> | ||
<AttrInput type='text'></AttrInput> | ||
</AttrContainer> | ||
<AttrContainer> | ||
<AttrLabel>권한</AttrLabel> | ||
<AttrInput type='text'></AttrInput> | ||
</AttrContainer> | ||
</AttrsContainer> | ||
</ModalView> | ||
</ModalBackdrop> | ||
); | ||
} |