Skip to content

Commit

Permalink
Studio perp
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpolman committed Sep 26, 2024
1 parent b2b8333 commit 1e1b4cf
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 185 deletions.
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/BaseNavbarTop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
</template>

<script lang="ts">
import { DOCS_URL } from '@thxnetwork/dashboard/config/secrets';
import { Component, Vue } from 'vue-property-decorator';
import { mapGetters, mapState } from 'vuex';
import { DOCS_URL } from '@thxnetwork/dashboard/config/secrets';
@Component({
computed: {
Expand Down
12 changes: 6 additions & 6 deletions apps/dashboard/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import store from '@thxnetwork/dashboard/store';
import Vue from 'vue';
import VueRouter, { Route, RouteConfig } from 'vue-router';
import store from '@thxnetwork/dashboard/store';

Vue.use(VueRouter);

Expand Down Expand Up @@ -131,11 +131,6 @@ const routes: Array<RouteConfig> = [
path: 'team',
component: () => import('../views/dashboard/campaign/settings/Team.vue'),
},
{
name: 'SettingsWallets',
path: 'wallets',
component: () => import('../views/dashboard/campaign/settings/Wallets.vue'),
},
{
name: 'SettingsAppearance',
path: 'appearance',
Expand Down Expand Up @@ -171,6 +166,11 @@ const routes: Array<RouteConfig> = [
path: 'identities',
component: () => import('../views/dashboard/developer/Identities.vue'),
},
{
name: 'DeveloperWallets',
path: 'wallets',
component: () => import('../views/dashboard/developer/Wallets.vue'),
},
{
name: 'DeveloperEvents',
path: 'events',
Expand Down
25 changes: 11 additions & 14 deletions apps/dashboard/src/store/modules/pools.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Vue } from 'vue-property-decorator';
import axios from 'axios';
import { Module, VuexModule, Action, Mutation } from 'vuex-module-decorators';
import { AccountPlanType, ChainId } from '@thxnetwork/common/enums';
import { QuestEntryStatus } from '@thxnetwork/common/enums/QuestEntryStatus';
import { track } from '@thxnetwork/common/mixpanel';
import { prepareFormDataForUpload } from '@thxnetwork/dashboard/utils/uploadFile';
import { AccountPlanType, ChainId } from '@thxnetwork/common/enums';
import axios from 'axios';
import * as html from 'html-entities';
import { QuestEntryStatus } from '@thxnetwork/common/enums/QuestEntryStatus';
import { Vue } from 'vue-property-decorator';
import { Action, Module, Mutation, VuexModule } from 'vuex-module-decorators';

export interface IPoolAnalyticLeaderBoard {
_id: string;
Expand Down Expand Up @@ -77,10 +77,6 @@ export type TTwitterQueryState = {
[poolId: string]: TTwitterQuery[];
};

export type TWalletState = {
[poolId: string]: TWallet[];
};

@Module({ namespaced: true })
class PoolModule extends VuexModule {
_all: IPools = {};
Expand All @@ -89,7 +85,7 @@ class PoolModule extends VuexModule {
_rewards: TQuestState = {};
_rewardPayments: TQuestState = {};
_guilds: TGuildState = {};
_wallets: TWalletState = {};
_wallets: TWallet[] = [];
_participants: TParticipantState = {};
_couponCodes: TCouponCodeState = {};
_analytics: IPoolAnalytics = {};
Expand Down Expand Up @@ -311,19 +307,20 @@ class PoolModule extends VuexModule {
}
@Mutation
setWallets(wallets: TWallet[]) {
Vue.set(this._wallets, wallets[0].poolId, wallets);
this._wallets = wallets;
}

@Mutation
unsetWallet({ pool, walletId }) {
Vue.delete(this._wallets[pool._id], walletId);
const index = this._wallets.findIndex((w) => w._id === walletId);
Vue.delete(this._wallets, index);
}

@Action({ rawError: true })
async listWallets({ pool }) {
const { data } = await axios({
method: 'GET',
url: `/pools/${pool._id}/wallets`,
url: `/wallets`,
});
this.context.commit('setWallets', data);
}
Expand All @@ -332,7 +329,7 @@ class PoolModule extends VuexModule {
async removeWallet({ pool, walletId }) {
await axios({
method: 'DELETE',
url: `/pools/${pool._id}/wallets/${walletId}`,
url: `/wallets/${walletId}`,
});
this.context.commit('unsetWallet', { pool, walletId });
}
Expand Down
7 changes: 6 additions & 1 deletion apps/dashboard/src/views/dashboard/Developer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
</template>

<script lang="ts">
import BaseModal from '@thxnetwork/dashboard/components/modals/BaseModal.vue';
import { Component, Vue } from 'vue-property-decorator';
import { mapGetters } from 'vuex';
import BaseModal from '@thxnetwork/dashboard/components/modals/BaseModal.vue';
@Component({
components: {
Expand All @@ -52,6 +52,11 @@ import BaseModal from '@thxnetwork/dashboard/components/modals/BaseModal.vue';
})
export default class DeveloperView extends Vue {
childRoutes = [
{
name: 'Wallets',
class: 'fas fa-wallet',
route: 'wallets',
},
{
name: 'API',
class: 'fas fa-key',
Expand Down
162 changes: 0 additions & 162 deletions apps/dashboard/src/views/dashboard/campaign/settings/Wallets.vue

This file was deleted.

Loading

0 comments on commit 1e1b4cf

Please sign in to comment.