Skip to content

Commit

Permalink
Merge pull request #473 from threefoldtech/development_capacity_url
Browse files Browse the repository at this point in the history
Move capacity url fn to a separate file
  • Loading branch information
zaelgohary authored Jun 4, 2023
2 parents 24ea5ce + 8a1b4c0 commit 8c14e7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/playground/src/components/connect_wallet_landing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,16 @@
</template>

<script lang="ts">
import { NetworkEnv } from "@threefold/grid_client";
import { useTheme } from "vuetify";
import { getCapacityURL } from "../utils/getCapacityUrl";
export default {
name: "ConnectWalletLanding",
setup() {
const theme = useTheme();
const baseUrl = import.meta.env.BASE_URL;
const network = process.env.NETWORK || (window as any).env.NETWORK;
const getCapacityURL = (network: NetworkEnv) => {
if (network === NetworkEnv.main) {
return "https://dashboard.grid.tf/explorer/statistics";
}
return `https://dashboard.${network}.grid.tf/explorer/statistics`;
};
const capacityURL = getCapacityURL(network);
return {
Expand Down
8 changes: 8 additions & 0 deletions packages/playground/src/utils/getCapacityUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { NetworkEnv } from "@threefold/grid_client";

export function getCapacityURL(network: NetworkEnv) {
if (network === NetworkEnv.main) {
return "https://dashboard.grid.tf/explorer/statistics";
}
return `https://dashboard.${network}.grid.tf/explorer/statistics`;
}

0 comments on commit 8c14e7b

Please sign in to comment.