-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/SOV-2913-history-staking-change
- Loading branch information
Showing
188 changed files
with
10,391 additions
and
468 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"frontend": patch | ||
"@sovryn/contracts": patch | ||
--- | ||
|
||
SOV-2756: Clean up Babelfish token config |
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
--- | ||
"frontend": patch | ||
--- | ||
|
||
SOV-3021: Fix earned tooltip layout |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
--- | ||
"frontend": patch | ||
--- | ||
|
||
SOV-2993: Vesting reward history |
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,5 @@ | ||
--- | ||
"frontend": patch | ||
--- | ||
|
||
SOV-2992: lending withdraw with max amount issue |
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,5 @@ | ||
--- | ||
"frontend": patch | ||
--- | ||
|
||
SOV-2942: fix adjust stake data refresh |
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
--- | ||
"frontend": patch | ||
--- | ||
|
||
SOV-3077: Prevent reward SOV claiming and force user to withdraw unclaimed SOV if the LM vesting contracts has too many liquid stakes |
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
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
3 changes: 3 additions & 0 deletions
3
apps/frontend/src/app/2_molecules/DatePicker/DatePicker.module.css
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,3 @@ | ||
.selected, .selected:hover, .selected:focus, .selected:hover:not([disabled]) { | ||
@apply bg-primary text-white rounded-none; | ||
} |
104 changes: 104 additions & 0 deletions
104
apps/frontend/src/app/2_molecules/DatePicker/DatePicker.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,104 @@ | ||
import React, { FC, useCallback, useMemo } from 'react'; | ||
|
||
import classNames from 'classnames'; | ||
import dayjs from 'dayjs'; | ||
import { DayPicker } from 'react-day-picker'; | ||
|
||
import { Icon, IconNames, Paragraph } from '@sovryn/ui'; | ||
|
||
import styles from './DatePicker.module.css'; | ||
|
||
type DatePickerProps = { | ||
date: number; | ||
onChange: (value: number) => void; | ||
className?: string; | ||
minDate?: number; | ||
maxDate?: number; | ||
label: string; | ||
isCalendarVisible?: boolean; | ||
setIsCalendarVisible: (value: React.SetStateAction<boolean>) => void; | ||
}; | ||
|
||
const datePickerStylesOverride = ( | ||
<style> | ||
{` | ||
.rdp-button:hover:not([disabled]):not(.rdp-day_selected) { | ||
background-color: #F57118; | ||
border-radius: 0; | ||
} | ||
`} | ||
</style> | ||
); | ||
|
||
export const DatePicker: FC<DatePickerProps> = ({ | ||
date, | ||
onChange, | ||
className, | ||
label, | ||
minDate, | ||
maxDate, | ||
isCalendarVisible, | ||
setIsCalendarVisible, | ||
}) => { | ||
const selected = useMemo(() => dayjs.unix(date).toDate(), [date]); | ||
|
||
const handleDaySelect = useCallback( | ||
(date: Date | undefined) => { | ||
if (!date) { | ||
return; | ||
} | ||
setIsCalendarVisible(false); | ||
const selectedDateTime = dayjs(date); | ||
const currentTime = dayjs(); | ||
const timestamp = | ||
selectedDateTime.unix() + | ||
currentTime.diff(currentTime.startOf('day'), 'seconds'); | ||
onChange(timestamp); | ||
}, | ||
[onChange, setIsCalendarVisible], | ||
); | ||
|
||
const handleCalendarClick = useCallback(() => { | ||
setIsCalendarVisible(previousValue => !previousValue); | ||
}, [setIsCalendarVisible]); | ||
|
||
return ( | ||
<div | ||
className={classNames( | ||
className, | ||
'bg-gray-70 rounded min-h-10 px-3 flex items-center justify-between relative m-0', | ||
)} | ||
> | ||
<Paragraph className="font-medium" children={label} /> | ||
<div | ||
className="cursor-pointer flex items-center" | ||
onClick={handleCalendarClick} | ||
> | ||
{dayjs.unix(date).format('DD/MM/YYYY')} | ||
<Icon icon={IconNames.CALENDAR} size={11} className="ml-2" /> | ||
</div> | ||
|
||
{isCalendarVisible && ( | ||
<div className="absolute top-10 left-0 right-0 z-10"> | ||
{datePickerStylesOverride} | ||
<DayPicker | ||
initialFocus={isCalendarVisible} | ||
mode="single" | ||
defaultMonth={selected} | ||
selected={selected} | ||
onSelect={handleDaySelect} | ||
fromDate={minDate ? dayjs.unix(minDate).toDate() : dayjs().toDate()} | ||
toDate={maxDate ? dayjs.unix(maxDate).toDate() : undefined} | ||
modifiersClassNames={{ | ||
selected: styles.selected, | ||
}} | ||
styles={{ | ||
caption_label: { fontSize: '1rem' }, | ||
}} | ||
className="bg-gray-70 rounded m-0 mt-1 px-0 py-3 flex justify-center" | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; |
40 changes: 40 additions & 0 deletions
40
apps/frontend/src/app/2_molecules/FixedInterestPoolRowTitle/FixedInterestPoolRowTitle.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,40 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import { t } from 'i18next'; | ||
|
||
import { AssetRenderer } from '../../2_molecules/AssetRenderer/AssetRenderer'; | ||
import { NextBorrowInterestRate } from '../../5_pages/BorrowPage/components/BorrowAssetsTable/components/NextBorrowInterestRate/NextBorrowInterestRate'; | ||
import { NextSupplyInterestRate } from '../../5_pages/LendPage/components/NextSupplyInterestRate/NextSupplyInterestRate'; | ||
import { translations } from '../../../locales/i18n'; | ||
import { LendingPool } from '../../../utils/LendingPool'; | ||
|
||
type FixedInterestPoolRowTitleProps = { | ||
pool: LendingPool; | ||
isBorrow?: boolean; | ||
}; | ||
|
||
export const FixedInterestPoolRowTitle: FC<FixedInterestPoolRowTitleProps> = ({ | ||
pool, | ||
isBorrow = false, | ||
}) => ( | ||
<div className="flex justify-between items-center w-full"> | ||
<AssetRenderer | ||
dataAttribute={`${isBorrow ? 'borrow-table' : 'lend-frame'}-asset`} | ||
showAssetLogo | ||
asset={pool.getAsset()} | ||
className="mr-1" | ||
/> | ||
<div className="pl-1 flex items-center"> | ||
{isBorrow ? ( | ||
<NextBorrowInterestRate asset={pool.getAsset()} /> | ||
) : ( | ||
<NextSupplyInterestRate asset={pool.getAsset()} /> | ||
)} | ||
<span className="text-gray-30 ml-1 font-medium"> | ||
{isBorrow | ||
? t(translations.fixedInterestPage.borrowAssetsTable.borrowAprMobile) | ||
: t(translations.lendPage.table.lendApyMobile)} | ||
</span> | ||
</div> | ||
</div> | ||
); |
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
Oops, something went wrong.