Skip to content

Commit

Permalink
Merge pull request #2 from FastCampusGroupFE9/ChoiYongJun/mypage-list
Browse files Browse the repository at this point in the history
Choi yong jun/mypage list
  • Loading branch information
PelicanStd authored Jul 26, 2023
2 parents 081fab8 + 03f5730 commit 21a4f37
Show file tree
Hide file tree
Showing 17 changed files with 408 additions and 27 deletions.
1 change: 0 additions & 1 deletion index2.html → index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<<<<<<< HEAD
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand Down
147 changes: 147 additions & 0 deletions package-lock.json

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

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
"dependencies": {
"@tanstack/react-query": "^4.32.0",
"axios": "^1.4.0",
"jwt-decode": "^3.1.2",
"react": "^18.2.0",
"react-date-range": "^1.4.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-router-dom": "^6.14.2",
"scss": "^0.2.4",
"vite-plugin-mkcert": "^1.16.0",
"vite-plugin-sass-dts": "^1.3.8"
},
"devDependencies": {
"@types/node": "^20.4.4",
"@types/react": "^18.0.37",
"@types/react-date-range": "^1.4.4",
"@types/react-dom": "^18.0.11",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
Expand Down
17 changes: 15 additions & 2 deletions src/@types/common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@

declare interface Sample {
declare interface JoinUserInputType {
id: string;
name: string;
joinDate: string;
}

declare interface LoginOutputType {
id: string;
name: string;
joinDate: string;
accessToken: string;
refreshToken?: string;
}

declare interface UserLoginType {
accessToken: string;
refreshToken?: string;
}

// declare 사용하여 전역화 시킨다.
13 changes: 9 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import Main from "./pages/Main/main.tsx";
import { Route, Routes } from "react-router-dom";
// import ProtectedRoute from "./Components/ProtectedRoute.tsx";
// import Admin from "./pages/Admin/admin.tsx";


function App() {

return (
<>
<h1>라우터 필요시 생성</h1>
</>
<Routes>
<Route path="/" element={<Main />} />
{/*<Route path="/admin" */}
{/* element={<ProtectedRoute adminRequired={true} element={<Admin />}*/}
</Routes>
)
}

Expand Down
33 changes: 33 additions & 0 deletions src/Components/Calendar-input/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useState } from 'react';
import { DateRange, Range } from 'react-date-range';
import 'react-date-range/dist/styles.css';
import 'react-date-range/dist/theme/default.css';

export default function MyDateRangePicker() {
const [state, setState] = useState<Range[]>([
{
startDate: new Date(),
endDate: undefined,
key: 'selection'
}
]);

// 선택한 날짜 범위를 받아 옵니다. 확인용 콘솔입니다.
console.log(state[0].startDate);
console.log(state[0].endDate);

const handleSelect = (ranges: { [key: string]: Range }) => {
setState([ranges['selection']]);
}

return (
<DateRange
editableDateInputs={true}
onChange={handleSelect}
moveRangeOnFirstSelection={false}
months={2}
ranges={state}
/>
);
}

Loading

0 comments on commit 21a4f37

Please sign in to comment.