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

Changed style on tool tip to match other tool tips in section setup #54865

Merged
merged 6 commits into from
Nov 15, 2023

Conversation

kobryan0619
Copy link
Contributor

This ensures the tool tips from the Co-teacher section match the styles of the tips in Advanced Settings.

New styles:
image

Matching the Advanced Setting Styles:
image

Links

Ticket

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@kobryan0619 kobryan0619 requested a review from a team November 13, 2023 20:27

export default function InfoHelpTip({id, content}) {
return (
<div>
<span style={{marginLeft: '12px'}}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know this is nit-picky, but from a code style perspective, would we rather have all of this CSS in the styles variable at the end of of file? Since this was only one style change, I felt like it was overkill to add it to the styles variable - it seemed to make it less readable to me, but I'd love to know the hive's thoughts here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think in general we prefer to use .module.scss when there is not already a 'styles' block in the component, or try to convert the component to .module.scss.
However, in this case, since the class already has styles and we are trying to move quickly, I don't think we should convert.

I think both are fine. A couple data points: if we do convert the styles to css, then we may miss the inline style because it isn't in the same block. Additionally, I think giving the span a nice name shows the reader what the span actually does, rather than just the styles we are applying to it. But the inline is shorter and clearer to tell what styles are applied so shrug


export default function InfoHelpTip({id, content}) {
return (
<div>
<span style={{marginLeft: '12px'}}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in general we prefer to use .module.scss when there is not already a 'styles' block in the component, or try to convert the component to .module.scss.
However, in this case, since the class already has styles and we are trying to move quickly, I don't think we should convert.

I think both are fine. A couple data points: if we do convert the styles to css, then we may miss the inline style because it isn't in the same block. Additionally, I think giving the span a nice name shows the reader what the span actually does, rather than just the styles we are applying to it. But the inline is shorter and clearer to tell what styles are applied so shrug

infoToolTipBox: {
maxWidth: '400px',
whiteSpace: 'normal',
fontFamily: '"Metropolis", sans-serif',
Copy link
Contributor

Choose a reason for hiding this comment

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

When do we need to set this explicitly? Is it not set globally to Metropolis after the migration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! I will remove it.

infoToolTipText: {
fontSize: '13px',
color: 'white',
marginBottom: '0em',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
marginBottom: '0em',
marginBottom: '0',

},
infoToolTipText: {
fontSize: '13px',
color: 'white',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think we still want to use @cdo/apps/util/color

return renderExpandableSection(
'uitest-expandable-coteacher',
() => (
<div>
{i18n.coteacherAdd()}
{tooltip}
<InfoHelpTip
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice!

@kobryan0619 kobryan0619 merged commit cac5d1e into staging Nov 15, 2023
2 checks passed
@kobryan0619 kobryan0619 deleted the kaitie/change-styling-on-tool-tips branch November 15, 2023 21:14
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.

None yet

3 participants