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

[TAS-303] Feat/ux feedback #53

Merged
merged 23 commits into from
Sep 29, 2023
Merged

[TAS-303] Feat/ux feedback #53

merged 23 commits into from
Sep 29, 2023

Conversation

toniocodo
Copy link
Collaborator

No description provided.

- review theme values
- adapt component to use proper theme keys
- update spacings
- update component structure
@toniocodo toniocodo self-assigned this Sep 26, 2023
- add main container margins
- update History page WIP🚧
- limit apy values to after 06/06
- update fontwrights medium
- theme consolidation WIP🚧
- add default address formatting
@toniocodo toniocodo changed the title Feat/ux feedback [TAS-303] Feat/ux feedback Sep 27, 2023
@notion-workspace
Copy link

UX feedback round 1

- remove transition on Popover, Menu and Dialog
- rename text color to tertiary
- use 4 decimals for balances
- fix balances for AccountPopover
- update right padding on History table
- add geo fence modal provider
- add Dialog styles to theme WIP🚧
- move checkbox icons to theme lib
- set default checkbox icons through theme
@toniocodo toniocodo marked this pull request as ready for review September 28, 2023 07:07
- update topnav padding
- fix alignements
- use text-ellipsis wherever possible
- adapt inputMode for touch screens
- update fontSize and lineHeight to numerical values
- update components for mobile devices
- update theme with new typography variants
mt: { xs: 3.25, md: 3 },
mb: 10,
pt: (theme) => ({
xs: '112px',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: seems like this one should be derived on math from the md value.
(i don't really care though)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this padding accounts for the topnav height which has quite strange dimensions when < md: it wraps to 2 rows, the second one having distinct height than the first. I initially just wanted to do theme.mixins.toolbar.height * 2 but designs said otherwise 😅

{intl.formatMessage(d.label)}
</Button>
))}
</Stack>
Copy link
Contributor

Choose a reason for hiding this comment

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

The annoying thing about this versus tailwind is how 1 line of code is spread out into several lines of code.

          <Stack
            direction="row"
            alignItems="center"
            justifyContent="space-between"
          >

versus

<div className="flex items-center justify-between">

Or

            <Stack
              direction="row"
              sx={{
                borderRadius: 1,
                padding: 0.25,
                backgroundColor: 'grey.700',
                gap: 0.5,
              }}
            >

versus

<div className="flex rounded p-1 bg-gray-700 gap-2">

The difference is huge in this example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah tailwind is basically syntactic sugar for css while css-in-js engines are closer to original css. The good part is that you have type checking and autocompletion, I usually only type the first 2-3 letters and leave the rest to IDE. For some very repetitive, I even added some vs code user snippets

"intl-message": {
    "prefix": "int",
    "body": "intl.formatMessage({ defaultMessage: '' })",
    "description": "react-intl default message"
  },
  "center": {
    "prefix": "cen",
    "body": "display=\"flex\" justifyContent=\"center\" alignItems=\"center\"",
    "description": "flex center"
  }

fontFamily="Sailec"
color="primary.contrastText"
>
<Typography fontSize={24} fontWeight={700} fontFamily="Sailec">
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a place for font families in the theme?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the main ones are defined in theme.typography.fontFamily but it is not meant to be used "as-is". I have seen people adding other font families to the theme directly by adding custom props (i.e. theme.typography.monospace), but I think it's preferable to define text variants embedding the right font directly and just use font name for one-off customizations

alignItems="center"
justifyContent="space-between"
px={{ xs: 2, md: 3 }}
py={{ xs: 1.5, md: 2 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I do like this style of defining breakpoints. It is sometimes easier to comprehend than when I read it in tailwind.

reject(prop('isSelected')),
partition<TokenOption>(prop('isSwappable')),
)(tokens);
const toks = sortWith<TokenOption>([
Copy link
Contributor

Choose a reason for hiding this comment

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

sortedTokens ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

alpha(theme.palette.common.white, 0.1),
':hover': {
background: (theme) => theme.palette.grey[600],
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for reference/example/info this would be replaced by the following approximation:
flex items-center justify-center rounded w-12 leading-2 text-secondary py-1 px-2 bg-white/10 hover:bg-gray-600

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, maybe just min-w-9 instead of w-12, leading-none instead of leading-2, py-0.5 and px-1

Copy link
Contributor

@apexearth apexearth left a comment

Choose a reason for hiding this comment

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

The techniques look sound. I added some comments but otherwise looks OK.
I'll probably have to re-review my work after this is merged.

@toniocodo
Copy link
Collaborator Author

yeah, sorry for the huge PR but it embeds all comments made this last couple of days... it won't get that big every time 🤞

@toniocodo toniocodo merged commit 241e6fe into main Sep 29, 2023
2 checks passed
@toniocodo toniocodo deleted the feat/ux-feedback branch September 29, 2023 08:35
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