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

refactor: remove api dependencies from UI components #301

Merged
merged 30 commits into from
May 25, 2022

Conversation

tomjeatt
Copy link
Collaborator

@tomjeatt tomjeatt commented May 17, 2022

Note: Storybook is fixed, but there's an issue with the workflow pushing to Chromatic (which seems to be workflow related). No issue running Storybook locally, so PR unblocks UI development.

This PR removes all api dependencies from the new UI components (which resolves the Storybook issue) and creates configuration for vault collateral tokens. I'm happy with this solution for now - may be something we can improve upon as and when we make type changes in the lib.


Original comments:

This is still WIP, but before I tidy it up I'd really like some opinions on the solution.

The main thing here is to remove all @interlay/interbtc-ui type dependencies from the components in the componentLibrary directory as the UI components shouldn't be using these types. (This also fixes the Storybook build).

I've fixed this by created some additional types and utilities in the UI, but there may be better solutions - open to suggestions!

@vercel
Copy link

vercel bot commented May 17, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
interbtc-ui-interlay ✅ Ready (Inspect) Visit Preview May 25, 2022 at 0:13AM (UTC)
interbtc-ui-kintsugi ✅ Ready (Inspect) Visit Preview May 25, 2022 at 0:13AM (UTC)
interbtc-ui-testnet ✅ Ready (Inspect) Visit Preview May 25, 2022 at 0:13AM (UTC)

@github-actions
Copy link

Running Lighthouse audit...

@tomjeatt
Copy link
Collaborator Author

I think the workflow issue is because we're also running it using pull_request_target - should be resolved after merge.

Copy link
Contributor

@peterslany peterslany left a comment

Choose a reason for hiding this comment

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

Looks good :) Only issue I can see is that we are right now using two types CurrencySymbol and CurrencyIdLiteral which are same so the code is little inconsistent. Maybe we could unify it in the future and replace the lib types in other parts of the codebase with the new types defined in the UI codebase. Or are we going to use the newly-defined types only for the new component library built with the storybook?

src/config/vaults.ts Show resolved Hide resolved
@tomjeatt tomjeatt merged commit 86df258 into master May 25, 2022
@crypto-engineer crypto-engineer deleted the tom/multi-collateral-vault-config branch May 26, 2022 14:33
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.

None yet

2 participants