Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] 공통 컴포넌트 구현 #31

Merged
merged 4 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions frontend/package-lock.json

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

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"styled-components": "^6.0.3"
},
"devDependencies": {
"@types/react": "^18.2.14",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.6",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
Expand Down
3 changes: 0 additions & 3 deletions frontend/public/close-danger.svg

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/public/close.svg

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/public/edit.svg

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/public/log.svg

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/public/plus.svg

This file was deleted.

89 changes: 22 additions & 67 deletions frontend/src/App.tsx
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;
Loading