From 9d91810487e95d759218f9a1cf11fcf6858e8c04 Mon Sep 17 00:00:00 2001
From: Pawel-Szydlo <89639506+Pawel-Szydlo@users.noreply.github.com>
Date: Wed, 9 Mar 2022 17:21:31 +0100
Subject: [PATCH] add Synthetify to mainnet-beta.json (#424)
* add Synthetify to mainnet-beta.json
* add sortRank to RealmInfo
---
models/registry/api.ts | 2 +
next-env.d.ts | 1 -
pages/realms/index.tsx | 10 +-
.../realms/SNY/img/synthetify_logo_green.svg | 146 ++++++++++++++++++
public/realms/mainnet-beta.json | 10 ++
5 files changed, 165 insertions(+), 4 deletions(-)
create mode 100644 public/realms/SNY/img/synthetify_logo_green.svg
diff --git a/models/registry/api.ts b/models/registry/api.ts
index a008358052..1aa966ca15 100644
--- a/models/registry/api.ts
+++ b/models/registry/api.ts
@@ -29,6 +29,8 @@ export interface RealmInfo {
bannerImage?: string
isCertified: boolean
+ // 3- featured DAOs ,2- new DAO with active proposals, 1- DAOs with active proposal,
+ sortRank?: number
}
export function getProgramVersionForRealm(realmInfo: RealmInfo) {
diff --git a/next-env.d.ts b/next-env.d.ts
index 9bc3dd46b9..4f11a03dc6 100644
--- a/next-env.d.ts
+++ b/next-env.d.ts
@@ -1,5 +1,4 @@
///
-///
///
// NOTE: This file should not be edited
diff --git a/pages/realms/index.tsx b/pages/realms/index.tsx
index 3eb8752f6a..f8599b298c 100644
--- a/pages/realms/index.tsx
+++ b/pages/realms/index.tsx
@@ -36,8 +36,8 @@ const Realms = () => {
getUnchartedRealmInfos(connection),
])
const allRealms = [...certifiedRealms, ...uncharteredRealms]
- setRealms(allRealms)
- setFilteredRealms(allRealms)
+ setRealms(sortDaos(allRealms))
+ setFilteredRealms(sortDaos(allRealms))
setIsLoadingRealms(false)
}
if (selectedRealm.realm) {
@@ -59,7 +59,11 @@ const Realms = () => {
}
router.push(fmtUrlWithCluster(`/realms/new`))
}
-
+ const sortDaos = (realmInfoData: RealmInfo[]) => {
+ return realmInfoData.sort((a: RealmInfo, b: RealmInfo) => {
+ return (b.sortRank ?? -0) - (a.sortRank ?? -0)
+ })
+ }
const filterDaos = (v) => {
setSearchString(v)
if (v.length > 0) {
diff --git a/public/realms/SNY/img/synthetify_logo_green.svg b/public/realms/SNY/img/synthetify_logo_green.svg
new file mode 100644
index 0000000000..ab67ca7f46
--- /dev/null
+++ b/public/realms/SNY/img/synthetify_logo_green.svg
@@ -0,0 +1,146 @@
+
+
+
+
diff --git a/public/realms/mainnet-beta.json b/public/realms/mainnet-beta.json
index af01a830ef..d9175d19c0 100644
--- a/public/realms/mainnet-beta.json
+++ b/public/realms/mainnet-beta.json
@@ -17,6 +17,16 @@
"twitter": "@mangomarkets",
"ogImage": "https://trade.mango.markets/assets/icons/logo.svg"
},
+ {
+ "symbol": "SNY",
+ "displayName": "Synthetify",
+ "programId": "GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw",
+ "realmId": "7oB84bSuxv9AH1iRdMp5nFLwpQApv8Yo9s1gGmDkHtSP",
+ "ogImage": "/realms/SNY/img/synthetify_logo_green.svg",
+ "website": "https://synthetify.io/",
+ "twitter": "@synthetify",
+ "sortRank": 2
+ },
{
"symbol": "SOCEAN",
"programId": "5hAykmD4YGcQ7Am3N7nC9kyELq6CThAkU82nhNKDJiCy",