Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

chore: add toggle content prop on Dropdown #2142

Merged
merged 2 commits into from
Jun 16, 2020

Conversation

goga-m
Copy link
Contributor

@goga-m goga-m commented Jun 15, 2020

Summary

Adds the feature to accept toggleContent to render custom elements.
Accepts function as a prop and provides isOpen state to render dynamically.

Example:

As element:

<Dropdown
	options={options}
	toggleContent={<div>sample toggle content</div>}>
</Dropdown>

As a function:

<Dropdown
	options={options}
	toggleContent={(isOpen) => (<div>sample toggle content</div>)}>
</Dropdown>

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@goga-m goga-m requested a review from faustbrian as a code owner June 15, 2020 16:57
@ghost ghost added Complexity: Medium Less than 256 lines changed. Type: Task The issue is a request to setup third-party integrations or any general non-code related tasks. labels Jun 15, 2020
@goga-m goga-m changed the title chore: add custom toggle content prop on Dropdown chore: add toggle content prop on Dropdown Jun 15, 2020
@codecov
Copy link

codecov bot commented Jun 15, 2020

Codecov Report

Merging #2142 into 3.0-react will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           3.0-react     #2142    +/-   ##
============================================
  Coverage     100.00%   100.00%            
============================================
  Files             45        96    +51     
  Lines            298       734   +436     
  Branches          49       112    +63     
============================================
+ Hits             298       734   +436     
Flag Coverage Δ
#unit 100.00% <100.00%> (?)
Impacted Files Coverage Δ
src/app/components/Button/Button.tsx 100.00% <ø> (ø)
src/app/components/Card/Card.tsx 100.00% <ø> (ø)
src/app/components/Card/CardControl.tsx 100.00% <ø> (ø)
src/app/components/Circle/Circle.tsx 100.00% <ø> (ø)
src/app/components/Divider/Divider.styles.ts 100.00% <ø> (ø)
src/app/components/Divider/Divider.tsx 100.00% <ø> (ø)
src/app/components/Form/FormLabel.tsx 100.00% <ø> (ø)
src/app/components/Select/Select.tsx 100.00% <ø> (ø)
...app/components/SideBar/SideBarItem/SideBarItem.tsx 100.00% <ø> (ø)
src/app/components/StepIndicator/StepIndicator.tsx 100.00% <ø> (ø)
... and 101 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c82a42...48ed363. Read the comment docs.

@goga-m goga-m mentioned this pull request Jun 15, 2020
3 tasks
@faustbrian faustbrian merged commit fb67583 into 3.0-react Jun 16, 2020
@ghost ghost deleted the feat/dropdown-custom-toggle-content branch June 16, 2020 01:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Complexity: Medium Less than 256 lines changed. Type: Task The issue is a request to setup third-party integrations or any general non-code related tasks.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants