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

feat(controls): Add media settings control item components #1341

Merged
merged 2 commits into from
Mar 15, 2021

Conversation

jstoffan
Copy link
Collaborator

Continuing the changes mentioned in #1340. In my opinion, while these components are similar, they are different enough that sharing logic and/or markup between them would be somewhat awkward. I'm open to feedback and suggestions, though.

@jstoffan jstoffan requested a review from a team as a code owner March 12, 2021 23:10
ConradJChan
ConradJChan previously approved these changes Mar 12, 2021
Copy link
Contributor

@ConradJChan ConradJChan left a comment

Choose a reason for hiding this comment

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

LGTM

@jstoffan jstoffan force-pushed the controls-setting-2 branch from 49a249f to 4f6816d Compare March 13, 2021 01:03
}
}

.bp-is-focused &:focus {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is bp-is-focused needed? I don't see where that class is applied to the MediaSettingsMenuItem

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's a holdover from the current experience in production where focus via keyboard has a different visual treatment than focus via mouse. The class is added by the MediaSettingsControls component.

return;
}

setActiveMenu(target);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to worry about stopPropagation for these key events?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, we let them bubble up to be handled by MediaSettingsControls.

<div className="bp-MediaSettingsRadioItem-check">
<IconCheckMark24 className="bp-MediaSettingsRadioItem-check-icon" height={16} width={16} />
</div>
<div className="bp-MediaSettingsRadioItem-value">{label || value}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of having both label and value for this component?

Copy link
Collaborator Author

@jstoffan jstoffan Mar 15, 2021

Choose a reason for hiding this comment

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

It will be relevant for the Autoplay menu, which shows the value true as "Enabled" to the user. The Rate menu shows most values as their own label, such as 1.5.

@jstoffan jstoffan merged commit 81ae0c4 into box:master Mar 15, 2021
@jstoffan jstoffan deleted the controls-setting-2 branch March 15, 2021 19:17
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.

2 participants