Skip to content

Commit de023c7

Browse files
authored
Merge pull request #863 from subquery/feat/consumer-rewards-banner
feat: consumer rewards
2 parents ba0a909 + 1a9ff56 commit de023c7

8 files changed

Lines changed: 33 additions & 141 deletions

File tree

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import React, { PropsWithChildren, useCallback, useEffect, useRef } from 'react';
55
import { BrowserRouter } from 'react-router-dom';
6+
import AlertBanner from '@components/AlertBanner/AlertBanner';
67
import { ChainStatus } from '@components/ConnectWallet';
78
import { Header } from '@components/Header';
89
import { AppInitProvider } from '@containers/AppInitialProvider';
@@ -91,6 +92,7 @@ const RenderRouter: React.FC = () => {
9192
<div className="Header">
9293
<Header />
9394
</div>
95+
<AlertBanner center></AlertBanner>
9496
<div className="Content">
9597
<ChainStatus>
9698
<RouterComponent></RouterComponent>

src/components/AlertBanner/AlertBanner.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,17 @@ const AlertBanner: FC<{ center?: boolean }> = ({ center = false }) => {
6464
fill="white"
6565
/>
6666
</svg>
67-
SubQuery AI Apps are here
67+
SubQuery’s 100 Million $SQT Consumer Rewards Programme is Here!
6868
</Typography>
6969
<Typography variant="medium" style={{ color: '#fff' }}>
70-
SubQuery AI Apps framework makes building decentralised AI Applications fast and easy. AI apps are self
71-
contained and easily scalable AI agents that you can use to power your intelligent applications.
72-
<br></br>Try it out by clicking the chatbot icon on the bottom right of your screen!
70+
Host your indexer or use RPCs on the SubQuery Network and earn up to 900% of your query spending in
71+
rewards. The sooner you deploy on the network, the more you stand to gain.
7372
</Typography>
7473
</div>
7574
<span style={{ flex: 1 }}></span>
7675
<Button shape="round" size="large">
77-
<Typography.Link href="https://academy.subquery.network/ai/welcome.html" type="info" target="_blank">
78-
Start building AI Apps
76+
<Typography.Link href="https://subquery.foundation/consumer-rewards" type="info" target="_blank">
77+
Learn More
7978
</Typography.Link>
8079
</Button>
8180
</div>

src/components/GlobalBanner/GlobalBanner.module.css

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/components/GlobalBanner/GlobalBanner.tsx

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/components/GlobalBanner/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/components/NotificationCentre/useMakeNotification.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,11 +803,33 @@ export const useMakeNotification = () => {
803803
}
804804
}, [currentEra.data?.index, notificationStore.notificationList]);
805805

806+
const makeConsumerRewardsProgrameNotification = useCallback(async () => {
807+
notificationStore.addNotification(
808+
{
809+
key: NotificationKey.ConsumerRewards,
810+
level: 'info',
811+
message: `We’ve allocated 1 Million $SQT rewards pool for consumers who host their indexers or use dRPCs on the SubQuery Network. Earn up to 900% of your query spending.`,
812+
title: 'Consumer Rewards Pool Increase',
813+
createdAt: Date.now(),
814+
canBeDismissed: true,
815+
dismissTime: defaultDismissTime,
816+
dismissTo: undefined,
817+
type: '',
818+
buttonProps: {
819+
label: 'Learn More',
820+
navigateHref: 'https://subquery.foundation/consumer-rewards',
821+
},
822+
},
823+
true,
824+
);
825+
}, [notificationStore.notificationList]);
826+
806827
const initAllNotification = useCallback(() => {
807828
idleCallback(() =>
808829
idleQueue([
809830
// use this sort to make sure the most important notification show first
810831
//
832+
() => makeConsumerRewardsProgrameNotification(),
811833
() => makeUnhealthyConsumerRewardsProjectNotification(),
812834
() => makeOverAllocateAndUnStakeAllocationNotification(),
813835
() => makeLowControllerBalanceNotification(),
@@ -833,6 +855,7 @@ export const useMakeNotification = () => {
833855
makeInOrDecreaseCommissionNotification,
834856
makeNewOperatorNotification,
835857
makeUnhealthyConsumerRewardsProjectNotification,
858+
makeConsumerRewardsProgrameNotification,
836859
]);
837860

838861
return {

src/pages/dashboard/components/ActiveCard/ActiveCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ export const ActiveCard = () => {
173173
Consumer Rewards Programme
174174
</Typography>
175175
<Typography type="secondary" style={{ whiteSpace: 'pre-wrap' }}>
176-
Earn up to 900% of your query spending in SQT rewards, with dedicated reward pools for both
177-
Subgraphs and SubQuery Projects.
176+
We’ve allocated 1 Million $SQT rewards pool for consumers who host their indexers or use dRPCs on
177+
the SubQuery Network. Earn up to 900% of your query spending.
178178
</Typography>
179179

180180
<div>

src/stores/notification.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export enum NotificationKey {
3030
DecreaseCommissionRate = 'decreaseCommissionRate',
3131
IncreaseCommissionRate = 'increaseCommissionRate',
3232
NewOperator = 'newOperator',
33+
ConsumerRewards = 'ConsumerRewards',
3334
}
3435

3536
const NotificationItemFromIo = t.type({

0 commit comments

Comments
 (0)