Skip to content

Commit

Permalink
Merge branch 'develop' into feat/SOV-3871-staking-rewards-os
Browse files Browse the repository at this point in the history
  • Loading branch information
soulBit committed Apr 5, 2024
2 parents 98c5497 + 177e770 commit 0ed413a
Show file tree
Hide file tree
Showing 68 changed files with 1,459 additions and 122 deletions.
5 changes: 0 additions & 5 deletions .changeset/clever-adults-bathe.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/light-ears-dream.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/little-socks-tie.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nervous-windows-kneel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/olive-dolphins-repair.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/tame-beans-travel.md

This file was deleted.

42 changes: 42 additions & 0 deletions apps/frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# frontend

## 1.0.52

### Patch Changes

- 6d5ba110: SOV-3985: Refactor POWA menu display
Update dapp Favicon

## 1.0.51

### Patch Changes

- 3ffea217: SOV-3964: open links in SIP proposals in a new browser tab
- 0c16d474: SOV-3917: New voting power is now shown correctly when extending an existing stake
- 0061ffe3: SOV-3870: Replace ZUSD with DLLR in Ecosystem Statistics

## 1.0.50

### Patch Changes

- 8a310501: SOV-3978: Leaderboard copy adjustments

## 1.0.49

### Patch Changes

- d9f276a7: SOV-3963: Use name() to identify SIP proposal as non-executable

## 1.0.48

### Patch Changes

- 50f7724d: SOV-3935: Competition leaderboard

## 1.0.47

### Patch Changes

- 3d6870a1: SOV-3827: Protocol Data Page
- 865fa7ba: SOV-3823: Fix markdown display on Bitocracy
- Updated dependencies [3d6870a1]
- @sovryn/ui@1.0.23

## 1.0.46

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "1.0.46",
"version": "1.0.52",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/frontend/public/favicon-white.png
Binary file not shown.
Binary file removed apps/frontend/public/favicon.ico
Binary file not shown.
Binary file removed apps/frontend/public/favicon.png
Binary file not shown.
6 changes: 5 additions & 1 deletion apps/frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@
}
}
</style>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="icon" href="%PUBLIC_URL%/65f8461a5e19e361750f0b25_Pic.png" />
<link
href="%PUBLIC_URL%/660572553f6c84fdff7a5928_256.png"
rel="apple-touch-icon"
/>
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet"
Expand Down
Binary file removed apps/frontend/public/logo192.png
Binary file not shown.
Binary file removed apps/frontend/public/logo512.png
Binary file not shown.
13 changes: 4 additions & 9 deletions apps/frontend/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
"name": "Sovryn dapp",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"src": "65f8461a5e19e361750f0b25_Pic.png",
"type": "image/png",
"sizes": "192x192"
"sizes": "32x32"
},
{
"src": "logo512.png",
"src": "660572553f6c84fdff7a5928_256.png",
"type": "image/png",
"sizes": "512x512"
"sizes": "256x256"
}
],
"start_url": "./",
Expand Down
46 changes: 46 additions & 0 deletions apps/frontend/src/app/2_molecules/CTA/CTA.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React, { FC } from 'react';

import { Button, ButtonStyle, Paragraph } from '@sovryn/ui';

type CTAProps = {
index: number;
backgroundImage: string;
title: string;
description: string;
action: string;
navigateTo: () => void;
};

export const CTA: FC<CTAProps> = ({
index,
backgroundImage,
title,
description,
action,
navigateTo,
}) => (
<div
key={index}
className="relative p-4 md:p-6 bg-gray-70 rounded flex flex-col md:items-start justify-end md:min-h-60 min-h-40"
>
<img
src={backgroundImage}
alt={title}
className="absolute top-0 right-0 md:max-w-none max-w-14"
/>
<Paragraph
className="mb-6 font-medium text-sm xl:max-w-36 xl:pr-0 pr-12"
children={title}
/>
<Paragraph
className="mb-4 md:mb-6 font-medium xl:pr-0 pr-12 text-gray-30"
children={description}
/>
<Button
className="w-full sm:w-auto"
text={action}
onClick={navigateTo}
style={ButtonStyle.secondary}
/>
</div>
);
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,28 @@ export const EcosystemStats: FC<EcosystemStatsProps> = ({
);
const myntMassetManager = useLoadContract('massetManager', 'protocol');

const { balance: babelFishZUSDBalance } = useAssetBalance(
SupportedTokens.zusd,
const { balance: babelFishDLLRBalance } = useAssetBalance(
SupportedTokens.dllr,
getRskChainId(),
babelFishMassetManager?.address.toLowerCase() || '',
);

const renderBabelFishZUSDBalance = useMemo(
const renderBabelFishDLLRBalance = useMemo(
() =>
babelFishZUSDBalance ? (
babelFishDLLRBalance ? (
<>
<AmountRenderer
value={babelFishZUSDBalance}
suffix={SupportedTokens.zusd}
value={babelFishDLLRBalance}
suffix={SupportedTokens.dllr}
precision={USD_DISPLAY_PRECISION}
showRoundingPrefix={false}
dataAttribute="ecosystem-statistics-babel-fish-zusd-balance"
dataAttribute="ecosystem-statistics-babel-fish-dllr-balance"
/>
</>
) : (
0
),
[babelFishZUSDBalance],
[babelFishDLLRBalance],
);

const { balance: myntZUSDBalance } = useAssetBalance(
Expand Down Expand Up @@ -137,8 +137,8 @@ export const EcosystemStats: FC<EcosystemStatsProps> = ({
>
<SimpleTableRow
className="mb-8"
label={t(translations.stats.ecosystem.babelFishZUSDBalance)}
value={renderBabelFishZUSDBalance}
label={t(translations.stats.ecosystem.babelFishDLLRBalance)}
value={renderBabelFishDLLRBalance}
/>
<SimpleTableRow
className="mb-8"
Expand Down
5 changes: 5 additions & 0 deletions apps/frontend/src/app/3_organisms/Header/Header.constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export const menuItemsMapping: MenuItem[] = [
label: t(translations.header.nav.earn.subMenu.stakingDescription),
url: '/earn/staking',
},
{
text: t(translations.leaderboardPage.headerLink),
label: t(translations.leaderboardPage.headerDescription),
url: '/powa',
},
],
},
{
Expand Down
6 changes: 6 additions & 0 deletions apps/frontend/src/app/3_organisms/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export const Header: FC = () => {
</li>
))}
<ProductLinks />
<Button
text={t(translations.header.nav.bob)}
style={ButtonStyle.primary}
className="bg-[#24BFB74D]/[0.3] border-[#24BFB74D]/[0.3] hover:bg-[#24BFB74D]"
onClick={() => window.open('https://gobob.sovryn.app', '_blank')}
/>
</ol>
}
secondaryContent={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,22 @@ export const AdjustStakeForm: FC<AdjustStakeFormProps> = ({
setVotingPowerChanged(0);
}
if (weight !== 0) {
setVotingPowerChanged(
(Number(!isExtendTab ? amount : stake.stakedAmount) * weight) /
WEIGHT_FACTOR,
);
if (isExtendTab) {
setVotingPowerChanged(
(Number(stake.stakedAmount) * weight) / WEIGHT_FACTOR - votingPower,
);
} else {
setVotingPowerChanged((Number(amount) * weight) / WEIGHT_FACTOR);
}
}
}, [amount, weight, isValidAmount, isExtendTab, stake.stakedAmount]);
}, [
amount,
weight,
isValidAmount,
isExtendTab,
stake.stakedAmount,
votingPower,
]);

useEffect(() => {
setAmount('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ export const ProposalDataForm: FC<ProposalDataFormProps> = ({
<div className={styles.description}>
<ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
a: props => (
<a href={props.href} target="_blank" rel="noreferrer">
{props.children}
</a>
),
}}
className="w-full bg-gray-70 border border-gray-70 p-3 rounded focus:border-gray-60 mt-2 min-h-36 overflow-auto"
>
{form.text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ export const ProposalTitle: FC<ProposalProps> = ({ proposal }) => {
<ReactMarkdown
remarkPlugins={[remarkGfm]}
className="max-h-64 overflow-auto"
components={{
a: props => (
<a href={props.href} target="_blank" rel="noreferrer">
{props.children}
</a>
),
}}
>
{proposalInfo.description}
</ReactMarkdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ export const StatusIcons: Record<ProposalState, string> = {

export const GRACE_PERIOD_IN_SECONDS = 1209600; // 14 days

export const SIGNATURE_SYMBOL = 'symbol()';
export const SIGNATURE_SYMBOLS = ['symbol()', 'name()'];
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SupportedTokens } from '@sovryn/contracts';

import { useGetTokenContract } from '../../../../hooks/useGetContract';
import { Proposal } from '../../../../utils/graphql/rsk/generated';
import { SIGNATURE_SYMBOL } from '../components/Proposals/Proposals.constants';
import { SIGNATURE_SYMBOLS } from '../components/Proposals/Proposals.constants';

export const useIsExecutableProposal = (proposal: Proposal) => {
const sovContract = useGetTokenContract(SupportedTokens.sov);
Expand All @@ -13,7 +13,7 @@ export const useIsExecutableProposal = (proposal: Proposal) => {
if (
proposal.targets.length === 1 &&
proposal.targets[0] === sovContract?.address &&
proposal.signatures[0] === SIGNATURE_SYMBOL
SIGNATURE_SYMBOLS.includes(proposal.signatures[0])
) {
return false;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@ import { useNavigate } from 'react-router-dom';

import { Button, ButtonSize, ButtonStyle } from '@sovryn/ui';

import { WIKI_LINKS } from '../../../../../constants/links';
import { POWA_LINK } from '../../../../../constants/links';
import { translations } from '../../../../../locales/i18n';
import styles from './Banner.module.css';
import { LandingPromoCard } from './components/LandingPromoCard/LandingPromoCard';

export const Banner: FC = () => {
const navigate = useNavigate();

const handleClick = useCallback(
() => navigate('/convert?from=rbtc&to=sov'),
[navigate],
);
const handleClick = useCallback(() => navigate('/powa'), [navigate]);

return (
<div className="w-full relative pb-7">
<Carousel
arrows={false}
draggable
draggable={false} // Needs to be true when we have more than 1 promo
partialVisible={false}
focusOnSelect={false}
responsive={{
Expand All @@ -45,20 +42,24 @@ export const Banner: FC = () => {
infinite
>
<LandingPromoCard
heading={t(translations.landingPage.promotions.sov.title)}
description={t(translations.landingPage.promotions.sov.description)}
heading={t(translations.landingPage.promotions.competition.title)}
description={t(
translations.landingPage.promotions.competition.description,
)}
actions={
<>
<Button
style={ButtonStyle.secondary}
size={ButtonSize.large}
text={t(translations.landingPage.promotions.sov.cta)}
text={t(translations.landingPage.promotions.competition.cta)}
onClick={handleClick}
/>

<Button
text={t(translations.stakePage.stakingRewards.learnMoreLink)}
href={WIKI_LINKS.STAKING}
text={t(
translations.landingPage.promotions.competition.secondaryCta,
)}
href={POWA_LINK} // TODO: Needs to be changed later, the landing page does not exist yet
style={ButtonStyle.ghost}
hrefExternal
/>
Expand Down
Loading

0 comments on commit 0ed413a

Please sign in to comment.