-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: some type errors * add: services model draft * change: more opportunity types * fix: lint * add: themes and theme switcher in dev mode (#4) * add: theme selector when in dev mode * add: theme switcher in dev mode * fix: protocol empty tag * fix: lint error * Tabs sync (#5) * tabs, capitalize, socials * fix lint * change links to terms & priuvacy * lint * move edit address to breadcrumbs * user edit in component * footer issue ok * show bg-main color instead of banner outside of home and opportunities * add link to protocol header * implement zkSync colors/fonts as default * commit hash * lint * remove comments * lint * feat: re add CI (#6) * Feat/leaderboard display (#7) * Update the display of daily rewards * refactor: update CampaignTableRow to use Dropdown for blacklist and whitelist, and improve layout with Divider * wip handling rewards * update: dashboard styling (#8) * tweak: dashboard * tweak: dappkit * fix: no user warning * remove: input from description * fix: lint * add(front): modal, hero, select, tabs/tags, pagination (#9) * pagination wip * review Hero cpt gp * change pagination * change modal * change Hero + connect wallet and search results modals * lint * commit hash * comit hash * commit * update: opportunity campaigns/leaderboard view (#11) * update: campaign information collapsible * update: campaign information * add: campaign rules * update: leaderboard * fixes * fix: lint * tweaks * fix: aggregate * feat: add APR modal and table components for opportunity details on h… (#10) * feat: add APR modal and table components for opportunity details on hover opportunities table * lint * Apr tvl modal end * Feat Hero campaign and protocol (#13) * Feat Hero campaign and protocol * fix api call on subpage * lint and request can't be undefinable on service * feat(opportunity): new hero, tableRow, OpportunityFilters (#15) * working on table row + new hero image * add fitlers * add todos * lint * lint * ✨ sum daily rewards fora protocol (#16) * Fix/campaign page (#17) * wording * fix hero link default home * lint * wording * wording * show icon * ✨ redirect to Etherscan on TOken tooltip * 🐛 change Time zone UTC * update: opportunities pages (#14) * add: metrics badges * update: opportunity list * fix: rewardsRecord sometimes being missing * add: apply button * add: loading bar * rm: log & lint * add: protocols filter * fix: search params * fix: * fix: lint * add: missing chains * fixes * update: dappkit * fix: lint * remove: comment * add: constant * apr (#18) * apr done * hide forwards if none + change border * lint * replace content null * Fix/campaign page (#20) * wording * fix lint error * fix time when live * wording * link to dashboard on leaderboard addresses * Leaderboard campaign selector display * lint * add lastSnapshot * add lastSnapshot (#21) * fixes: feedback, mainly opportunities & dashboard (#22) * fix: search & filters * update: descriptions * add: rewards siorting * add: tvl filter * fix * fix: redirect * fix: whitelist * add: selective claim * add: selective token * add: global claim * fix * lint * typo * fix: explorer * caching * add caching test * lint * update * add: cache on static resoruces (#23) * Enhance opportunity data retrieval with APR and daily rewards metrics (#24) * fix: pagination defaulting & cache (#25) * fix: bugs in selectors * fix: dappkit * clean wip: comment out static sideDatas for dynamic implementation (#26) * fix: protocl filter (#27) * fix: protocol desc (#28) * fix: protocol: description * rm: log * token stats + cleaning (#29) * Small APR Fix (#19) * lint * commit hash * commit hash * commit hash * Fixes on protocol, chain, token and campaign pages (#30) * Fixes on protocol, chain, token and campaign pages * lint * fix tooltip * add: depositor (#31) * update: dappkit (#33) * remove: workflwos --------- Co-authored-by: sheykei <[email protected]> Co-authored-by: Viande <[email protected]> Co-authored-by: Picodes <[email protected]> Co-authored-by: hugolxt <[email protected]> Co-authored-by: Hugo Lextrait <[email protected]>
- Loading branch information
1 parent
1b51273
commit af7653b
Showing
119 changed files
with
3,033 additions
and
1,256 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
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,42 @@ | ||
import type { ClientLoaderFunction, ClientLoaderFunctionArgs } from "@remix-run/react"; | ||
import NodeCache from "node-cache"; | ||
|
||
export class CacheService { | ||
cache = new NodeCache(); | ||
|
||
set<T>(key: string, ttl: number, value: T) { | ||
this.cache.set(key, value, ttl); | ||
|
||
return value; | ||
} | ||
|
||
get<T>(key: string): T | undefined { | ||
const cached = this.cache.get<T>(key); | ||
|
||
return cached; | ||
} | ||
|
||
reset(key: string) { | ||
this.cache.del(key); | ||
} | ||
|
||
wrap(resource: string, ttl: number): ClientLoaderFunction { | ||
const loader = async ({ request, serverLoader }: ClientLoaderFunctionArgs) => { | ||
const key = `${resource}:${request.url}`; | ||
const cache = Cache.get(key); | ||
|
||
if (cache) return cache; | ||
|
||
const data = await serverLoader(); | ||
|
||
Cache.set(key, ttl, data); | ||
|
||
return data; | ||
}; | ||
|
||
loader.hydrate = true; | ||
return loader; | ||
} | ||
} | ||
|
||
export const Cache = new CacheService(); |
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 @@ | ||
import type { Campaign as CampaignFromApi } from "@merkl/api"; | ||
import type { Fetched } from "src/api/types"; | ||
|
||
export type Campaign<C extends CampaignFromApi["type"] = CampaignFromApi["type"]> = Fetched<CampaignFromApi<C>> & { | ||
params: CampaignFromApi<C>["params"]; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { Opportunity as OpportunityFromApi } from "@merkl/api"; | ||
import type { Fetched } from "src/api/types"; | ||
import type { Campaign } from "../campaigns/campaign.model"; | ||
|
||
export type Opportunity = Fetched<OpportunityFromApi>; | ||
export type OpportunityWithCampaigns = Fetched<OpportunityFromApi & { campaigns: Campaign[] }>; |
Oops, something went wrong.