Skip to content

Commit

Permalink
v5.3.11
Browse files Browse the repository at this point in the history
v5.3.11
  • Loading branch information
platschi authored Jan 25, 2023
2 parents 52b3fde + 66b84f0 commit 342b896
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 26 deletions.
13 changes: 12 additions & 1 deletion components/SegmentedControl/SegmentedControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const SegmentedControlOption = styled.button<{ isSelected: boolean; styleType: S
: undefined};
color: ${(props) =>
props.isSelected && props.styleType === 'button'
? props.theme.colors.selectedTheme.yellow
? props.theme.colors.common.primaryYellow
: props.isSelected
? props.theme.colors.selectedTheme.button.text.primary
: props.theme.colors.selectedTheme.segmented.button.inactive.color};
Expand All @@ -89,9 +89,20 @@ const SegmentedControlOption = styled.button<{ isSelected: boolean; styleType: S
props.isSelected && props.styleType === 'tab'
? props.theme.colors.selectedTheme.segmented.button.background
: 'transparent'};
background-color: ${(props) =>
props.isSelected && props.styleType === 'button' && props.theme.colors.common.darkYellow};
transition: all 0.1s ease-in-out;
&:hover {
color: ${(props) => props.theme.colors.selectedTheme.icon.hover};
> div {
background-color: ${(props) => !props.isSelected && props.theme.colors.common.darkYellow};
}
}
`;

const CheckBox = styled.div<{ selected: boolean }>`
transition: all 0.1s ease-in-out;
margin-right: 10px;
outline: ${(props) => props.theme.colors.selectedTheme.outlineBorder};
border-radius: 2px;
Expand Down
4 changes: 2 additions & 2 deletions sdk/services/kwentaToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default class KwentaTokenService {
vKwentaBalance: wei(vKwentaBalance),
vKwentaAllowance: wei(vKwentaAllowance),
kwentaAllowance: wei(kwentaAllowance),
epochPeriod: Number(epochPeriod) - 1,
epochPeriod: Number(epochPeriod) - 2,
veKwentaBalance: wei(veKwentaBalance),
veKwentaAllowance: wei(veKwentaAllowance),
};
Expand Down Expand Up @@ -379,7 +379,7 @@ export default class KwentaTokenService {
const responses: EpochData[] = await Promise.all(
fileNames.map(async (fileName, index) => {
const response = await client.get(fileName);
const period = index >= 5 ? index + 1 : index;
const period = index >= 5 ? (index >= 10 ? index + 2 : index + 1) : index;
return { ...response.data, period };
})
);
Expand Down
29 changes: 26 additions & 3 deletions sections/futures/OrderPriceInput/OrderPriceInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function OrderPriceInput({
{t('futures.market.trade.orders.fee-rejection-label')}:
</FeeRejectionLabel>
</StyledTooltip>
<SegmentedControl
<StyledSegmentedControl
onChange={onChangeFeeCap}
selectedIndex={FEE_CAP_OPTIONS.indexOf(selectedFeeCapLabel)}
styleType="button"
Expand All @@ -127,6 +127,29 @@ export default function OrderPriceInput({
);
}

const StyledSegmentedControl = styled(SegmentedControl)`
display: flex;
justify-content: space-between;
button {
:hover {
background-color: ${(props) => props.theme.colors.common.primaryYellow};
color: ${(props) => props.theme.colors.common.black};
}
border: ${(props) => props.theme.colors.selectedTheme.border};
display: flex;
align-items: center;
justify-content: center;
font-variant-caps: all-small-caps;
font-variant-numeric: tabular-nums;
text-transform: uppercase;
padding: 0 8px;
}
`;

const StyledInputTitle = styled(InputTitle)`
text-transform: capitalize;
span {
Expand All @@ -139,12 +162,12 @@ const FeeCapContainer = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
margin: 10px 0;
margin: 15px 0;
`;

const FeeRejectionLabel = styled.div`
min-width: 100px;
font-size: 12px;
font-size: 13px;
color: ${(props) => props.theme.colors.selectedTheme.text.label};
cursor: default;
`;
18 changes: 13 additions & 5 deletions sections/futures/Trade/TradePanelHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EXTERNAL_LINKS } from 'constants/links';
import { FuturesAccountType } from 'queries/futures/subgraph';
import { setOpenModal } from 'state/app/reducer';
import { useAppDispatch } from 'state/hooks';
import { BorderedPanel, YellowIconButton } from 'styles/common';
import { BorderedPanel, YellowIconButton, PillButtonSpan } from 'styles/common';
import { formatDollars } from 'utils/formatters/number';

type Props = {
Expand Down Expand Up @@ -64,13 +64,24 @@ export default function TradePanelHeader({ accountType, onManageBalance, balance
<BalanceRow onClick={onManageBalance}>
<NumberDiv contrast="strong">{formatDollars(balance)}</NumberDiv>
<BalanceButton>
<SwitchAssetArrows />
<StyledPillButtonSpan>
<SwitchAssetArrows />
</StyledPillButtonSpan>
</BalanceButton>
</BalanceRow>
</Container>
);
}

const StyledPillButtonSpan = styled(PillButtonSpan)`
display: flex;
align-items: center;
justify-content: center;
height: 20px;
width: 20px;
margin-left: 0;
`;

const DepositButton = styled(Button)`
height: 55px;
width: 100%;
Expand Down Expand Up @@ -107,9 +118,6 @@ const BalanceButton = styled(YellowIconButton)`
display: flex;
gap: 8px;
align-items: center;
&:hover {
opacity: 0.7;
}
`;

const FAQLink = styled.div`
Expand Down
3 changes: 2 additions & 1 deletion state/futures/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ export const fetchIsolatedMarginAccountData = createAsyncThunk<void, void, Thunk
export const fetchSharedFuturesData = createAsyncThunk<void, void, ThunkConfig>(
'futures/fetchSharedFuturesData',
async (_, { dispatch }) => {
dispatch(fetchMarkets());
await dispatch(fetchMarkets());
dispatch(fetchFundingRates());
dispatch(fetchDailyVolumes());
}
);
Expand Down
23 changes: 11 additions & 12 deletions styles/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,31 +274,33 @@ const PillButtonCss = css<{ padding?: string }>`
transition: all 0.1s ease-in-out;
margin-left: 8px;
cursor: pointer;
font-size: 10px;
font-size: 11px;
line-height: 12px;
font-family: ${(props) => props.theme.fonts.black};
font-variant: all-small-caps;
border: 1px solid ${(props) => props.theme.colors.selectedTheme.yellow};
color: ${(props) => props.theme.colors.selectedTheme.button.pill.background};
color: ${(props) => props.theme.colors.selectedTheme.button.pill.text};
border-radius: 10px;
border: ${(props) => props.theme.colors.selectedTheme.border};
padding: ${(props) => props.padding ?? '3px 5px'};
background-color: ${(props) => props.theme.colors.common.darkYellow};
svg {
path {
${(props) =>
css`
fill: ${props.theme.colors.selectedTheme.yellow};
fill: ${props.theme.colors.common.primaryYellow};
`}
}
}
&:hover {
background-color: ${(props) => props.theme.colors.selectedTheme.button.pill.background};
color: ${(props) => props.theme.colors.selectedTheme.button.pill.hover};
opacity: 0.7;
color: ${(props) => props.theme.colors.common.black};
svg {
path {
${(props) =>
css`
fill: ${props.theme.colors.selectedTheme.button.pill.hover};
fill: ${props.theme.colors.common.black};
`}
}
}
Expand All @@ -317,15 +319,12 @@ export const YellowIconButton = styled.div`
transition: all 0.1s ease-in-out;
cursor: pointer;
color: ${(props) => props.theme.colors.selectedTheme.yellow};
svg {
/* svg {
path {
${(props) =>
css`
fill: ${props.theme.colors.selectedTheme.yellow};
`}
}
}
&:hover {
opacity: 0.7;
}
} */
`;
1 change: 1 addition & 0 deletions styles/theme/colors/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const common = {
secondaryGold: '#E4B378',
primaryYellow: '#FFB800',
black: '#171002',
darkYellow: '#3E2D00',
dark: {
white: '#ECE8E3',
yellow: '#FFB800',
Expand Down
2 changes: 1 addition & 1 deletion styles/theme/colors/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const darkTheme = {
},
disabled: { border: '1px solid #353333', text: '#353333' },
},
pill: { background: common.dark.yellow, text: common.dark.yellow, hover: common.black },
pill: { background: common.dark.yellow, text: common.primaryYellow, hover: common.black },
yellow: {
fill: '#3E2D00',
fillHover: '#513C05',
Expand Down
6 changes: 5 additions & 1 deletion styles/theme/colors/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ const lightTheme = {
},
disabled: { border: '1px solid #353333', text: '#B3B3B3' },
},
pill: { background: common.light.yellow, text: common.light.yellow, hover: common.light.white },
pill: {
background: common.dark.yellow,
text: common.primaryYellow,
hover: common.primaryWhite,
},
yellow: {
fill: common.light.yellow,
fillHover: '#532800',
Expand Down

1 comment on commit 342b896

@vercel
Copy link

@vercel vercel bot commented on 342b896 Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kwenta – ./

kwenta.io
kwenta-git-main-kwenta.vercel.app
kwenta-kwenta.vercel.app
dev.kwenta.io

Please sign in to comment.