Skip to content

Commit

Permalink
Update onboarding popover placement (#40550)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkmyta authored Dec 15, 2024
1 parent 62838d3 commit a877b8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions projects/plugins/protect/src/js/routes/scan/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ const ScanPage = () => {
<OnboardingPopover
id={ hasPlan ? 'paid-scan-results' : 'free-scan-results' }
anchor={ scanResultsAnchor }
position={ 'top left' }
position={ 'top' }
/>
) }
{ !! status && ! isScanInProgress( status ) && hasPlan && (
<OnboardingPopover
id={ 'paid-understand-severity' }
anchor={ scanResultsAnchor }
position={ 'top right' }
position={ 'top' }
/>
) }
</Col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const ScanAdminSectionHero: React.FC = () => {
return (
<AdminSectionHero>
<AdminSectionHero.Main>
<Text mb={ 2 } ref={ setDailyScansPopoverAnchor }>
<Text className={ styles[ 'last-checked' ] } mb={ 2 } ref={ setDailyScansPopoverAnchor }>
{ lastCheckedLocalTimestamp
? sprintf(
// translators: %s: date and time of the last scan
Expand All @@ -118,7 +118,7 @@ const ScanAdminSectionHero: React.FC = () => {
</Text>
<OnboardingPopover
id={ hasPlan ? 'paid-daily-and-manual-scans' : 'free-daily-scans' }
position={ isSm ? 'bottom' : 'middle right' }
position={ isSm ? 'bottom right' : 'middle right' }
anchor={ dailyScansPopoverAnchor }
/>
<AdminSectionHero.Heading icon={ numThreats > 0 ? 'error' : 'success' }>
Expand Down Expand Up @@ -157,11 +157,8 @@ const ScanAdminSectionHero: React.FC = () => {
) }
{ fixableList.length > 0 && (
<>
<div ref={ setShowAutoFixersPopoverAnchor }>
<Button
className={ styles[ 'auto-fixers' ] }
onClick={ handleShowAutoFixersClick( fixableList ) }
>
<div className={ styles[ 'auto-fixers' ] } ref={ setShowAutoFixersPopoverAnchor }>
<Button onClick={ handleShowAutoFixersClick( fixableList ) }>
{ sprintf(
/* translators: Translates to Show auto fixers $s: Number of fixable threats. */
__( 'Show auto fixers (%s)', 'jetpack-protect' ),
Expand All @@ -171,7 +168,7 @@ const ScanAdminSectionHero: React.FC = () => {
</div>
<OnboardingPopover
id="paid-fix-all-threats"
position={ isSm ? 'bottom right' : 'middle left' }
position={ isSm ? 'bottom right' : 'middle right' }
anchor={ showAutoFixersPopoverAnchor }
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.auto-fixers {
margin-top: calc( var( --spacing-base ) * 4 ); // 32px
width: fit-content;
}

.scan-results-container {
Expand All @@ -22,3 +23,7 @@
display: none;
}
}

.last-checked {
width: fit-content;
}

0 comments on commit a877b8c

Please sign in to comment.