Skip to content

Commit

Permalink
SearchContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
maksim-zakharov committed Aug 2, 2024
1 parent b4304cb commit 1411365
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 61 deletions.
4 changes: 3 additions & 1 deletion src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ h1.ant-typography {

.SearchContainer {
display: none;
flex-direction: column;
gap: 16px;
/*position: sticky;*/
/*z-index: 12;*/
/*left: 0;*/
Expand Down Expand Up @@ -776,7 +778,7 @@ header {
}

.SearchContainer {
display: block;
display: flex;
}

.mobile-position-spinner {
Expand Down
15 changes: 0 additions & 15 deletions src/pages/Diary/Diary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ interface DataType {
tags: string[];
}

interface ExpandedDataType {
key: React.Key;
date: string;
name: string;
upgradeNum: string;
}

interface DataType {
key: string;
name: string;
Expand All @@ -109,14 +102,6 @@ interface DataType {
address: string;
}

const sharedOnCell = (_: DataType, index: number) => {
if (index === 1) {
return {colSpan: 0};
}

return {};
};

interface IProps {
data: any;
trades?: any;
Expand Down
87 changes: 42 additions & 45 deletions src/pages/Diary/components/MobileSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,56 +75,53 @@ const MobileSearch = ({getIsinBySymbol}) => {
onFocus={onFocus} onBlur={onBlur}/>
{value && <Button type="link" onClick={() => setValue('')}>Отменить</Button>}
</div>
<div>
{boardsWithLabel.filter(bwl => securitiesGroupByBoard[bwl.value]?.length).map(bwl =>
<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>
{boardsWithLabel.filter(bwl => securitiesGroupByBoard[bwl.value]?.length).map(bwl =>
<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>
{(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>
{(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 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 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>
)}

</div>
</div>
)}
</div>
}

Expand Down

0 comments on commit 1411365

Please sign in to comment.