Skip to content

Commit 7602906

Browse files
authored
Merge pull request #442 from Raziievskyi-Illia/fix/button_stickiness
2 parents b3e172d + fa1496f commit 7602906

4 files changed

Lines changed: 52 additions & 5 deletions

File tree

src/ui/src/components/Dashboard/BorrowMarketTokenTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const BorrowMarketTokenTable = (props) => {
6363
</TableCell>
6464
<TableCell align="center"> Available </TableCell>
6565
<TableCell align="center"> Borrow APY </TableCell>
66-
<TableCell align="center" className={classes.stickyCellRight}> </TableCell>
66+
<TableCell align="center" className={`${classes.stickyCellRight} ${classes.borrowCellHeader}`}> </TableCell>
6767
<TableCell align="center" className={classes.fifthCell}> </TableCell>
6868
</TableRow>
6969
</TableHead>

src/ui/src/components/Dashboard/BorrowedTokenTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const BorrowedTokenTable = (props) => {
7474
<TableCell> Token </TableCell>
7575
<TableCell align="center"> APY </TableCell>
7676
<TableCell align="center"> Balance </TableCell>
77-
<TableCell align="center"> </TableCell>
77+
<TableCell align="center" className={classes.stickyCellRight}> </TableCell>
7878
</TableRow>
7979
</TableHead>
8080
<TableBody>
@@ -179,7 +179,7 @@ const BorrowedTokenTable = (props) => {
179179
)}
180180
</span>
181181
</TableCell>
182-
<TableCell align="center" className={classes.repayCell}>
182+
<TableCell align="center" className={`${classes.repayCell} ${classes.stickyCellRight}`}>
183183
<Button variant='contained' className={classes.detailsButton} onClick={() => handleClickRepay(data)}>
184184
R<Typography textTransform={'lowercase'}>epay</Typography>
185185
</Button>

src/ui/src/components/Dashboard/SuppliedTokenTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const SuppliedTokenTable = (props) => {
101101
Collateral{' '}
102102
<img src={questionCircleIcon} alt={'questionIcon'} className={classes.questionCircleIcon} />
103103
</TableCell>
104-
<TableCell align='center'></TableCell>
104+
<TableCell className={classes.stickyCellRight} align='center'></TableCell>
105105
</TableRow>
106106
</TableHead>
107107
<TableBody>
@@ -212,7 +212,7 @@ const SuppliedTokenTable = (props) => {
212212
<TableCell align="center" className={classes.switchPadding}>
213213
<Switch data={data} />
214214
</TableCell>
215-
<TableCell className={classes.withdrawCell}>
215+
<TableCell className={`${classes.withdrawCell} ${classes.stickyCellRight}`}>
216216
<Button variant='contained' className={classes.detailsButton} onClick={() => handleClickWithdraw(data)}>
217217
W<Typography textTransform={'lowercase'}>ithdraw</Typography>
218218
</Button>

src/ui/src/components/Dashboard/style.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,47 @@ export const useStyles = makeStyles({
263263
paddingRight: '1.5rem !important',
264264
},
265265
paddingLeft: '0 !important',
266+
'@media(min-width: 423px) and (max-width: 499px)': {
267+
position: 'sticky',
268+
zIndex: 2,
269+
right: 0,
270+
opacity: '1 !important',
271+
backgroundColor: 'white',
272+
boxShadow: 'inset 0 -1px 0 #E0E0E0',
273+
borderBottom: '0 !important',
274+
},
275+
'@media(min-width: 626px) and (max-width: 720px)': {
276+
position: 'sticky',
277+
zIndex: 2,
278+
right: 0,
279+
opacity: '1 !important',
280+
backgroundColor: 'white',
281+
boxShadow: 'inset 0 -1px 0 #E0E0E0',
282+
borderBottom: '0 !important',
283+
},
284+
'@media(min-width: 1423px) and (max-width: 1615px)': {
285+
position: 'sticky',
286+
zIndex: 2,
287+
right: 0,
288+
opacity: '1 !important',
289+
backgroundColor: 'white',
290+
boxShadow: 'inset 0 -1px 0 #E0E0E0',
291+
borderBottom: '0 !important',
292+
}
266293
},
267294
borrowCell: {
268295
'@media(min-width: 1200px)': {
269296
paddingRight: '1.5rem !important',
270297
},
298+
'@media(min-width: 423px) and (max-width: 499px)': {
299+
right: '21% !important',
300+
},
301+
'@media(min-width: 626px) and (max-width: 720px)': {
302+
right: '19% !important',
303+
},
304+
'@media(min-width: 1423px) and (max-width: 1615px)': {
305+
right: '17% !important',
306+
}
271307
},
272308
supplyButton: {
273309
borderRadius: '8px',
@@ -349,5 +385,16 @@ export const useStyles = makeStyles({
349385
'@media(min-width: 1200px)': {
350386
paddingRight: '1.5rem !important',
351387
},
388+
},
389+
borrowCellHeader: {
390+
'@media(min-width: 423px) and (max-width: 499px)': {
391+
right: '21% !important',
392+
},
393+
'@media(min-width: 626px) and (max-width: 720px)': {
394+
right: '19% !important',
395+
},
396+
'@media(min-width: 1423px) and (max-width: 1615px)': {
397+
right: '17% !important',
398+
}
352399
}
353400
});

0 commit comments

Comments
 (0)