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

fix(FEC-11707): V3 - cast on multiple players - when casting started by some player, "Cast" buttons become enabled on all players #642

Merged
merged 3 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/components/cast/_cast.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
background-color: rgba(255, 255, 255, 0);
border: none;
cursor: pointer;
--connected-color: rgba(1, 172, 205, 0.8);
--connected-color: #{$grayscale4};
--disconnected-color: #{$grayscale4};
}

.cast-button:hover {
--disconnected-color: #{$white};
--connected-color: #{$brand-color};
&:hover {
--connected-color: #{$white};
--disconnected-color: #{$white};
}

&.cast-button-active {
--connected-color: rgba(1, 172, 205, 0.8);

&:hover {
--connected-color: #{$brand-color};
}
}
}
}
3 changes: 2 additions & 1 deletion src/components/cast/cast.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class Cast extends Component {
*/
render(props: any): ?React$Element<any> {
if (props.isCasting || props.isCastAvailable) {
const className = props.isCasting ? `${style.castButton} ${style.castButtonActive}` : style.castButton;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const className = props.isCasting ? `${style.castButton} ${style.castButtonActive}` : style.castButton;
const className = props.isCasting ? [style.castButton, style.castButtonActive].join(' ') : style.castButton;

we used to write it like this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think template string is more readable than using join()

Copy link
Contributor

Choose a reason for hiding this comment

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

better to be aligned but not critical

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I care more about readability :)

return (
<div
role="button"
Expand All @@ -81,7 +82,7 @@ class Cast extends Component {
onClick={this.onClick}
onKeyDown={this.onKeyDown}>
<Tooltip label={this.props.castText}>
<google-cast-launcher className={style.castButton} tabIndex="0" />
<google-cast-launcher className={className} tabIndex="0" />
</Tooltip>
</div>
);
Expand Down