Skip to content

Commit

Permalink
[Feat] 브랜치 병합
Browse files Browse the repository at this point in the history
- 좌측 비교차트 관련 컴포넌트 구현이로 인한 브랜치 병합

Issues #12
  • Loading branch information
novice1993 committed Sep 4, 2023
2 parents 7764e4d + 5628af3 commit 7a700ac
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 12 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions client/src/components/CompareChartSection/CompareList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { styled } from "styled-components";

const emptyMessage: string = `현재 비교 중인 종목이 없습니다
비교하고 싶은 항목을 추가해보세요`;

const CompareList = () => {
return (
<Container>
<EmptyIndicator>{emptyMessage}</EmptyIndicator>
</Container>
);
};

export default CompareList;

const Container = styled.div`
flex: 1 0 0;
`;

const EmptyIndicator = styled.div`
height: 70%;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
color: #999999;
padding-left: 18px;
padding-right: 18px;
white-space: pre-wrap;
text-align: center;
line-height: 20px;
`;
60 changes: 60 additions & 0 deletions client/src/components/CompareChartSection/Index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { styled } from "styled-components";

import SearchBox from "./SearchBox";
import CompareList from "./CompareList";

const titleText: string = "비교차트";

const CompareChartSection = () => {
return (
<Container>
<UpperBar>
<Title>{titleText}</Title>
<CloseBtn>&#10005;</CloseBtn>
</UpperBar>
<SearchBox />
<CompareList />
</Container>
);
};

export default CompareChartSection;

const Container = styled.div`
position: fixed;
left: -300px;
transition: 0.3s left ease-in-out;
display: flex;
flex-direction: column;
min-width: 248px;
height: 100%;
border: 1px solid black;
`;

const UpperBar = styled.div`
position: relative;
width: 100%;
height: 43px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
border-bottom: 1px solid darkgray;
`;

const Title = styled.h2`
font-size: 17px;
font-weight: 500;
`;

const CloseBtn = styled.button`
position: absolute;
right: 10px;
width: 28px;
height: 95%;
border: none;
font-size: 17px;
font-weight: 500;
color: #525252;
background-color: #ffff;
`;
38 changes: 38 additions & 0 deletions client/src/components/CompareChartSection/SearchBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { styled } from "styled-components";
import searchIcon from "../../asset/CompareChartSection-SearchIcon.png";

const SearchBox = () => {
return (
<Container>
<SearchIcon src={searchIcon} />
<SeachBar placeholder="종목명 또는 코드 입력" />
</Container>
);
};

export default SearchBox;

const Container = styled.div`
width: 100%;
height: 39px;
padding-left: 12px;
padding-right: 12px;
border-bottom: 1px solid darkgray;
display: flex;
flex-direction: row;
align-items: center;
gap: 6px;
`;

const SearchIcon = styled.img`
width: 20px;
height: 20px;
`;

const SeachBar = styled.input`
flex: 1 0 0;
height: 26px;
border: none;
padding-left: 2px;
`;
2 changes: 1 addition & 1 deletion client/src/components/StockOrderSection/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default StockOrderSection;

const Container = styled.aside`
position: fixed;
right: 0px;
right: -500px;
transition: right 0.3s ease-in-out;
display: flex;
flex-direction: column;
Expand Down
16 changes: 5 additions & 11 deletions client/src/page/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import EmailVerificationModal from "../components/Signups/EmailCertify";
import PasswordSettingModal from "../components/Signups/Password";

import CentralChartSection from "../components/CentralChartSection/Index";
import CompareChartSection from "../components/CompareChartSection/Index";
import StockOrderSection from "../components/StockOrderSection/Index";

const MainPage = () => {
Expand Down Expand Up @@ -42,8 +43,7 @@ const MainPage = () => {
setEmailSignupModalOpen(false);
}, []);

const [isEmailVerificationModalOpen, setEmailVerificationModalOpen] =
useState(false);
const [isEmailVerificationModalOpen, setEmailVerificationModalOpen] = useState(false);

const openEmailVerificationModal = useCallback(() => {
setEmailSignupModalOpen(false); // 이메일 회원가입 모달 닫기
Expand All @@ -54,8 +54,7 @@ const MainPage = () => {
setEmailVerificationModalOpen(false);
}, []);

const [isPasswordSettingModalOpen, setPasswordSettingModalOpen] =
useState(false);
const [isPasswordSettingModalOpen, setPasswordSettingModalOpen] = useState(false);

const openPasswordSettingModal = useCallback(() => {
setEmailVerificationModalOpen(false); // 이메일 인증 모달 닫기
Expand Down Expand Up @@ -84,18 +83,13 @@ const MainPage = () => {
<LogoutHeader onLoginClick={openOAuthModal} />
)}
<Main>
<CompareChartSection />
<LeftSection></LeftSection>
<CentralChartSection />
<StockOrderSection />
<RightSection></RightSection>
</Main>
{isOAuthModalOpen && (
<OAuthLoginModal
onClose={closeOAuthModal}
onEmailLoginClick={openEmailLoginModal}
onEmailSignupClick={openEmailSignupModal}
/>
)}
{isOAuthModalOpen && <OAuthLoginModal onClose={closeOAuthModal} onEmailLoginClick={openEmailLoginModal} onEmailSignupClick={openEmailSignupModal} />}
{isEmailLoginModalOpen && (
<EmailLoginModal
onClose={closeEmailLoginModal}
Expand Down

0 comments on commit 7a700ac

Please sign in to comment.