Skip to content

Commit

Permalink
Merge pull request #8 from FastCampus-Mini5/signin
Browse files Browse the repository at this point in the history
docs: 컴포넌트 경로 수정
  • Loading branch information
fronttemp authored Aug 3, 2023
2 parents 1c979dc + add5603 commit 5a7af6d
Show file tree
Hide file tree
Showing 29 changed files with 197 additions and 194 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/reset.min.css"
/>
<title>TEMP</title>
<title>당연하지 admin</title>
</head>
<body>
<div id="root"></div>
Expand Down
19 changes: 6 additions & 13 deletions src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import axios from "axios"
import { API_URL } from './Base';

interface User {
username: string,
email: string,
hireDate: string
reaminVacation: number
}

export const userListApi = async() => {
try {
const data = await axios.get(`${API_URL}/api/admin/user/list`)
const data = await axios.get(`${API_URL}/user/list`)
if(data) {
return data
}
Expand All @@ -24,7 +17,7 @@ export const userListApi = async() => {

export const userApproveApi = async() => {
try {
const data = await axios.get(`${API_URL}/api/admin/signup/list`)
const data = await axios.get(`${API_URL}/signup/list`)
if(data) {
return data
}
Expand All @@ -38,7 +31,7 @@ export const userApproveApi = async() => {

export const vacationApi = async() => {
try {
const data = await axios.get(`${API_URL}/api/admin/vacation/approve/list`)
const data = await axios.get(`${API_URL}/vacation/approve/list`)
if(data) {
return data
} else {
Expand All @@ -51,7 +44,7 @@ export const vacationApi = async() => {

export const vacationPendingApi = async() => {
try {
const data = await axios.get(`${API_URL}/api/admin/vacation/pending`)
const data = await axios.get(`${API_URL}/vacation/pending`)
if(data) {
return data
} else {
Expand All @@ -64,7 +57,7 @@ export const vacationPendingApi = async() => {

export const DutyListApi = async() => {
try {
const data = await axios.get(`${API_URL}/api/admin/duty/approve/list`)
const data = await axios.get(`${API_URL}/duty/approve/list`)
if(data) {
return data
} else {
Expand All @@ -77,7 +70,7 @@ export const DutyListApi = async() => {

export const DutyPeindingListsApi = async() => {
try {
const data = await axios.get(`${API_URL}/api/admin/duty/pending`)
const data = await axios.get(`${API_URL}/duty/pending`)
if(data) {
return data
} else {
Expand Down
12 changes: 0 additions & 12 deletions src/components/App.tsx

This file was deleted.

17 changes: 8 additions & 9 deletions src/components/Nav.tsx → src/components/common/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {NavLink, Outlet} from 'react-router-dom'
import Styled from 'styled-components'
import styled from 'styled-components'

function Nav() {
export const Layout = () => {
const links = [
{ path: '/', text: '홈'},
{ path: '/user', text: '유저 리스트'},
{ path: '/', text: '유저 리스트'},
{ path: '/vacationpending', text: '연차 요청 리스트'},
{ path: '/vacation', text: '연차 리스트'},
{ path: '/dutypending', text: '당직 요청 리스트'},
Expand Down Expand Up @@ -36,23 +35,23 @@ function Nav() {
)
}

export default Nav

const StyledDiv = Styled.div`
const StyledDiv = styled.div`
position: fix;
display: flex;
`

const StyledNavContainer = Styled.div`
const StyledNavContainer = styled.div`
min-width: 200px;
height: 100vh;
background-color: #66ffff;
justify-content: center;
text-align: center;
`

const StyledNavitem = Styled(NavLink)`
const StyledNavitem = styled(NavLink)`
display: block;
font-size: 20px;
margin-top: 50px;
margin-bottom: 40px;
`

1 change: 1 addition & 0 deletions src/components/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from 'components/common/Layout';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react'
import { Table } from 'antd'
import SelectPeriod from "./SelectPeriod"
import {SelectPeriod} from "./SelectPeriod"
import { DutyListApi } from '@/api/api'
interface DutyList {
username: string
Expand All @@ -9,7 +9,7 @@ interface DutyList {
dutyDate: string
}

function DutyList() {
export const DutyForm = () => {
const [dutyLists, setDutyLists] = useState<DutyList[]>([])

const DutyList = async() => {
Expand Down Expand Up @@ -38,27 +38,32 @@ function DutyList() {
{
title: '번호',
dataIndex: 'key',
key: 'key'
key: 'key',
align: 'center' as 'center'
},
{
title: '성명',
dataIndex: 'username',
key: 'username'
key: 'username',
align: 'center' as 'center'
},
{
title: '아이디',
dataIndex: 'email',
key: 'email'
key: 'email',
align: 'center' as 'center'
},
{
title: '신청일',
dataIndex: 'createdDate',
key: 'createdDate'
key: 'createdDate',
align: 'center' as 'center'
},
{
title: '당직일',
dataIndex: 'dutyDate',
key: 'dutyDate'
key: 'dutyDate',
align: 'center' as 'center'
},
]

Expand All @@ -73,5 +78,3 @@ function DutyList() {
</>
)
}

export default DutyList
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface DutyPending {
dutyDate: string
}

function DutyPending() {
export const DutyPendingForm = () => {
const [dutyPendingLists, setDutyPendingLists] = useState<DutyPending[]>([])

const dutyPendingList = async () => {
Expand Down Expand Up @@ -49,32 +49,38 @@ function DutyPending() {
{
title: '번호',
dataIndex: 'key',
key: 'key'
key: 'key',
align: 'center' as 'center'
},
{
title: '성명',
dataIndex: 'ueername',
key: 'ueername'
key: 'ueername',
align: 'center' as 'center'
},
{
title: '아이디',
dataIndex: 'email',
key: 'email'
key: 'email',
align: 'center' as 'center'
},
{
title: '신청일',
dataIndex: 'createdDate',
key: 'createdDate'
key: 'createdDate',
align: 'center' as 'center'
},
{
title: '당직일',
dataIndex: 'dutyDate',
key: 'dutyDate'
key: 'dutyDate',
align: 'center' as 'center'
},
{
title: '승인여부',
dataIndex: 'approveButton',
key: 'approveButton'
key: 'approveButton',
align: 'center' as 'center'
}
]

Expand All @@ -97,8 +103,6 @@ function DutyPending() {
)
}

export default DutyPending

const StyleButton = styled.div`
display: flex;
gap: 10px;
Expand Down
6 changes: 2 additions & 4 deletions src/components/duty/SelectPeriod.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


function SelectPeriod() {
export const SelectPeriod = () => {
const handleChange = (e) => {
console.log(e.target.value)
}
Expand Down Expand Up @@ -47,6 +47,4 @@ function SelectPeriod() {
</select>
</>
)
}

export default SelectPeriod
}
3 changes: 3 additions & 0 deletions src/components/duty/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from 'components/duty/DutyForm'
export * from 'components/duty/DutyPendingForm'
export * from 'components/duty/SelectPeriod'
6 changes: 5 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
export * from 'components/App'
export * from 'components/ErrorComponent'
export * from 'components/common'
export * from 'components/duty'
export * from 'components/signin'
export * from 'components/user'
export * from 'components/vacation'
Empty file removed src/components/signin/SignIn.tsx
Empty file.
5 changes: 5 additions & 0 deletions src/components/signin/SignInForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const SignInForm = () => {
return (
<div>SignInForm</div>
)
}
1 change: 1 addition & 0 deletions src/components/signin/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from 'components/signin/SignInForm'
10 changes: 10 additions & 0 deletions src/components/user/UserApproveButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const UserApproveButton = ( {email} ) => {

function handleClick() {
console.log(email)
}

return (
<button onClick = {() => handleClick()}>승인</button>
)
}
Loading

0 comments on commit 5a7af6d

Please sign in to comment.