Skip to content
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
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
lint-and-format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -23,9 +23,6 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

- name: Check Prettier formatting
run: npx prettier --check "src/**/*.{ts,tsx,js,jsx,json,css}"

Expand Down
4 changes: 3 additions & 1 deletion src/components/CardList/StockCard/StockCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ export const SmallStockCard = ({
</SmallStockCardContentScore>
</SmallStockCardContentTitle>
<SmallStockCardContentKeywords>
{keywords?.map((e) => <p key={`STOCK_${stockId}_KEYWORD_${e}`}>#{e}</p>)}
{keywords?.map((e) => (
<p key={`STOCK_${stockId}_KEYWORD_${e}`}>#{e}</p>
))}
</SmallStockCardContentKeywords>
</SmallStockCardContent>
</SmallStockCardContainer>
Expand Down
50 changes: 24 additions & 26 deletions src/components/Common/ContentsItem.Style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,35 @@ const ContentsItemContainer = styled.div({
},
});

const ContentsItemTitle = styled.div<{ color?: themeColor }>(
({ color }) =>
css({
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
gap: '8px',
color: theme.colors.grayscale10,
...theme.font.title20Semibold,
const ContentsItemTitle = styled.div<{ color?: themeColor }>(({ color }) =>
css({
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
gap: '8px',
color: theme.colors.grayscale10,
...theme.font.title20Semibold,

['.btn_info']: {
height: '0.8em',
marginLeft: '4px',
cursor: 'pointer',
},
['.btn_info']: {
height: '0.8em',
marginLeft: '4px',
cursor: 'pointer',
},

['svg']: {
width: 'auto',
height: '0.9em',
fill: color ? theme.colors[color] : '',
},
['svg']: {
width: 'auto',
height: '0.9em',
fill: color ? theme.colors[color] : '',
},

[media[0]]: {
gap: '6px',
[media[0]]: {
gap: '6px',

['.btn_info']: {
marginLeft: '0px',
},
['.btn_info']: {
marginLeft: '0px',
},
})
},
}),
);

const ContentsItemContent = styled.div({
Expand All @@ -55,7 +54,6 @@ const ContentsItemContent = styled.div({
},
});


export const DetailText = styled.div({
...theme.font.detail12Medium,
color: theme.colors.sub_gray6,
Expand Down
7 changes: 5 additions & 2 deletions src/components/Home/StockTable/StockTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { diffToPercent, diffToValue } from '@utils/ScoreConvert';
import { useQueryComponent } from '@hooks/useQueryComponent';
import { webPath } from '@router/index';
import StockImage from '@components/Common/StockImage';
import { StockTableInfo } from '@controllers/stocks/types';
import { useStockTableInfoQuery } from '@controllers/stocks/query';
import { StockTableInfo } from '@controllers/stocks/types';
import { HomeItemTitle } from '../Title/Title.Style';
import {
StockTableContainer,
Expand Down Expand Up @@ -80,7 +80,10 @@ const StockTable = ({ country }: { country: StockCountryKey }) => {
<p>{stock.symbolName}</p>
</StockTableItemSymbol>
<StockTableItemPrice delta={stock.priceDiff}>
<p className="price">{currency}{stock.price.toLocaleString()}</p>
<p className="price">
{currency}
{stock.price.toLocaleString()}
</p>
<p className="diff">
{diffToValue(stock.priceDiff)}(
{diffToPercent(stock.price, stock.priceDiff, { fixed: 2, sign: false })})
Expand Down
38 changes: 17 additions & 21 deletions src/components/Lab/Common.Style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import styled from '@emotion/styled';
import { theme } from '@styles/themes';

Expand All @@ -21,17 +20,16 @@ export const TopBar = styled.div<{ statusRate: number }>`
border-bottom: 4px solid ${theme.colors.sub_gray11};

&::before {
content: '';
position: absolute;
bottom: -4px;
left: 0;
height: 4px;
width: ${({ statusRate }) => `${statusRate}%`};
background: ${theme.colors.sub_gray9};
}
width: ${({ statusRate }) => `${statusRate}%`};
height: 4px;
content: '';
}
`;


export const BackIcon = styled.div`
position: absolute;
left: 20px;
Expand All @@ -54,7 +52,7 @@ export const TabContainer = styled.div`

export const InnerContainer = styled.div`
padding: 24px;
padding-bottom: 120px;
padding-bottom: 120px;
overflow-y: auto;
justify-content: space-between;
`;
Expand All @@ -76,35 +74,35 @@ export const NavButtonContainer = styled.div`
margin-top: 100px;
`;

export const NavButton = styled.button<{ next?: boolean, active?: boolean }>`
export const NavButton = styled.button<{ next?: boolean; active?: boolean }>`
${theme.font.body18Semibold};
flex: 1;
padding: 12px;
margin: 0 4px;
border-radius: 8px;
border: none;
background: ${({ next, active }) => active ? theme.colors.sub_blue6 : next ? theme.colors.sub_gray8 : theme.colors.sub_gray11};
color: ${({ next, active }) => active ? theme.colors.sub_white : next ? theme.colors.sub_black : theme.colors.sub_gray5};

background: ${({ next, active }) =>
active ? theme.colors.sub_blue6 : next ? theme.colors.sub_gray8 : theme.colors.sub_gray11};
color: ${({ next, active }) =>
active ? theme.colors.sub_white : next ? theme.colors.sub_black : theme.colors.sub_gray5};
`;

export const IndustryTag = styled.div<{ selected: boolean }>`
padding: 8px 16px;
background: ${({ selected }) => selected ? theme.colors.sub_blue6 : theme.colors.sub_gray10};
color: ${({ selected }) => selected ? theme.colors.sub_white : theme.colors.sub_gray6};
background: ${({ selected }) => (selected ? theme.colors.sub_blue6 : theme.colors.sub_gray10)};
color: ${({ selected }) => (selected ? theme.colors.sub_white : theme.colors.sub_gray6)};
border-radius: 50px;
`;


export const SearchInput = styled.input`
background: transparent;
border: none;
outline: none;
flex: 1;
color: white;
&::placeholder{
${theme.font.body16Medium}

&::placeholder {
${theme.font.body16Medium}
color: ${theme.colors.sub_gray7};
}
`;
Expand All @@ -118,14 +116,13 @@ export const SearchIconWrapper = styled.div`

export const SearchBar = styled.div`
background: ${theme.colors.sub_gray11};
color:white;
color: white;
border-radius: 8px;
display: flex;
align-items: center;
padding: 10px 12px;
`;


export const ToastStyle = styled.div`
${theme.font.detail12Semibold}
color:${theme.colors.sub_gray2};
Expand All @@ -134,7 +131,7 @@ export const ToastStyle = styled.div`
left: 50%;
transform: translateX(-50%);
padding: 12px 16px;
background: rgba(0, 0, 0, 0.80);
background: rgba(0, 0, 0, 0.8);
border: 1px solid rgba(73, 80, 87, 0.5);
border-radius: 5px;
z-index: 1000;
Expand All @@ -149,7 +146,6 @@ export const ToastStyle = styled.div`
justify-content: center;
`;


export const Divider = styled.div`
background-color: ${theme.colors.sub_gray11};
width: calc(100% + 48px);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Lab/ExperimentItem/ExperimentItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getFormattedDate } from '@utils/dateFormatter';
import StockImage from '@components/Common/StockImage';
import { ExperimentItem } from '@controllers/experiment/api';
import { ColoredDiffLabel, ExperimentItemContainer, ExperimentItemContent } from './ExperimentItem.Style';
import { getFormattedDate } from '@utils/dateFormatter';

const ExperimentItemComponent = ({
experiment,
Expand Down
10 changes: 5 additions & 5 deletions src/components/Modal/Common.Style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from "@emotion/styled";
import { theme } from "@styles/themes";
import styled from '@emotion/styled';
import { theme } from '@styles/themes';

export const Modal = styled.div`
position: fixed;
Expand Down Expand Up @@ -56,9 +56,9 @@ export const ModalButtons = styled.div`
export const ModalButton = styled.button`
flex: 1;
background: ${theme.colors.sub_gray2};
color: ${theme.colors.sub_gray8};
color: ${theme.colors.sub_gray8};
border: none;
padding: 12px 0;
padding: 12px 0;
border-radius: 500px;
font-size: 18px;
font-weight: 700;
Expand All @@ -68,4 +68,4 @@ export const ModalButton = styled.button`
export const ModalButtonPrimary = styled(ModalButton)`
background: ${theme.colors.sub_black};
color: ${theme.colors.sub_white};
`;
`;
28 changes: 14 additions & 14 deletions src/components/Modal/ExperimentDetail/ExperimentDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useEffect, useMemo, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { STOCK_COUNTRY_MAP } from '@ts/StockCountry';
import { getFormattedDate } from '@utils/dateFormatter';
import { webPath } from '@router/index';
import StockImage from '@components/Common/StockImage';
import { ExperimentDetailTradeInfo } from '@controllers/experiment/api';
import { useExperimentDetailQuery } from '@controllers/experiment/query';
import { theme } from '@styles/themes';
import { getFormattedDate } from '@utils/dateFormatter';
import {
ColoredDiffLabel,
ExperimentDetailChartContainer,
Expand Down Expand Up @@ -266,19 +266,19 @@ const ExperimentDetailChart = ({

return selectedTradeInfo
? [
{
name: '인간지표',
value: `${currentScore}점`,
diff: `(${scoreDiffSign}${scoreDiff}점)`,
delta: scoreDiff,
},
{
name: '수익률',
value: `${roiDiffSign}${roi.toFixed(1)}%`,
diff: `(${roiDiffSign}${roiDiff.toFixed(1)}%)`,
delta: roiDiff,
},
]
{
name: '인간지표',
value: `${currentScore}점`,
diff: `(${scoreDiffSign}${scoreDiff}점)`,
delta: scoreDiff,
},
{
name: '수익률',
value: `${roiDiffSign}${roi.toFixed(1)}%`,
diff: `(${roiDiffSign}${roiDiff.toFixed(1)}%)`,
delta: roiDiff,
},
]
: null;
}, [selectedTradeInfo, buyScore, buyPrice]);
return (
Expand Down
2 changes: 0 additions & 2 deletions src/components/MyPage/MyPage.Style.ts
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@


12 changes: 11 additions & 1 deletion src/components/NoLoginWrapper/NoLoginWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ const NoLoginWrapper = (props: NoLoginWrapperProps) => {
const { isLogin, handleNavigateLogin } = useAuthInfo();
const navigate = useNavigate();

const { title, description, buttonText, children, className, SecondaryButtonText, hasHeader, hasNavbar, returnState } = props;
const {
title,
description,
buttonText,
children,
className,
SecondaryButtonText,
hasHeader,
hasNavbar,
returnState,
} = props;

const handleClick = () => {
handleNavigateLogin({ returnState });
Expand Down
5 changes: 1 addition & 4 deletions src/components/PopUp/DescentPopUp/DescentPopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ const ZipyoPopUp = ({ onClose }: { onClose: () => void }) => (
<CommonPopUp onClose={onClose}>
<PopUpTitle>💧 현재 민심 급하락 중</PopUpTitle>
<PopUpContent>
<div>
현재 각종 주식 커뮤니티에서
투자자들의 민심이 부정적으로 급하락 중인 종목입니다.
</div>
<div>현재 각종 주식 커뮤니티에서 투자자들의 민심이 부정적으로 급하락 중인 종목입니다.</div>
</PopUpContent>
</CommonPopUp>
);
Expand Down
4 changes: 1 addition & 3 deletions src/components/PopUp/HotPopUp/HotPopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ const HotPopUp = ({ onClose }: { onClose: () => void }) => (
<CommonPopUp onClose={onClose}>
<PopUpTitle>👑 현재 시장 반응 TOP 3</PopUpTitle>
<PopUpContent>
<div>
한국투자증권’ 순위를 기반으로 집계됩니다.
</div>
<div>한국투자증권’ 순위를 기반으로 집계됩니다.</div>
</PopUpContent>
</CommonPopUp>
);
Expand Down
5 changes: 1 addition & 4 deletions src/components/PopUp/RisingPopUp/RisingPopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ const RisingPopUp = ({ onClose }: { onClose: () => void }) => (
<CommonPopUp onClose={onClose}>
<PopUpTitle>🔥 현재 민심 급상승 중</PopUpTitle>
<PopUpContent>
<div>
현재 각종 주식 커뮤니티에서
투자자들의 민심이 긍정적으로 급상승 중인 종목입니다.
</div>
<div>현재 각종 주식 커뮤니티에서 투자자들의 민심이 긍정적으로 급상승 중인 종목입니다.</div>
</PopUpContent>
</CommonPopUp>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/Search/SearchTitle/SearchTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ const SearchTitle = ({ stockInfo }: { stockInfo: StockDetailInfo }) => {
navigate(webPath.labStep(), { state: { step: 4 } });
};


return (
stockInfo && (
<SearchTitleContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/StockChart/StockChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const useResizeObserver = <T extends HTMLElement>(): [any, React.RefObject<T>] =
if (!element) return;

const resizeObserver = new ResizeObserver((entries) => {
for (let entry of entries) {
for (const entry of entries) {
const { width, height } = entry.contentRect;
setSize({
width,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Text/Text.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';
import { TextBodyProps, TextDetailProps, TextDisplayProps, TextHeadingProps, TextTitleProps } from './Text.Props';
import { media, theme } from '../../styles/themes';
import { TextBodyProps, TextDetailProps, TextDisplayProps, TextHeadingProps, TextTitleProps } from './Text.Props';

/**
* TextHeading
Expand Down
Loading