Skip to content

Commit

Permalink
fix: style banner cta buttons on market page when on mobile.
Browse files Browse the repository at this point in the history
  • Loading branch information
hepnerthomas committed Feb 15, 2023
1 parent 67bc396 commit a4bd76b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/client/routes/Market/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styled from 'styled-components';
import { useHistory } from 'react-router-dom';
import { utils } from 'ethers';

import { device, sharedTheme } from '@themes/default';
import { useAppSelector, useAppDispatch, useAppTranslation, useQueryParams } from '@hooks';
import {
ModalsActions,
Expand Down Expand Up @@ -38,7 +39,10 @@ const StyledSliderCard = styled(SliderCard)`
const BannerCtaButton = styled(Button)`
width: 80%;
max-width: 20rem;
margin-top: 1em;
margin-top: 2rem;
@media ${device.mobile} {
padding: ${({ theme }) => theme.card.padding};
}
`;

interface VaultsQueryParams {
Expand Down
12 changes: 10 additions & 2 deletions src/core/store/modules/lines/lines.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,24 @@ const linesReducer = createReducer(linesInitialState, (builder) => {
categories[category] = [...(categories[category] || []), line.id];
})
);
const validLines = _.filter(
lines,
(line) => line.status === 'active' && Number(line.defaultSplit) > 0 && line.end * 1000 > Date.now()
);

const highestCreditLines = _.map(
_.sortBy(lines, (line) => Number(BigNumber.from(line.deposit).div(BASE_DECIMALS)))
_.sortBy(validLines, (line) => Number(BigNumber.from(line.deposit).div(BASE_DECIMALS)))
.reverse()
.slice(0, 3),
'id'
);

const newCreditLines = categories['market:featured.newest'];

const highestCreditLinesCategory = { 'market:featured.highest-credit': highestCreditLines };

const highestRevenueLines = _.map(
_.sortBy(lines, (line) => Number(BigNumber.from(line!.spigot!.revenueValue).div(BASE_DECIMALS)))
_.sortBy(validLines, (line) => Number(BigNumber.from(line!.spigot!.revenueValue).div(BASE_DECIMALS)))
.reverse()
.slice(0, 3),
'id'
Expand Down

0 comments on commit a4bd76b

Please sign in to comment.