Skip to content

Commit

Permalink
Show the correct messaging on recommendations heading and correct fon…
Browse files Browse the repository at this point in the history
…tsize
  • Loading branch information
vykes-mac committed Sep 28, 2024
1 parent 322c4c3 commit 019f88d
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 6 deletions.
14 changes: 14 additions & 0 deletions client/hosting/performance/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ $section-max-width: 1224px;
gap: 0;
}

.performance-profiler-insights-section {
.subtitle {
font-size: $font-body-small;
}

.insight-header-container {
font-size: $font-body-small;
}

.description-area {
font-size: $font-body-small;
}
}

.performance-profiler-content .container {
padding-top: 0;
gap: 16px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const PerformanceProfilerDashboardContent = ( {
ref={ insightsRef }
hash={ hash }
filter={ filter }
isLoggedInVersion={ showV2 }
onRecommendationsFilterChange={ onRecommendationsFilterChange }
/>
) }
Expand Down
13 changes: 10 additions & 3 deletions client/performance-profiler/components/insights-section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type InsightsSectionProps = {
isWpcom: boolean;
hash: string;
filter?: string;
isLoggedInVersion?: boolean;
onRecommendationsFilterChange?: ( filter: string ) => void;
};

Expand Down Expand Up @@ -50,12 +51,18 @@ export const InsightsSection = forwardRef(
setSelectedFilter( filter );
}
}, [ selectedFilter, filter ] );

const siteOrPageSubtitle = props.isLoggedInVersion
? translate( 'your page' )
: translate( 'your site' );
return (
<div className="performance-profiler-insights-section" ref={ ref }>
<div className="header">
<div>
<h2 className="title">{ translate( 'Improve your site‘s performance' ) }</h2>
<h2 className="title">
{ props.isLoggedInVersion
? translate( 'Recommendations' )
: translate( 'Improve your site‘s performance' ) }
</h2>
<p className="subtitle">
{ filteredAudits.length
? translate(
Expand All @@ -66,7 +73,7 @@ export const InsightsSection = forwardRef(
quantity: filteredAudits.length,
metric:
selectedFilter === 'all'
? translate( 'your site' )
? siteOrPageSubtitle
: metricsNames[ selectedFilter as keyof typeof metricsNames ]?.name,
},
count: filteredAudits.length,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
color: var(--studio-gray-70);
font-size: $font-body;
margin-bottom: 0;
@media (max-width: $break-xlarge) {
max-width: 360px;
}
}

.metrics-insight-item.foldable-card {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ const Header = styled.div`
.impact {
padding: 4px 10px;
border-radius: 14px;
border-radius: 4px;
border: 1px solid transparent;
float: right;
font-size: 14px;
font-size: 12px;
color: var( --studio-black );
&.fail {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const InsightContent: React.FC< InsightContentProps > = ( props ) => {
setFeedbackSent( true );
};

const isPerformancePage = window.location.pathname.includes( '/sites/performance/' );

const renderFeedbackForm = () => {
if ( feedbackSent ) {
return <div className="survey">{ translate( 'Thanks for the feedback!' ) }</div>;
Expand Down Expand Up @@ -94,7 +96,14 @@ export const InsightContent: React.FC< InsightContentProps > = ( props ) => {
return (
<div className="metrics-insight-content">
{ isLoading ? (
<LLMMessage message={ translate( 'Finding the best solution for your site…' ) } rotate />
<LLMMessage
message={
isPerformancePage
? translate( 'Finding the best solution for your page…' )
: translate( 'Finding the best solution for your site…' )
}
rotate
/>
) : (
<>
<div className="description-area">
Expand Down

0 comments on commit 019f88d

Please sign in to comment.