forked from codesquad-members-2023/todo-max
-
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.
* feat, refactor: 공통 컴포넌트 개발 및 리팩토링 * feat: 공통 컴포넌트 개발 * chore: 디렉토리 구조 변경
- Loading branch information
1 parent
70ed720
commit 3052149
Showing
41 changed files
with
1,017 additions
and
565 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,72 +1,27 @@ | ||
import { useState, useRef } from "react"; | ||
import styled, { ThemeProvider } from "styled-components"; | ||
import Board from "./components/Board"; | ||
import HistoryBtn from "./components/HistoryBtn"; | ||
import Logo from "./components/Logo"; | ||
import Modal from "./components/Modal"; | ||
import Header from "./components/landmark/Header"; | ||
import Main from "./components/landmark/Main"; | ||
import CommonStyle from "./styles/CommonStyle"; | ||
import { theme } from "./theme"; | ||
import { TTheme } from "./types/theme"; | ||
|
||
export default function App() { | ||
const [isUserLogOpened, setIsUserLogOpened] = useState<boolean>(false); | ||
const [message, setMessage] = useState<string>(""); | ||
const callbackTemp = useRef<() => void | undefined>(); | ||
|
||
function clearMessage() { | ||
setMessage(""); | ||
} | ||
|
||
function dummyAction() { | ||
clearMessage(); | ||
if (callbackTemp.current) { | ||
callbackTemp.current(); | ||
} | ||
} | ||
|
||
function openConfirmModal(content: string, callback: () => void) { | ||
setMessage(content); | ||
callbackTemp.current = callback; | ||
} | ||
|
||
function toggleActiveUserLog() { | ||
setIsUserLogOpened((bool) => !bool); | ||
import { useState } from "react"; | ||
import Header from "./components/Header"; | ||
import Main from "./components/main/Main"; | ||
import Alert from "./components/common/Alert"; | ||
import Container from "./styles/Container"; | ||
import Aside from "./components/aside/Aside"; | ||
|
||
const App: React.FC = () => { | ||
const [isHistoryOpen, setIsHistoryOpen] = useState<boolean>(false); | ||
|
||
function toggleHistory() { | ||
setIsHistoryOpen((bool) => !bool); | ||
} | ||
|
||
return ( | ||
<ThemeProvider theme={theme}> | ||
<AppStyledDiv> | ||
<CommonStyle /> | ||
<Header> | ||
<Logo /> | ||
<HistoryBtn {...{ toggleActiveUserLog }} /> | ||
</Header> | ||
<Container> | ||
<Main> | ||
<Board handleDeleteButtonClick={openConfirmModal} /> | ||
</Main> | ||
{/* <Aside> | ||
<UserActionLogList /> | ||
</Aside> */} | ||
</Container> | ||
<Modal message={message} action={dummyAction} /> | ||
</AppStyledDiv>{" "} | ||
</ThemeProvider> | ||
<> | ||
<Header /> | ||
<Container> | ||
<Main /> | ||
{/* <Aside /> */} | ||
</Container> | ||
<Alert /> | ||
</> | ||
); | ||
} | ||
|
||
const AppStyledDiv = styled.div<{ theme: TTheme }>` | ||
position: relative; | ||
width: 100vw; | ||
height: 100vh; | ||
top: 0; | ||
left: 0; | ||
background-color: ${(props) => props.theme.color.surface.alt}; | ||
`; | ||
}; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
padding: calc(2.29rem - 4px) calc(5.8rem - 4px); | ||
`; | ||
export default App; |
Oops, something went wrong.