Skip to content

Commit

Permalink
chore: update home page banner
Browse files Browse the repository at this point in the history
  • Loading branch information
hemantwasthere committed Nov 24, 2024
1 parent 20cfa93 commit 0053d70
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 23 deletions.
62 changes: 62 additions & 0 deletions public/banners/endur.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions public/banners/endur_mobile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import { isMobile } from 'react-device-detect';

const banner_images = [
{
desktop: '/banners/ognft.svg',
mobile: '/banners/ognft_small.svg',
link: 'https://x.com/strkfarm/status/1788558092109775029',
desktop: '/banners/endur.svg',
mobile: '/banners/endur_mobile.svg',
link: 'https://endur.fi',
},
{
desktop: '/banners/seed_grant.svg',
Expand Down
9 changes: 6 additions & 3 deletions src/components/Strategies.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CONSTANTS from '@/constants';
import { usePagination } from '@ajna/pagination';
import {
Container,
Link,
Expand All @@ -13,13 +13,16 @@ import {
} from '@chakra-ui/react';
import { useAtomValue } from 'jotai';
import React, { useMemo } from 'react';

import CONSTANTS from '@/constants';
import { filteredPools } from '@/store/protocols';
import { usePagination } from '@ajna/pagination';
import { YieldStrategyCard } from './YieldCard';
import {
STRKFarmBaseAPYsAtom,
STRKFarmStrategyAPIResult,
} from '@/store/strkfarm.atoms';

import { YieldStrategyCard } from './YieldCard';

export default function Strategies() {
const strkFarmPoolsRes = useAtomValue(STRKFarmBaseAPYsAtom);
const strkFarmPools = useMemo(() => {
Expand Down
18 changes: 9 additions & 9 deletions src/components/YieldCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import shield from '@/assets/shield.svg';
import CONSTANTS from '@/constants';
import { addressAtom } from '@/store/claims.atoms';
import { PoolInfo } from '@/store/pools';
import { getPoolInfoFromStrategy, sortAtom } from '@/store/protocols';
import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.atoms';
import { UserStats, userStatsAtom } from '@/store/utils.atoms';
import { StrategyLiveStatus } from '@/strategies/IStrategy';
import { getDisplayCurrencyAmount } from '@/utils';
import { TriangleDownIcon, TriangleUpIcon } from '@chakra-ui/icons';
import {
Avatar,
AvatarGroup,
Expand All @@ -21,17 +29,9 @@ import {
Tr,
VStack,
} from '@chakra-ui/react';
import shield from '@/assets/shield.svg';
import { StrategyLiveStatus } from '@/strategies/IStrategy';
import { useAtomValue } from 'jotai';
import { getDisplayCurrencyAmount } from '@/utils';
import { addressAtom } from '@/store/claims.atoms';
import { FaWallet } from 'react-icons/fa';
import { UserStats, userStatsAtom } from '@/store/utils.atoms';
import { getPoolInfoFromStrategy, sortAtom } from '@/store/protocols';
import { TriangleDownIcon, TriangleUpIcon } from '@chakra-ui/icons';
import mixpanel from 'mixpanel-browser';
import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.atoms';
import { FaWallet } from 'react-icons/fa';

interface YieldCardProps {
pool: PoolInfo;
Expand Down
52 changes: 52 additions & 0 deletions src/store/endur.store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { atom } from 'jotai';
import { atomWithQuery } from 'jotai-tanstack-query';

import fetchWithRetry from '@/utils/fetchWithRetry';

import { IDapp } from './IDapp.store';
import { PoolInfo } from './pools';

interface PoolData {
tvl: number;
apr: {
percentage: number;
apr_cl: number;
apr: number;
incentive_apr: number;
};
}

interface IndexedPoolData {
[key: string]: PoolData[];
}

export class Endur extends IDapp<IndexedPoolData> {
name = 'Endur';
link = 'https://endur.fi';
logo = 'https://endur.fi/favicon.ico';
incentiveDataKey: string = 'Endur';
}

export const endur = new Endur();

const EndurAtoms = {
endurStats: atomWithQuery((_get) => ({
queryKey: ['Endur_APY'],
queryFn: async ({ queryKey: _ }) => {
const url = 'https://testnet.endur.fi/api/stats';
const response = await fetchWithRetry(url);

if (!response) return null;

const data = await response.json();

return data;
},
})),
pools: atom((_get) => {
const empty: PoolInfo[] = [];
return empty;
}),
};

export default EndurAtoms;
22 changes: 14 additions & 8 deletions src/store/protocols.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
import strkfarmLogo from '@public/logo.png';
import { atom } from 'jotai';
import CarmineAtoms, { carmine } from './carmine.store';
import EkuboAtoms, { ekubo } from './ekobu.store';
import HaikoAtoms, { haiko } from './haiko.store';
import HashstackAtoms, { hashstack } from './hashstack.store';
import MySwapAtoms, { mySwap } from './myswap.store';
import NostraDexAtoms, { nostraDex } from './nostradex.store';
import NostraDegenAtoms, { nostraDegen } from './nostradegen.store';
import NostraDexAtoms, { nostraDex } from './nostradex.store';
import NostraLendingAtoms, { nostraLending } from './nostralending.store';
import VesuAtoms, { vesu } from './vesu.store';
import ZkLendAtoms, { zkLend } from './zklend.store';
import CarmineAtoms, { carmine } from './carmine.store';
import { atom } from 'jotai';
import { Category, PoolInfo, PoolType } from './pools';
import strkfarmLogo from '@public/logo.png';
import { getLiveStatusEnum } from './strategies.atoms';
import STRKFarmAtoms, {
strkfarm,
STRKFarmStrategyAPIResult,
} from './strkfarm.atoms';
import { getLiveStatusEnum } from './strategies.atoms';
import VesuAtoms, { vesu } from './vesu.store';
import ZkLendAtoms, { zkLend } from './zklend.store';

export const PROTOCOLS = [
// {
// name: endur.name,
// class: endur,
// atoms: EndurAtoms,
// },
{
name: strkfarm.name,
class: strkfarm,
Expand Down Expand Up @@ -106,11 +111,12 @@ const allProtocols = PROTOCOLS.map((p) => ({
name: p.name,
logo: p.class.logo,
}));

export const filters = {
categories: [...Object.values(Category)],
types: [...Object.values(PoolType)],
protocols: allProtocols.filter(
(p, index) => allProtocols.findIndex((_p) => _p.name == p.name) == index,
(p, index) => allProtocols.findIndex((_p) => _p.name === p.name) === index,
),
};

Expand Down

0 comments on commit 0053d70

Please sign in to comment.