Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move capacity url fn to a separate file #473

Merged
merged 2 commits into from
Jun 4, 2023

Conversation

zaelgohary
Copy link
Contributor

Description

  • Move capacity url fn to a separate file

Related Issues

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstrings
  • Screenshots/Video attached (needed for UI changes)

@@ -0,0 +1,14 @@
import { NetworkEnv } from "@threefold/grid_client";

const network = process.env.NETWORK || (window as any).env.NETWORK;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line isn't needed, it can be passed from the calling function, the file should be only the getCapacityURL function parameterized in the a network var, the usage of that function should be in the right context

return `https://dashboard.${network}.grid.tf/explorer/statistics`;
};

const capacityURL = getCapacityURL(network);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be called here


const capacityURL = getCapacityURL(network);

export default capacityURL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the exported should be the getCapacityURL function, this variable capacityURL shouldn't exist, it needs to only exist at the caller frame

@zaelgohary zaelgohary requested a review from xmonader June 4, 2023 14:57
@zaelgohary zaelgohary merged commit 8c14e7b into development Jun 4, 2023
@xmonader
Copy link
Contributor

xmonader commented Jun 4, 2023

Awesome!

@zaelgohary zaelgohary deleted the development_capacity_url branch June 4, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants