-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DTRA] Maryia/DTRA-1685/feat: design updates for DTrader V2 pages #16607
Changes from all commits
be31e89
f288c81
402cbf9
c6b8ac9
a8729b6
75eda3d
a97942f
8616b94
a752f83
c53440c
10f9d97
c371874
d49a434
ad2b57a
ab64b7c
0f3a95d
69561d4
c04a0b1
0888736
2b58c0a
3a2ce19
7dae18a
d090b8c
4b4f39e
f84f883
df94e30
d4978d7
8dc5c2d
c2f4064
8192764
72405bf
0044c25
be3e755
a71be8a
9e397f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,9 @@ | |
.timer { | ||
background-color: var(--core-color-opacity-black-75); | ||
|
||
&, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like a typo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, it's intended since I want the style to apply to both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we be more explicit for readability There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. & stands for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what i mean is i dont mind writing the same style twice for the sake of readability There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think using the parent selector(&) is fine here. We've already used in multiple places and it's not hard to understand it, IMO. |
||
.dc-remaining-time { | ||
font-size: unset; | ||
font-size: var(--core-fontSize-50); | ||
} | ||
} | ||
.status-and-profit { | ||
|
@@ -86,14 +87,17 @@ | |
button { | ||
all: unset; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
width: var(--core-size-3600); | ||
height: 100%; | ||
cursor: pointer; | ||
|
||
.label { | ||
.label, | ||
.dc-remaining-time { | ||
color: var(--core-color-solid-slate-50); | ||
font-size: var(--core-fontSize-50); | ||
} | ||
&:disabled:not(.loading) { | ||
background-color: var(--core-color-opacity-black-200); | ||
|
@@ -137,7 +141,7 @@ | |
} | ||
&.lost { | ||
.profit { | ||
color: var(--core-color-solid-red-600); | ||
color: var(--core-color-solid-red-700); | ||
} | ||
button:not(:disabled), | ||
button.loading { | ||
|
@@ -150,7 +154,7 @@ | |
} | ||
&.won { | ||
.profit { | ||
color: var(--core-color-solid-green-600); | ||
color: var(--core-color-solid-green-700); | ||
} | ||
button:not(:disabled), | ||
button.loading { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
.contract-details-footer { | ||
&--container { | ||
padding: var(--semantic-spacing-general-md); | ||
background-color: var(--core-color-solid-slate-50); | ||
padding: 0 var(--semantic-spacing-general-sm) var(--semantic-spacing-general-sm); | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
gap: var(--semantic-spacing-gap-md); | ||
width: 100%; | ||
box-shadow: var(--core-elevation-shadow-210); | ||
position: fixed; | ||
bottom: 0; | ||
z-index: 2; // chart has z-index: 1, it should not overlap buttons if screen height is small | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { Button, TButtonColor, TButtonVariant } from '@deriv-com/quill-ui'; | ||
import React from 'react'; | ||
import { Button, TButtonColor } from '@deriv-com/quill-ui'; | ||
import { RemainingTime } from '@deriv/components'; | ||
import { TContractInfo, getCardLabelsV2, isMultiplierContract, isValidToCancel, isValidToSell } from '@deriv/shared'; | ||
import { useStore } from '@deriv/stores'; | ||
import React from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import { TRegularSizesWithExtraLarge } from '@deriv-com/quill-ui/dist/types'; | ||
import { FormatUtils } from '@deriv-com/utils'; | ||
|
@@ -12,7 +12,6 @@ type ContractInfoProps = { | |
}; | ||
|
||
type ButtonProps = { | ||
variant: TButtonVariant; | ||
color: TButtonColor; | ||
size: TRegularSizesWithExtraLarge; | ||
fullWidth: boolean; | ||
|
@@ -36,11 +35,13 @@ const ContractDetailsFooter = observer(({ contract_info }: ContractInfoProps) => | |
const is_multiplier = isMultiplierContract(contract_type); | ||
|
||
const cardLabels = getCardLabelsV2(); | ||
const bidDetails = !is_valid_to_cancel ? `@${bid_price} ${currency}` : ''; | ||
const formatted_bid_price = FormatUtils.formatMoney(bid_price || 0, { | ||
currency: currency as 'USD', // currency types mismatched between utils and shared | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have currencies other than USD though ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, it's just a type here in order to not use |
||
const bidDetails = !is_valid_to_cancel ? `${formatted_bid_price} ${currency}` : ''; | ||
const label = `${cardLabels.CLOSE} ${bidDetails}`; | ||
|
||
const buttonProps: ButtonProps = { | ||
variant: 'secondary', | ||
color: 'black', | ||
size: 'lg', | ||
fullWidth: true, | ||
|
@@ -53,6 +54,7 @@ const ContractDetailsFooter = observer(({ contract_info }: ContractInfoProps) => | |
<Button | ||
label={label} | ||
isLoading={is_sell_requested} | ||
isOpaque | ||
disabled={Number(profit) < 0 && is_valid_to_cancel} | ||
onClick={() => onClickSell(contract_id)} | ||
{...buttonProps} | ||
|
@@ -74,6 +76,8 @@ const ContractDetailsFooter = observer(({ contract_info }: ContractInfoProps) => | |
</> | ||
} | ||
disabled={Number(profit) >= 0} | ||
isOpaque | ||
variant='secondary' | ||
{...buttonProps} | ||
/> | ||
)} | ||
|
@@ -82,12 +86,11 @@ const ContractDetailsFooter = observer(({ contract_info }: ContractInfoProps) => | |
<Button | ||
label={ | ||
is_valid_to_sell | ||
? `${cardLabels.CLOSE} @ ${FormatUtils.formatMoney(bid_price || 0, { | ||
currency: currency as any, // currency types mismatched between utils and shared | ||
})} ${currency}` | ||
? `${cardLabels.CLOSE} ${formatted_bid_price} ${currency}` | ||
: cardLabels.RESALE_NOT_OFFERED | ||
} | ||
isLoading={is_sell_requested && is_valid_to_sell} | ||
isOpaque | ||
onClick={is_valid_to_sell ? () => onClickSell(contract_id) : undefined} | ||
disabled={!is_valid_to_sell} | ||
{...buttonProps} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all cards in C.Details should have box shadow.