Skip to content

Commit

Permalink
поменял стили
Browse files Browse the repository at this point in the history
  • Loading branch information
19893381 authored and 19893381 committed Aug 2, 2024
1 parent 97cec3c commit 5d4380b
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 90 deletions.
49 changes: 33 additions & 16 deletions src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
--table-profit-color: 38, 165, 78;
}

h1{
padding: 0 16px;
}

.ant-btn-link {
color: rgb(var(--pro-link-color));
}
Expand Down Expand Up @@ -399,12 +403,6 @@ h1.ant-typography {
}
}

@media only screen and (max-width: 700px) {
.SearchContainer {
display: initial;
}
}

.MobilePosition {
display: none;

Expand All @@ -421,15 +419,16 @@ h1.ant-typography {
}
}

&:not(:last-child) {
margin-bottom: 16px;
}
//&:not(:last-child) {
// margin-bottom: 16px;
//}

.title-container {
display: flex;
justify-content: space-between;
width: 100%;
padding: 8px 20px;
padding: 8px 0;
//padding: 8px 20px;
}

.title {
Expand Down Expand Up @@ -723,12 +722,20 @@ header {
}

@media only screen and (max-width: 700px) {
h1.ant-typography{
margin-bottom: 0;
}

.body-content > * {
padding: 0 16px;
}

.widget {
width: 100%;
/*padding: 16px 20px;*/
padding: 8px 20px;
border-radius: 20px;
margin-top: 16px;
//margin-top: 16px;
}

.widget .widget_header {
Expand Down Expand Up @@ -756,6 +763,10 @@ header {
display: block;
}

//.slick-slide, .SearchContainer, h1{
// padding: 0 16px;
//}

.MobileSummaryCarousel, .ant-carousel {
display: block;
}
Expand All @@ -764,6 +775,10 @@ header {
display: block;
}

.SearchContainer {
display: block;
}

.mobile-position-spinner {
display: block;
}
Expand All @@ -777,11 +792,13 @@ header {
}

.body-content {
padding: 0 16px 16px !important;
}

.Diary {
padding: 0; /* 16px; */
& > *{
padding: 0 16px;
}
padding: 0 !important;
display: flex;
flex-direction: column;
gap: 16px;
}

.collapsed-row {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Analytics/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ const Analytics: FC<IProps> = ({getIsinBySymbol, getListSectionBySymbol, data, a

return <>
<Title>Аналитика</Title>
<ProfitWidget isLoading={isLoading} colors={nightMode && darkColors} data={balanceSeriesDataWithoutFirst}
initBalance={balanceSeriesData[0]?.value || 0}/>
<div><ProfitWidget isLoading={isLoading} colors={nightMode && darkColors} data={balanceSeriesDataWithoutFirst}
initBalance={balanceSeriesData[0]?.value || 0}/></div>
{/*<div className="widget">*/}
{/* <div className="widget_header">Reasons</div>*/}
{/* <HighchartsReact*/}
{/* highcharts={Highcharts}*/}
{/* options={reasonOptions}*/}
{/* />*/}
{/*</div>*/}
<div style={{display: 'flex', flexWrap: 'wrap', margin: '0 -1px'}}>
<div style={{display: 'flex', flexWrap: 'wrap', margin: '0 -1px', gap: '16px'}}>
<ProfitIntervalWidget nonSummaryPositions={nonSummaryPositions} isLoading={isLoading}/>
<LossIntervalWidget nonSummaryPositions={nonSummaryPositions} isLoading={isLoading}/>
<MaxProfitTradesWidget getIsinBySymbol={getIsinBySymbol} nonSummaryPositions={nonSummaryPositions} isLoading={isLoading}/>
Expand Down
147 changes: 76 additions & 71 deletions src/pages/Diary/Diary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -971,43 +971,45 @@ const Diary: FC<IProps> = ({
setSearchParams(searchParams);
}

return <div className="MobilePosition widget" key={summary.openDate}>
<div style={{display: 'flex', alignItems: 'end'}}>
<div className="title-container">
<div className="title">{moment(summary.openDate).format('DD.MM.YYYY')}</div>
<div style={{
display: 'inline-flex',
alignItems: 'end'
}}>
<div
className={`result ${summary.PnL > 0 ? 'profit' : 'loss'}`}>{summary.PnL > 0 ? '+' : ''}{moneyFormat(summary.PnL)}
{/*<span className='percent'>{shortNumberFormat(netProfitPercent)}%</span>*/}
return <div className="MobilePosition" key={summary.openDate}>
<div className="widget">
<div style={{display: 'flex', alignItems: 'end'}}>
<div className="title-container">
<div className="title">{moment(summary.openDate).format('DD.MM.YYYY')}</div>
<div style={{
display: 'inline-flex',
alignItems: 'end'
}}>
<div
className={`result ${summary.PnL > 0 ? 'profit' : 'loss'}`}>{summary.PnL > 0 ? '+' : ''}{moneyFormat(summary.PnL)}
{/*<span className='percent'>{shortNumberFormat(netProfitPercent)}%</span>*/}
</div>
</div>
</div>
</div>
</div>
{dayPositions.map(dp =>
<div
className={`ticker-info${selectKey === `${summary.openDate}-${dp.openDate}-${dp.symbol}` ? ' selected' : ''}`}
key={`${summary.openDate}-${dp.openDate}-${dp.symbol}`} onClick={() => handleSelectTicker(dp)}>
<div style={{display: 'flex'}}>
<TickerImg getIsinBySymbol={getIsinBySymbol} key={dp?.symbol} symbol={dp?.symbol}/>
<div className="ticker_name">
<div className="ticker_name_title">{dp?.symbol}</div>
<div className="ticker_name_description">
{moment(dp?.openDate).format('HH:mm:ss')}
{dayPositions.map(dp =>
<div
className={`ticker-info${selectKey === `${summary.openDate}-${dp.openDate}-${dp.symbol}` ? ' selected' : ''}`}
key={`${summary.openDate}-${dp.openDate}-${dp.symbol}`} onClick={() => handleSelectTicker(dp)}>
<div style={{display: 'flex'}}>
<TickerImg getIsinBySymbol={getIsinBySymbol} key={dp?.symbol} symbol={dp?.symbol}/>
<div className="ticker_name">
<div className="ticker_name_title">{dp?.symbol}</div>
<div className="ticker_name_description">
{moment(dp?.openDate).format('HH:mm:ss')}
</div>
</div>
</div>
</div>
<div className="ticker_actions">
<div className="ticker_name_title"
style={{color: dp?.PnL > 0 ? 'rgba(var(--table-profit-color),1)' : 'rgba(var(--table-loss-color),1)'}}>
<span>{moneyFormat(dp?.PnL || 0)}</span>
<span>{`${numberToPercent(dp?.PnLPercent)}%`}</span>
<div className="ticker_actions">
<div className="ticker_name_title"
style={{color: dp?.PnL > 0 ? 'rgba(var(--table-profit-color),1)' : 'rgba(var(--table-loss-color),1)'}}>
<span>{moneyFormat(dp?.PnL || 0)}</span>
<span>{`${numberToPercent(dp?.PnLPercent)}%`}</span>
</div>
<div className="ticker_name_description">на сумму {moneyFormat(dp?.volume, 0)}</div>
</div>
<div className="ticker_name_description">на сумму {moneyFormat(dp?.volume, 0)}</div>
</div>
</div>)}
</div>)}
</div>
</div>
}

Expand Down Expand Up @@ -1180,47 +1182,50 @@ const Diary: FC<IProps> = ({
</div>
<div>
{boardsWithLabel.filter(bwl => securitiesGroupByBoard[bwl.value]?.length).map(bwl =>
<div className="MobilePosition widget" key={bwl.value}>
<div style={{display: 'flex', alignItems: 'end'}}>
<div className="title-container">
<div className="title">{bwl.label}</div>
{(securitiesGroupByBoard[bwl.value] || []).length > 3 && <div style={{
display: 'inline-flex',
alignItems: 'end'
}}>
{!hideMap[bwl.value] && <Button type="link"
onClick={() => setHideMap(prevState => ({
...prevState,
[bwl.value]: true
}))}>Больше</Button>}
{hideMap[bwl.value] && <Button type="link" onClick={() => setHideMap(prevState => ({
...prevState,
[bwl.value]: false
}))}>Меньше</Button>}
</div>}
<div className="MobilePosition" key={bwl.value}>
<div className="widget">
<div style={{display: 'flex', alignItems: 'end'}}>
<div className="title-container">
<div className="title">{bwl.label}</div>
{(securitiesGroupByBoard[bwl.value] || []).length > 3 && <div style={{
display: 'inline-flex',
alignItems: 'end'
}}>
{!hideMap[bwl.value] && <Button type="link"
onClick={() => setHideMap(prevState => ({
...prevState,
[bwl.value]: true
}))}>Больше</Button>}
{hideMap[bwl.value] && <Button type="link" onClick={() => setHideMap(prevState => ({
...prevState,
[bwl.value]: false
}))}>Меньше</Button>}
</div>}
</div>
</div>
</div>
{(securitiesGroupByBoard[bwl.value] || []).filter((_, i) => !hideMap[bwl.value] ? i < 3 : true).map(dp =>
<div className="ticker-info" key={dp.ISIN} onClick={() => handleSelectTicker(dp)}>
<div style={{display: 'flex'}}>
<TickerImg getIsinBySymbol={getIsinBySymbol} key={dp?.symbol} board={dp?.primary_board}
symbol={dp?.symbol}/>
<div className="ticker_name">
<div className="ticker_name_title">{dp?.description}</div>
<div className="ticker_name_description">
{dp?.symbol}
{(securitiesGroupByBoard[bwl.value] || []).filter((_, i) => !hideMap[bwl.value] ? i < 3 : true).map(dp =>
<div className="ticker-info" key={dp.ISIN} onClick={() => handleSelectTicker(dp)}>
<div style={{display: 'flex'}}>
<TickerImg getIsinBySymbol={getIsinBySymbol} key={dp?.symbol} board={dp?.primary_board}
symbol={dp?.symbol}/>
<div className="ticker_name">
<div className="ticker_name_title">{dp?.description}</div>
<div className="ticker_name_description">
{dp?.symbol}
</div>
</div>
</div>
</div>
{/*<div className="ticker_actions">*/}
{/* <div className="ticker_name_title"*/}
{/* style={{color: dp?.PnL > 0 ? 'rgba(var(--table-profit-color),1)' : 'rgba(var(--table-loss-color),1)'}}>*/}
{/* <span>{moneyFormat(dp?.PnL || 0)}</span>*/}
{/* <span>{`${numberToPercent(dp?.PnLPercent)}%`}</span>*/}
{/* </div>*/}
{/* <div className="ticker_name_description">на сумму {moneyFormat(dp?.volume, 0)}</div>*/}
{/*</div>*/}
</div>)}
{/*<div className="ticker_actions">*/}
{/* <div className="ticker_name_title"*/}
{/* style={{color: dp?.PnL > 0 ? 'rgba(var(--table-profit-color),1)' : 'rgba(var(--table-loss-color),1)'}}>*/}
{/* <span>{moneyFormat(dp?.PnL || 0)}</span>*/}
{/* <span>{`${numberToPercent(dp?.PnLPercent)}%`}</span>*/}
{/* </div>*/}
{/* <div className="ticker_name_description">на сумму {moneyFormat(dp?.volume, 0)}</div>*/}
{/*</div>*/}
</div>)}

</div>
</div>
)}

Expand Down Expand Up @@ -1275,7 +1280,7 @@ const Diary: FC<IProps> = ({
const listHeight = useMemo(() => isMobile ? height - 186 : height - 56, [isMobile, height]);

return (
<div className="Diary">
<>
<Title>Дневник</Title>
<MobileSearch/>
<Carousel ref={ref} afterChange={onCarouselChange} className="MobileSummaryCarousel">
Expand Down Expand Up @@ -1674,7 +1679,7 @@ const Diary: FC<IProps> = ({
/>
{!isLoading && dayPositions.map(dp => <MobilePosition positions={dp}/>)}
</>}
</div>
</>
);
};

Expand Down

0 comments on commit 5d4380b

Please sign in to comment.