Skip to content

Commit

Permalink
Merge pull request #614 from UnUniFi/apps-management
Browse files Browse the repository at this point in the history
Apps management by config.js
  • Loading branch information
Senna46 authored Aug 18, 2023
2 parents d417c92 + 7f02506 commit d954971
Show file tree
Hide file tree
Showing 30 changed files with 176 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
{ name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
// { name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -184,6 +191,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
{ name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
{ name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -184,6 +191,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
{ name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
{ name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -183,6 +190,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
// { name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
// { name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -213,6 +220,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
strategiesInfo,
extension: {
Expand Down Expand Up @@ -244,6 +252,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
strategiesInfo,
extension: {
Expand Down Expand Up @@ -275,6 +284,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
strategiesInfo,
extension: {
Expand Down Expand Up @@ -306,6 +316,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
strategiesInfo,
extension: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
// { name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
// { name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -183,6 +190,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down Expand Up @@ -213,6 +221,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down Expand Up @@ -243,6 +252,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [],
Expand All @@ -265,6 +275,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [],
Expand Down
8 changes: 8 additions & 0 deletions projects/explorer/src/assets/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
// { name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
// { name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -185,6 +192,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
{ name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
// { name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -184,6 +191,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
{ name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
{ name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -184,6 +191,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
{ name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
{ name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -183,6 +190,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
// { name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
// { name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -184,6 +191,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
strategiesInfo,
extension: {
Expand Down Expand Up @@ -215,6 +223,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
strategiesInfo,
extension: {
Expand Down Expand Up @@ -246,6 +255,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
strategiesInfo,
extension: {
Expand Down Expand Up @@ -277,6 +287,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
strategiesInfo,
extension: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const messageModules = [
'pricefeed',
];

const apps = [
{ name: 'Utilities', link: '/', icon: 'assistant' },
// { name: 'NFT Backed Loan', link: '/nft-backed-loan/nfts', icon: 'loyalty' },
{ name: 'Yield Aggregator', link: '/yield-aggregator/vaults', icon: 'pie_chart' },
// { name: 'Derivatives', link: '/derivatives/perpetual-futures', icon: 'show_chart' },
];

const denomMetadata = [
{
description: 'The governance token of UnUniFi protocol.',
Expand Down Expand Up @@ -183,6 +190,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down Expand Up @@ -213,6 +221,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [
Expand Down Expand Up @@ -243,6 +252,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [],
Expand All @@ -265,6 +275,7 @@ const configs = [
amount: 0.015,
},
],
apps,
denomMetadata,
extension: {
faucet: [],
Expand Down
7 changes: 7 additions & 0 deletions projects/portal/src/app/models/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type Config = {
denom: string;
amount: string;
}[];
apps: AppNavigation[];
denomMetadata: cosmosclient.proto.cosmos.bank.v1beta1.IMetadata[];
strategiesInfo: StrategyInfo[];
extension?: {
Expand Down Expand Up @@ -50,6 +51,12 @@ export type Config = {
};
};

export type AppNavigation = {
name: string;
link: string;
icon: string;
};

export type StrategyInfo = {
id: string;
name: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<view-app-derivatives [navigations]="navigations$ | async"><router-outlet></router-outlet></view-app-derivatives>
<view-app-derivatives [apps]="apps$ | async" [navigations]="navigations$ | async"
><router-outlet></router-outlet
></view-app-derivatives>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfigService } from '../../../models/config.service';
import { AppNavigation, ConfigService } from '../../../models/config.service';
import { DeveloperService } from '../../../models/developer.service';
import { StoredWallet } from '../../../models/wallets/wallet.model';
import { WalletService } from '../../../models/wallets/wallet.service';
Expand All @@ -13,6 +13,7 @@ import { filter, map } from 'rxjs/operators';
})
export class AppDerivativesComponent implements OnInit {
address$: Observable<string | undefined>;
apps$: Observable<AppNavigation[] | undefined>;
navigations$: Observable<{ name: string; link: string; icon: string }[] | undefined>;

constructor(
Expand All @@ -26,6 +27,7 @@ export class AppDerivativesComponent implements OnInit {
map((wallet) => wallet.address),
);
const config$ = this.configS.config$;
this.apps$ = config$.pipe(map((conf) => conf?.apps));
this.navigations$ = combineLatest([this.address$, config$]).pipe(
map(([address, config]) => {
const navigation = config?.extension?.navigations.slice();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<view-app-nft-backed-loans [navigations]="navigations$ | async"
<view-app-nft-backed-loans [apps]="apps$ | async" [navigations]="navigations$ | async"
><router-outlet></router-outlet
></view-app-nft-backed-loans>
Loading

0 comments on commit d954971

Please sign in to comment.