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

Tokens: fix the text overflow in the header #1031

Merged
merged 2 commits into from Nov 4, 2019
Merged

Conversation

bpierre
Copy link
Contributor

@bpierre bpierre commented Nov 2, 2019

Not strictly necessary with the normal app title, but it is a structure we can reuse on other apps too.

Before:

After:

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

LGTM! This looks like something we could eventually standardize for cases where Tags adorn inline text.

@bpierre
Copy link
Contributor Author

bpierre commented Nov 4, 2019

This looks like something we could eventually standardize for cases where Tags adorn inline text.

Yes, this is something we often need and I would like to have into aragonUI.

Maybe we could make it generic enough to be an independent component:

<Header
  primary={
    <TextClip
      primary="Tokens"
      secondary={
        <Tag mode="identifier">ANT</Tag>
      }
    />
  }
/>

// We could also have a prop (expand) to specify that
// we want the text to take the full width available.
<Box heading="Balances">
  <ul>
    <li>
      <TextClip
        expand 
        primary="My Token Name"
        secondary="2 ANT"
      />
    </li>
    </ul>
</Box>

primary would contain a string most of the time (an element could still be used as long as its display stays inline), and secondary would generally contain a Tag, but could also contain a Badge, a Button etc.

@bpierre bpierre merged commit 2e30be6 into master Nov 4, 2019
@bpierre bpierre deleted the tokens-title-overflow branch November 4, 2019 15:29
@sohkai
Copy link
Contributor

sohkai commented Nov 4, 2019

I like TextClip, and agree primary should be typed as a string! Let's add it to aragonUI!

Perhaps we can follow our own component submission guidelines and go through that process. Even for something this simple, let's test it out :).

MickdeGraaf pushed a commit to MickdeGraaf/aragon-apps that referenced this pull request Jan 28, 2020
ramilexe pushed a commit to ConsiderItDone/aragon-apps that referenced this pull request Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants