Skip to content

Commit

Permalink
[Fix] 빌드 오류 해결
Browse files Browse the repository at this point in the history
- 빌드 시 오류 발생하는 코드 수정

Issues #122
  • Loading branch information
novice1993 committed Sep 30, 2023
1 parent bd65581 commit dff02ab
Show file tree
Hide file tree
Showing 27 changed files with 105 additions and 103 deletions.
2 changes: 1 addition & 1 deletion client/src/components/CentralChart/CompareList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useSelector, useDispatch } from "react-redux";
import { setCompareStock } from "../../reducer/compareChart-Reducer";
import { setCompareStock } from "../../reducer/CompareChart-Reducer";
import { StateProps } from "../../models/stateProps";
import { styled } from "styled-components";

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/CentralChartMenu/ExpandScreenBtn.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "react";
import { useSelector, useDispatch } from "react-redux";
import { styled } from "styled-components";
import { changeLeftScreen, changeRightScreen } from "../../reducer/expandScreen-Reducer";
import { changeLeftScreen, changeRightScreen } from "../../reducer/ExpandScreen-Reducer";
import { StateProps } from "../../models/stateProps";

const ExpandScreenBtn = (props: OwnProps) => {
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/CentralChartMenu/StockOrderBtn.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useDispatch } from "react-redux";
import { styled } from "styled-components";
import { stockOrderOpen } from "../../reducer/stockOrderSet-Reducer";
import { orderTypeBuying, orderTypeSelling } from "../../reducer/stockOrderType-Reducer";
import { stockOrderOpen } from "../../reducer/StockOrderSet-Reducer";
import { orderTypeBuying, orderTypeSelling } from "../../reducer/StockOrderType-Reducer";

const StockOrderBtn = (props: OwnProps) => {
const { type } = props;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/EntireList/StockItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from "react";
import styled from "styled-components";

import { useDispatch } from "react-redux";
import { changeCompanyId } from "../../reducer/companyId-Reducer";
import { changeCompanyId } from "../../reducer/CompanyId-Reducer";

import logo from "../../asset/icon/StockHolmImage.png";
import star_icon from "../../asset/icon/star_icon.png";
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Headers/LoginHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useEffect, useState } from "react";
import styled from "styled-components";
import StockHolmLogo from "../../asset/logos/StockHolmLogo.png";
// import SampleProfile from "../../asset/images/ProfileSample.png";
import ProfileModal from "../Profile/ProfileModal";
import StockSearchComponent from "./StockSearchComponent";
import ProfileModal from "../Profile/profileModal";
import StockSearchComponent from "./stockSearchComponent";
import { setLogoutState } from "../../reducer/member/loginSlice";
import { useDispatch } from "react-redux";
import { useGetMemberInfo } from "../../hooks/useGetMemberInfo"; // import the hook
Expand Down
3 changes: 1 addition & 2 deletions client/src/components/Headers/LogoutHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from "react";
import styled from "styled-components";
import StockHolmLogo from "../../asset/logos/StockHolmLogo.png";

import StockSearchComponent from "./StockSearchComponent";
import StockSearchComponent from "./stockSearchComponent";

const LogoutHeader: React.FC<LogoutHeaderProps> = ({ onLoginClick }) => {
const loginText = "로그인"; // 로그인 버튼 텍스트
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Headers/stockSearchComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from "react";
import { useDispatch } from "react-redux";
import styled from "styled-components";
import { toast } from "react-toastify";
import { changeCompanyId } from "../../reducer/companyId-Reducer";
import { changeCompanyId } from "../../reducer/CompanyId-Reducer";
import useGetCompanyList from "../../hooks/useGetCompanyList";

const stockSearch = "종목 검색";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/HoldingList/StockItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from "react";
import styled from "styled-components";
import logo from "../../asset/icon/StockHolmImage.png";
import { useDispatch } from "react-redux";
import { changeCompanyId } from "../../reducer/companyId-Reducer";
import { changeCompanyId } from "../../reducer/CompanyId-Reducer";

import star_icon from "../../asset/icon/star_icon.png";
import star_filled_icon from "../../asset/icon/star_filled_icon.png";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/MarketComponents/MarketStockList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from "axios";
import { useState, useEffect } from "react";
import styled from "styled-components";
import { useDispatch } from "react-redux";
import { changeCompanyId } from "../../reducer/companyId-Reducer";
import { changeCompanyId } from "../../reducer/CompanyId-Reducer";
import logo from "../../asset/icon/StockHolmImage.png";

import kia from "../../asset/logos/기아.svg";
Expand Down
120 changes: 61 additions & 59 deletions client/src/components/Profile/profileModal.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,51 @@
import React, { useState, useCallback } from 'react';
import styled from 'styled-components';
import MemberInfoModal from './MemberInfoModal';
import MemberWithdrawalModal from './MemberWithdrawalModal';
import CashModal from './CashModal';
import React, { useState, useCallback } from "react";
import styled from "styled-components";
import MemberInfoModal from "./memberInfoModal";
import MemberWithdrawalModal from "./memberWithdrawalModal";
import CashModal from "./CashModal";

const ProfileModal: React.FC<ProfileModalProps> = ({ onClose }) => {
const memberInfoText = "회원정보";
const cashText = "현금";
const memberWithdrawText = "회원탈퇴";
const memberInfoText = "회원정보";
const cashText = "현금";
const memberWithdrawText = "회원탈퇴";

const [selectedTab, setSelectedTab] = useState(1);
const [isErrorVisible, setIsErrorVisible] = useState(false);
const [selectedTab, setSelectedTab] = useState(1);
const [isErrorVisible, setIsErrorVisible] = useState(false);

const handleErrorVisibility = useCallback((visibility: boolean) => {
setIsErrorVisible(visibility);
}, []);
const handleErrorVisibility = useCallback((visibility: boolean) => {
setIsErrorVisible(visibility);
}, []);

return (
<ModalBackground>
<ModalContainer>
<Tabs>
<TabButton isActive={selectedTab === 1} onClick={() => setSelectedTab(1)}>{memberInfoText}</TabButton>
<TabButton isActive={selectedTab === 2} onClick={() => setSelectedTab(2)}>{cashText}</TabButton>
<TabButton isActive={selectedTab === 3} onClick={() => setSelectedTab(3)}>{memberWithdrawText}</TabButton>
</Tabs>
<TabContent isErrorVisible={isErrorVisible}>
{selectedTab === 1 && <MemberInfoModal onClose={onClose} />}
{selectedTab === 2 && <CashModal onClose={onClose} />}
{selectedTab === 3 && <MemberWithdrawalModal onErrorVisibility={handleErrorVisibility} onClose={onClose} />}
</TabContent>

</ModalContainer>
</ModalBackground>
);
return (
<ModalBackground>
<ModalContainer>
<Tabs>
<TabButton isActive={selectedTab === 1} onClick={() => setSelectedTab(1)}>
{memberInfoText}
</TabButton>
<TabButton isActive={selectedTab === 2} onClick={() => setSelectedTab(2)}>
{cashText}
</TabButton>
<TabButton isActive={selectedTab === 3} onClick={() => setSelectedTab(3)}>
{memberWithdrawText}
</TabButton>
</Tabs>
<TabContent isErrorVisible={isErrorVisible}>
{selectedTab === 1 && <MemberInfoModal onClose={onClose} />}
{selectedTab === 2 && <CashModal onClose={onClose} />}
{selectedTab === 3 && <MemberWithdrawalModal onErrorVisibility={handleErrorVisibility} onClose={onClose} />}
</TabContent>
</ModalContainer>
</ModalBackground>
);
};

export default ProfileModal;


interface ProfileModalProps {
onClose: () => void;
onClose: () => void;
}


// 모달 배경 스타일
const ModalBackground = styled.div`
z-index: 1000;
Expand All @@ -65,40 +68,39 @@ const ModalContainer = styled.div`
height: 300px;
border-radius: 10px;
display: flex;
flex-direction: column;
flex-direction: column;
align-items: center;
background-color: none; // 배경색을 하얀색으로 변경
background-color: none; // 배경색을 하얀색으로 변경
`;

const Tabs = styled.div`
display: flex;
justify-content: space-between;
width: 100%;
margin-bottom: 0px;
z-index: 1002; // 이 값을 추가하여 Tabs를 최상위로 올립니다.
display: flex;
justify-content: space-between;
width: 100%;
margin-bottom: 0px;
z-index: 1002; // 이 값을 추가하여 Tabs를 최상위로 올립니다.
`;

// TabButton 컴포넌트 스타일링
const TabButton = styled.button<{ isActive?: boolean }>`
flex: 1;
padding: 10px;
border: 1px solid lightgray;
border-bottom: ${({ isActive }) => (isActive ? '3px solid darkslategray' : '1px solid lightgray')};
border-radius: 5px;
cursor: pointer;
background-color: #FFFFFF;
color: darkslategray;
flex: 1;
padding: 10px;
border: 1px solid lightgray;
border-bottom: ${({ isActive }) => (isActive ? "3px solid darkslategray" : "1px solid lightgray")};
border-radius: 5px;
cursor: pointer;
background-color: #ffffff;
color: darkslategray;
`;

const TabContent = styled.div<{ isErrorVisible: boolean }>`
width: 100%;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
overflow-y: auto;
position: top;
min-height: 200px;
`;
width: 100%;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
overflow-y: auto;
position: top;
min-height: 200px;
`;
2 changes: 1 addition & 1 deletion client/src/components/StockOrderSection/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useGetCash from "../../hooks/useGetCash";
import useGetStockOrderRecord from "../../hooks/useGetStockOrderRecord";
import useGetHoldingStock from "../../hooks/useGetHoldingStock";
import useGetCompanyList from "../../hooks/useGetCompanyList";
import { stockOrderClose } from "../../reducer/stockOrderSet-Reducer";
import { stockOrderClose } from "../../reducer/StockOrderSet-Reducer";
import { StateProps } from "../../models/stateProps";
import { dummyLogo } from "../../dummy/dummyLogo";
import StockOrder from "./StockOrder";
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/StockOrderSection/OrderDecisionBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { styled } from "styled-components";
import useGetCash from "../../hooks/useGetCash";
import { StateProps } from "../../models/stateProps";
import { OrderTypeProps } from "../../models/orderTypeProps";
import { setStockOrderVolume } from "../../reducer/stockOrderVolume-Reducer";
import { openDecisionWindow } from "../../reducer/setDecisionWindow-Reducer";
import { setStockOrderVolume } from "../../reducer/StockOrderVolume-Reducer";
import { openDecisionWindow } from "../../reducer/SetDecisionWindow-Reducer";
import { priceUnit } from "../../constant/constant";

const availableMoneyText: string = "최대";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/StockOrderSection/PriceSetting.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";
import { styled } from "styled-components";
import { setStockOrderPrice, plusStockOrderPrice, minusStockOrderPrice } from "../../reducer/stockOrderPrice-Reducer";
import { setStockOrderPrice, plusStockOrderPrice, minusStockOrderPrice } from "../../reducer/StockOrderPrice-Reducer";
import { StateProps } from "../../models/stateProps";
import { StockInfoProps } from "../../models/stockInfoProps";
import { priceUnit } from "../../constant/constant";
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/StockOrderSection/StockOrder.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useSelector, useDispatch } from "react-redux";
import { isHoliday } from "@hyunbinseo/holidays-kr";
import { setStockOrderVolume } from "../../reducer/stockOrderVolume-Reducer";
import { closeDecisionWindow } from "../../reducer/setDecisionWindow-Reducer";
import { setStockOrderVolume } from "../../reducer/StockOrderVolume-Reducer";
import { closeDecisionWindow } from "../../reducer/SetDecisionWindow-Reducer";
import { styled } from "styled-components";
import { toast } from "react-toastify";
import { StateProps } from "../../models/stateProps";
Expand Down Expand Up @@ -95,8 +95,8 @@ const StockOrder = ({ corpName }: { corpName: string }) => {
const isAfter330PM = currentHour > 15 || (currentHour === 15 && currentMinute >= 30);
const marketCloseTime = isBefore9AM || isAfter330PM;

const orderFailureCase01 = false;
// const orderFailureCase01 = !isBusinessDay || marketCloseTime;
// const orderFailureCase01 = false;
const orderFailureCase01 = !isBusinessDay || marketCloseTime;
const orderFailureCase02 = orderPrice === 0 || orderVolume === 0;

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useSelector, useDispatch } from "react-redux";
import useGetStockInfo from "../../hooks/useGetStockInfo";
import { orderTypeBuying, orderTypeSelling } from "../../reducer/stockOrderType-Reducer";
import { orderTypeBuying, orderTypeSelling } from "../../reducer/StockOrderType-Reducer";
import { styled } from "styled-components";
import { StateProps } from "../../models/stateProps";
import { OrderTypeProps } from "../../models/orderTypeProps";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/StockOrderSection/StockPrice.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect, useRef } from "react";
import { useSelector, useDispatch } from "react-redux";
import { styled } from "styled-components";
import { setStockOrderPrice } from "../../reducer/stockOrderPrice-Reducer";
import { setStockOrderPrice } from "../../reducer/StockOrderPrice-Reducer";
import { StateProps } from "../../models/stateProps";

const changeRateUnit = `%`;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/StockOrderSection/VolumeSetteing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useGetCash from "../../hooks/useGetCash";
import useGetHoldingStock from "../../hooks/useGetHoldingStock";
import { StateProps } from "../../models/stateProps";
import { HoldingStockProps } from "../../models/stockProps";
import { setStockOrderVolume, plusStockOrderVolume, minusStockOrderVolume } from "../../reducer/stockOrderVolume-Reducer";
import { setStockOrderVolume, plusStockOrderVolume, minusStockOrderVolume } from "../../reducer/StockOrderVolume-Reducer";
import { volumeUnit } from "../../constant/constant";

const volumeSettingTitle: string = "수량";
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/communityComponents/Comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { useState, useEffect } from "react";
import styled from "styled-components";
import { toast } from "react-toastify";
import axios from "axios";
import { ProFileImage } from "./IconComponent/Icon.tsx";
import { ProFileImage } from "./IconComponent/Icon";

const Comments = ({ boardId }: { boardId: number }) => {
const [commentData, setCommentData] = useState([]);
const [commentsValue, setCommentsValue] = useState("");
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/stockinfoComponents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from "styled-components";
import { useState } from "react";
import { useSelector } from "react-redux";
import { RootState } from "../../store/config";
import PortFolioChart from "./StockinfoChart";
import PortFolioChart from "./stockinfoChart";

const DetailStockInformation: React.FC = () => {
// Redux의 companyId 상태를 구독합니다.
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/watchlist/StockItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import logo from "../../asset/icon/StockHolmImage.png";
import deleteIcon from "../../asset/icon/delete_icon.png";
import useDeleteStar from "../../hooks/stars/useDeletestars";
import { useDispatch } from "react-redux";
import { changeCompanyId } from "../../reducer/companyId-Reducer";
import { changeCompanyId } from "../../reducer/CompanyId-Reducer";

import kia from "../../asset/logos/기아.svg";
import dy from "../../asset/logos/디와이.jpeg";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/watchlist/StockSearchComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import { useDispatch } from "react-redux";
import styled from "styled-components";
import { changeCompanyId } from "../../reducer/companyId-Reducer";
import { changeCompanyId } from "../../reducer/CompanyId-Reducer";
import useGetCompanyList from "../../hooks/useGetCompanyList";

const stockSearch = "종목 검색";
Expand Down
4 changes: 2 additions & 2 deletions client/src/hooks/useGetStockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const useGetStockData = (companyId: number) => {
const currentMinute = today.getMinutes();
const isBefore9AM = currentHour < 9;
const isAfter330PM = currentHour > 15 || (currentHour === 15 && currentMinute >= 30);
const marketOpenTime = !isBefore9AM || !isAfter330PM;
const marketCloseTime = isBefore9AM || isAfter330PM;

const dataRenewalTime = isBusinessDay || marketOpenTime;
const dataRenewalTime = isBusinessDay || !marketCloseTime;

// 개장 시간 이내일 경우, 현재 시각이 30분, 정각이 아닌 경우 남은 시간 계산하여 checkTime 함수 다시 실행
useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions client/src/page/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import CentralChart from "../components/CentralChart/Index";

import EntireList from "../components/EntireList/EntireList";
import HoldingList from "../components/HoldingList/HoldingList";
import WatchList from "../components/Watchlist/WatchList";
import WatchList from "../components/watchlist/WatchList";
import StockOrderSection from "../components/StockOrderSection/Index";

import ProfileModal from "../components/Profile/ProfileModal";
import ProfileModal from "../components/Profile/profileModal";
import { StateProps } from "../models/stateProps";
import { TabContainerPage } from "./TabPages/TabContainerPage";

Expand Down
2 changes: 1 addition & 1 deletion client/src/page/TabPages/MarketInfoPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from "styled-components";
import React, { useState } from "react";
import MarketSummary from "../../components/MarketComponents/Index";
import MarketSummary from "../../components/MarketComponents/index";
import MarketStockList from "../../components/MarketComponents/MarketStockList";

interface Props {}
Expand Down
6 changes: 3 additions & 3 deletions client/src/page/TabPages/TabContainerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { StateProps } from "../../models/stateProps";
import MarketInfo from "./MarketInfoPage";
import { Routes, Route, Link } from "react-router-dom";
import styled from "styled-components";
import DetailStockInformation from "../../components/StockinfoComponents/Index";
import { Community } from "./CommunityPage";
import DetailStockInformation from "../../components/stockinfoComponents/index";
import { Community } from "./communityPage";
import { useState } from "react";
import { MarketImages, InfoImages, CommunityImages } from "../../components/CommunityComponents/IconComponent/Icon";
import { MarketImages, InfoImages, CommunityImages } from "../../components/communityComponents/IconComponent/Icon";
import { useLocation } from "react-router-dom";
export const TabContainerPage = () => {
const location = useLocation();
Expand Down
Loading

0 comments on commit dff02ab

Please sign in to comment.