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

Styling and UX improvements. #43

Merged
merged 8 commits into from
Aug 15, 2023
Merged

Styling and UX improvements. #43

merged 8 commits into from
Aug 15, 2023

Conversation

shannonwells
Copy link
Collaborator

@shannonwells shannonwells commented Aug 11, 2023

Styling and UX improvements

  • Adds the Tailwind CSS framework as a basis for some lightweight styling using Heather's theme
  • Changes where and how some things are displayed
  • Also fixes the provider name display.

References #41

Details

  • Made the connection display into its own Connection component like Provider and Capacity so they could be styled collectively.
  • ProviderActions now hosts the action buttons, so they appear at the bottom. This made more sense from a behavioral point of view, but also, rendering more than one button at a time looked pretty ugly. So the top section is just for status and no actions. Associated unit tests were updated.
  • The action form and the transaction status get a "card" treatment and are flex-displayed.
  • Displaying Capacity with 'CAP' units for lack of a better term. Requesting input. Also yes there is a bug with Capacity units vs. token units which I'd like to address separately. I just wanted it to display with SI prefixes.

I'd like to get this in to main before it goes any further since this was supposed to be "basic" styling and it's kind of a lot.

Screenshot 2023-08-14 at 3 28 27 PM

  * text colors
  * @apply for button types
  * class overrides for KeySelection
  * Actions are now "cards" that use the class overrides
  * remove old styles in components for unified look
* fix bug in AddControlKey
* de-linting
@shannonwells shannonwells changed the title Feat/styling [WIP] Feat/styling Aug 12, 2023
@shannonwells shannonwells marked this pull request as ready for review August 14, 2023 22:18
@shannonwells shannonwells changed the title [WIP] Feat/styling Styling and UX improvements. Aug 14, 2023
<div class="pl-6 ml-6 border-l-8 border-aqua">
<h3 class="text-aqua font-bold">Capacity</h3>
{#if !connected}
<p>Not connected</p>
Copy link
Collaborator Author

@shannonwells shannonwells Aug 14, 2023

Choose a reason for hiding this comment

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

All the "status" items at the top now display more or less the same information until you are connected and we know if you are a Provider or you just have an MSA.

@@ -81,7 +78,7 @@
if (isFunction(thisWeb3FromSource) && isFunction(thisWeb3Enable)) {
const extensions = await thisWeb3Enable('Frequency parachain provider dashboard: Adding Keys');
if (extensions.length !== 0) {
const injectedExtension = await thisWeb3FromSource(signingKeys.meta.source);
const injectedExtension = await thisWeb3FromSource(signingKeys.meta.source.toString());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because typescript

};
</script>

<svelte:head>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/mvp.css" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

💀

<link rel="stylesheet" href="https://unpkg.com/[email protected]/mvp.css" />
</svelte:head>

<h1>Welcome to Provider Dashboard</h1>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

still need a good title though.

it('is hidden', () => {
const { container } = render(Capacity, { token: 'FLARP' });
expect(container.querySelector('div div')).toHaveClass('hidden');
it('is says it is not connected', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it('is says it is not connected', () => {
it('it says it is not connected', () => {

Copy link
Contributor

@mattheworris mattheworris left a comment

Choose a reason for hiding this comment

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

I ran the dev version with tests against a local node.
It's looking really good!
e2e tests are broken and I created a branch to see if I could fix it, but I didn't find a satisfying solution yet.

@mattheworris
Copy link
Contributor

One other thing: on Rococo, my test account has 5,009.7716 XRQCY, but Provider Dashboard shows it as 50.0977. I didn't get a chance to dig in and find where that happens in the code.

src/lib/utils.ts Outdated
};

export const balanceToHuman = (balance: bigint, token: string): string => {
return formatBalance(balance, { withSiFull: true, withUnit: token, withZero: true, decimals: 10 });
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return formatBalance(balance, { withSiFull: true, withUnit: token, withZero: true, decimals: 10 });
return formatBalance(balance, { withSiFull: true, withUnit: token, withZero: true, decimals: 8 });

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@wilwade wilwade left a comment

Choose a reason for hiding this comment

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

One note on the decimals, but that's all from me

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