ensdomains / thorin

A web3 native design system.
https://thorin.pages.dev
MIT License
83 stars 21 forks source link

[question] Is there a way to keep the selected label as the Dropdown's label (until another one is clicked)? #78

Open danielbelfort opened 2 years ago

danielbelfort commented 2 years ago

Is there an existing issue for this?

Package Version

1.0.0

Current Behavior

Dropdown always keeps its "label" prop displayed, despite what is pressed on within the Dropdown.

Expected Behavior

Can the Dropdown display the selected "items -> label" instead?

Steps To Reproduce

No response

Anything else?

This is my custom Dropdown, for reference:

<Dropdown
      style = {{ boxShadow: "0 2px 8px rgb(0 0 0 / 30%)", borderRadius: "10px" }}
      inner
      shortThrow
      chevron = {false}
      label= <img src="./logo.png" />
      items= {[   
        { label: <Link href="./">⚡</Link>, color: 'text' },
        { label: <Link href="./active">Active</Link>, color: 'text' },
        { label: <Link href="./my-history">My History</Link>, color: 'text' },
        { label: <Link href="./feed">Feed</Link>, color: 'green' },
        { label: <Link href="https://danielbelfort.notion.site/Just-Commit-9213dcd452184278a4f628b0e3f48e78"
                       target="_blank" rel="noopener noreferrer">
                       About</Link>, color: 'textSecondary' },        
      ]}
/>
danielbelfort commented 2 years ago

also, adding "target="_blank" rel="noopener noreferrer" in the last label does not open the link in another tab.

is there a way to fix this? thanks!

danielbelfort commented 2 years ago

for more: justcommit.app