forked from deriv-com/trade-rise-fall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'second/master'
- Loading branch information
Showing
18 changed files
with
619 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
src/components/TradingComponents/DurationSection/DurationSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { Text, TextField, TextFieldWithSteppers } from "@deriv-com/quill-ui"; | ||
import { Tab } from "../Tab"; | ||
import { DurationTabValue } from "../types"; | ||
|
||
interface DurationSectionProps { | ||
duration: number; | ||
selectedDurationTab: DurationTabValue; | ||
durationError: string; | ||
setDuration: (value: string) => void; | ||
setSelectedDurationTab: (value: DurationTabValue) => void; | ||
} | ||
|
||
interface DurationTab { | ||
label: string; | ||
value: DurationTabValue; | ||
} | ||
|
||
export const DurationSection = ({ | ||
duration, | ||
selectedDurationTab, | ||
durationError, | ||
setDuration, | ||
setSelectedDurationTab, | ||
}: DurationSectionProps) => { | ||
const durationTabs: DurationTab[] = [ | ||
{ label: "Duration", value: "duration" }, | ||
{ label: "End time", value: "endtime" }, | ||
]; | ||
|
||
return ( | ||
<div className="duration-endtime-section"> | ||
<Tab | ||
tabs={durationTabs} | ||
activeTab={selectedDurationTab} | ||
onChange={setSelectedDurationTab} | ||
/> | ||
{selectedDurationTab === "duration" ? ( | ||
<div className="duration-input"> | ||
<Text as="span" size="sm" className="text-bold"> | ||
Minutes | ||
</Text> | ||
<TextFieldWithSteppers | ||
type="text" | ||
value={duration.toString()} | ||
onChange={(e) => setDuration(e.target.value)} | ||
className="duration-field" | ||
allowDecimals={false} | ||
allowSign={false} | ||
regex={/[^0-9]|^$/g} | ||
inputMode="numeric" | ||
shouldRound={true} | ||
textAlignment="center" | ||
minusDisabled={Number(duration) - 1 <= 0} | ||
variant="fill" | ||
status={durationError ? "error" : "success"} | ||
message={durationError} | ||
/> | ||
<Text as="span" size="sm" className="text-less-prominent"> | ||
Range: 1 - 1,440 minutes | ||
</Text> | ||
</div> | ||
) : ( | ||
<div className="endtime-inputs"> | ||
<TextField | ||
type="text" | ||
value="03 Jan 2025" | ||
readOnly | ||
className="date-input" | ||
/> | ||
<TextField | ||
type="text" | ||
value="03:20 GMT" | ||
readOnly | ||
className="time-input" | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; |
34 changes: 34 additions & 0 deletions
34
src/components/TradingComponents/PayoutInfo/PayoutInfo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Text, Tooltip } from "@deriv-com/quill-ui"; | ||
import { LabelPairedCircleInfoSmBoldIcon } from "@deriv/quill-icons"; | ||
|
||
interface PayoutInfoProps { | ||
type: "rise" | "fall"; | ||
label: string; | ||
amount: string; | ||
isLoading: boolean; | ||
} | ||
|
||
export const PayoutInfo = ({ | ||
type, | ||
label, | ||
amount, | ||
isLoading, | ||
}: PayoutInfoProps) => { | ||
return ( | ||
<div className="payout-info-row"> | ||
{!isLoading && ( | ||
<> | ||
<Text as="span" size="sm" className="text-bold"> | ||
{label} | ||
</Text> | ||
<Text as="span" size="lg" className="text-bold"> | ||
{amount} USD | ||
</Text> | ||
<Tooltip tooltipContent={`${label} info`}> | ||
<LabelPairedCircleInfoSmBoldIcon className="info-icon" /> | ||
</Tooltip> | ||
</> | ||
)} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.