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

New Component: Details #729

Merged
merged 20 commits into from
Apr 10, 2020
Merged

Conversation

JoseRFelix
Copy link
Contributor

@JoseRFelix JoseRFelix commented Mar 6, 2020

Closes #675 .

Changes

  • Added ToggleComponents component and README

Details

A component to let users reveal content.

Usage

import { Details } from '@aragon/ui'
function App() {
  return (
    <Details label="More details">
      <p>Content to be revealed</p>
    </Details>
  )
}

Props

label

Type Default value
Node None (required)

The heading, which is also the button users click to toggle the opened state.

children

Type Default value
Node None (required)

The content to reveal. Note that it this node is always mounted even when hidden, but this might change in the future.

opened

Type Default value
Boolean None

When set, allows to control the state of Details from the outside (as a controlled component). Leave unset to let Details manage its own opened / closed state.

onToggle

Type Default value
Function None

Gets called when the opened states changes, or is requested to change if opened is set. Takes the new opened state as a single parameter (Boolean).

@welcome
Copy link

welcome bot commented Mar 6, 2020

Thanks for opening this pull request! Someone will review it soon 🔍

@CLAassistant
Copy link

CLAassistant commented Mar 6, 2020

CLA assistant check
All committers have signed the CLA.

@auto-assign auto-assign bot requested a review from bpierre March 6, 2020 23:59
@Evalir Evalir changed the title Feature/toggle component New Component: Toggle Mar 19, 2020
Copy link
Contributor

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

New component 😍let's keep improving this so we can merge it!

src/components/ToggleComponents/README.md Outdated Show resolved Hide resolved
src/components/index.js Outdated Show resolved Hide resolved
src/components/ToggleComponents/ToggleComponents.js Outdated Show resolved Hide resolved
src/components/ToggleComponents/ToggleComponents.js Outdated Show resolved Hide resolved
src/components/ToggleComponents/ToggleComponents.js Outdated Show resolved Hide resolved
src/components/ToggleComponents/README.md Outdated Show resolved Hide resolved
src/components/ToggleComponents/ToggleComponents.js Outdated Show resolved Hide resolved
src/components/ToggleComponents/ToggleComponents.js Outdated Show resolved Hide resolved
devbox/apps/ToggleComponents.js Outdated Show resolved Hide resolved
@Evalir Evalir self-assigned this Apr 3, 2020
- Renamed the component into Details.
- Re-enable the sliding transition.
- Improved pattern to prevent the animation on mount.
- Coding style fixes.
@Evalir Evalir changed the title New Component: Toggle New Component: Details (Toggle) Apr 6, 2020
@bpierre bpierre changed the title New Component: Details (Toggle) New Component: Details Apr 7, 2020
@bpierre bpierre mentioned this pull request Apr 8, 2020
Also add coding style changes.
@bpierre bpierre requested review from Evalir and sohkai and removed request for bpierre April 8, 2020 01:08
src/components/Details/README.md Outdated Show resolved Hide resolved
src/components/Details/Details.js Outdated Show resolved Hide resolved
src/components/Details/Details.js Show resolved Hide resolved
src/components/Details/Details.js Outdated Show resolved Hide resolved
devbox/apps/Details.js Outdated Show resolved Hide resolved
bpierre and others added 3 commits April 9, 2020 17:28
Co-Authored-By: Brett Sun <qisheng.brett.sun@gmail.com>
Co-Authored-By: Brett Sun <qisheng.brett.sun@gmail.com>
@Evalir Evalir assigned bpierre and unassigned Evalir Apr 9, 2020
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!

@bpierre bpierre merged commit 48d585f into aragon:master Apr 10, 2020
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.

Add Toggle component
5 participants