-
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 #9 from the-kingdoms/develop
feat: 스크린 생성 및 s3 배포 Yml 생성
- Loading branch information
Showing
33 changed files
with
1,332 additions
and
140 deletions.
There are no files selected for viewing
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,34 @@ | ||
name: eollugage-pc Deploy To S3 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish-storybook: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'v20.10.0' | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build React | ||
run: yarn build | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ap-northeast-2 | ||
|
||
- name: Upload to S3 | ||
run: aws s3 sync --region ap-northeast-2 ./build s3://s3-eollugaga-pc --delete |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
import React from 'react'; | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
import React from 'react' | ||
import { Route, Routes } from 'react-router' | ||
import { ROUTE } from './constants/path' | ||
import ProcessMain from './pages/process' | ||
import Layout from './components/layout' | ||
import Login from './pages/login' | ||
import HistoryMain from './pages/history' | ||
import WaitMain from './pages/waiting' | ||
|
||
function App() { | ||
export default function App() { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.tsx</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
<Routes> | ||
<Route path={ROUTE.LOGIN} element={<Login />} /> | ||
<Route element={<Layout />}> | ||
<Route path={ROUTE.WAITING_MAIN} element={<WaitMain />} /> | ||
<Route path={ROUTE.PROCESS_MAIN} element={<ProcessMain />} /> | ||
<Route path={ROUTE.HISTORY_MAIN} element={<HistoryMain />} /> | ||
</Route> | ||
</Routes> | ||
) | ||
} | ||
|
||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import dayjs from 'dayjs' | ||
import React, { SetStateAction, useState } from 'react' | ||
import styled from 'styled-components' | ||
|
||
const buttonText = ['오늘', '1주', '1개월'] | ||
|
||
interface HistoryDateFilterProps { | ||
date: string | ||
setDate: React.Dispatch<SetStateAction<string>> | ||
} | ||
|
||
export default function HistoryDateFilter({ date, setDate }: HistoryDateFilterProps) { | ||
const [selectedIdx, setSelectedIdx] = useState<number>(0) | ||
|
||
const onClickDate = (index: number) => { | ||
setSelectedIdx(index) | ||
switch (index) { | ||
case 0: | ||
setDate(dayjs().format('YYYY.MM.DD')) | ||
break | ||
case 1: | ||
setDate(dayjs().subtract(1, 'week').format('YYYY.MM.DD') + ' - ' + dayjs().format('YYYY.MM.DD')) | ||
break | ||
case 2: | ||
setDate(dayjs().subtract(1, 'month').format('YYYY.MM.DD') + ' - ' + dayjs().format('YYYY.MM.DD')) | ||
break | ||
default: | ||
setDate('error') | ||
} | ||
} | ||
|
||
const onClickDateInput = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
setDate(dayjs(event.target.value).format('YYYY.MM.DD')) | ||
} | ||
|
||
return ( | ||
<Container> | ||
{buttonText.map((text, i) => ( | ||
<DateButton selected={i === selectedIdx} onClick={() => onClickDate(i)}> | ||
{text} | ||
</DateButton> | ||
))} | ||
<DateInput type="date" value={dayjs(date).format('YYYY.MM.DD')} onChange={onClickDateInput} /> | ||
</Container> | ||
) | ||
} | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
gap: 10px; | ||
align-items: center; | ||
margin-bottom: 45px; | ||
` | ||
const DateButton = styled.div<{ selected: boolean }>` | ||
background-color: ${props => (props.selected ? '#000000' : 'transparent')}; | ||
color: ${props => (props.selected ? '#FFFFFF' : '#000000')}; | ||
border-radius: 1000px; | ||
padding: 12px 20px; | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
` | ||
const DateInput = styled.input` | ||
border-radius: 8px; | ||
padding: 12px 16px; | ||
border: 2px solid #c6c6c6; | ||
` |
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,56 @@ | ||
import { Outlet, useNavigate } from 'react-router' | ||
import styled from 'styled-components' | ||
import NavBar from './navBar' | ||
import { useAtom } from 'jotai' | ||
import { currentTabAtom, historyCountAtom, processCountAtom, waitingCountAtom } from 'utils/atom' | ||
import { ROUTE } from 'constants/path' | ||
|
||
export default function Layout() { | ||
const navigate = useNavigate() | ||
const [, setCurrentTab] = useAtom(currentTabAtom) | ||
const [waitingCount] = useAtom(waitingCountAtom) | ||
const [processCount] = useAtom(processCountAtom) | ||
const [historyCount] = useAtom(historyCountAtom) | ||
|
||
const navBarItem = [ | ||
{ | ||
name: '승인 대기', | ||
count: waitingCount, | ||
onClick: () => onClickTab(ROUTE.WAITING_MAIN), | ||
}, | ||
{ | ||
name: '진행 중', | ||
count: processCount, | ||
onClick: () => onClickTab(ROUTE.PROCESS_MAIN), | ||
}, | ||
{ | ||
name: '히스토리', | ||
count: historyCount, | ||
onClick: () => onClickTab(ROUTE.HISTORY_MAIN), | ||
}, | ||
] | ||
|
||
const onClickTab = (pathname: string) => { | ||
setCurrentTab(pathname) | ||
navigate(pathname) | ||
} | ||
|
||
return ( | ||
<Container> | ||
<NavWrapper> | ||
<NavBar items={navBarItem} /> | ||
</NavWrapper> | ||
<Outlet /> | ||
</Container> | ||
) | ||
} | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
` | ||
const NavWrapper = styled.div` | ||
width: 240px; | ||
height: 100%; | ||
` |
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,53 @@ | ||
import { useState } from 'react' | ||
import NavBarItem from './navBarItem' | ||
import styled from 'styled-components' | ||
import { useAtom } from 'jotai' | ||
import { currentTabAtom } from 'utils/atom' | ||
import { ROUTE } from 'constants/path' | ||
|
||
type VerticalNavProps = { | ||
items: { name: string; count?: number; onClick: () => void }[] | ||
} | ||
|
||
export default function NavBar({ items }: VerticalNavProps) { | ||
const [, setCurrentTab] = useAtom(currentTabAtom) | ||
const [focusedIdx, setFocusedIdx] = useState<number>(0) | ||
|
||
const onClickItem = (i: number, onClick: () => void) => { | ||
switch (i) { | ||
case 0: | ||
setCurrentTab(ROUTE.WAITING_MAIN) | ||
break | ||
case 1: | ||
setCurrentTab(ROUTE.PROCESS_MAIN) | ||
break | ||
case 2: | ||
setCurrentTab(ROUTE.HISTORY_MAIN) | ||
break | ||
default: | ||
setCurrentTab('error') | ||
} | ||
setFocusedIdx(i) | ||
onClick() | ||
} | ||
|
||
return ( | ||
<Container> | ||
{items.map((item, i) => ( | ||
<NavBarItem | ||
name={item.name} | ||
count={item.count} | ||
isFocused={i === focusedIdx} | ||
onClick={() => onClickItem(i, item.onClick)} | ||
/> | ||
))} | ||
</Container> | ||
) | ||
} | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
` |
Oops, something went wrong.