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

Refactor SelectableChip to be a top level Chip component #27401

Closed
Tracked by #24339
MozillaNoah opened this issue Oct 13, 2022 · 1 comment · Fixed by #27602
Closed
Tracked by #24339

Refactor SelectableChip to be a top level Chip component #27401

MozillaNoah opened this issue Oct 13, 2022 · 1 comment · Fixed by #27602
Assignees
Labels
compose Tickets involving Composable changes eng:health Improve code health
Milestone

Comments

@MozillaNoah
Copy link
Contributor

MozillaNoah commented Oct 13, 2022

The SelectableChip Composable is effectively a Chip that just handles re-colors based on the isSelected boolean. The component would be best served as a generic Chip component (similar to TextButton) that has a condensed list of parameters and uplifts any stateful logic (such as selected vs unselected) to the actual UI that uses it.

The contract should be something like:

fun Chip(
    text: String,
    modifier: Modifier = Modifier,
    textColor: Color? = null,
    backgroundColor: Color? = null,
    onClick: (() -> Unit)? = null,
) {

The other Chip component use cases (such as having an optional icon) could be implemented as well.

The text & default colors should be double checked against their specs in FIgma.

┆Issue is synchronized with this Jira Task

@MozillaNoah MozillaNoah added eng:health Improve code health compose Tickets involving Composable changes labels Oct 13, 2022
@MozillaNoah MozillaNoah self-assigned this Oct 13, 2022
@github-actions github-actions bot added the needs:triage Issue needs triage label Oct 13, 2022
@MozillaNoah MozillaNoah removed the needs:triage Issue needs triage label Oct 13, 2022
@gabrielluong
Copy link
Member

Okay yea, the contract totally makes sense to me. Thanks for the thorough issue description.

@MozillaNoah MozillaNoah assigned HarrisonOg and unassigned MozillaNoah Nov 1, 2022
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 17, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 17, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 18, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 18, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 18, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 18, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 18, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 18, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 19, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 19, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 19, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 23, 2023
HarrisonOg added a commit to HarrisonOg/fenix that referenced this issue Jan 24, 2023
@mergify mergify bot closed this as completed in #27602 Jan 24, 2023
@github-actions github-actions bot added this to the 111 milestone Jan 24, 2023
JohanLorenzo pushed a commit to mozilla-releng/staging-firefox-android that referenced this issue Jan 25, 2023
JohanLorenzo pushed a commit to mozilla-releng/staging-firefox-android that referenced this issue Jan 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compose Tickets involving Composable changes eng:health Improve code health
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants