Skip to content

Commit 2c2f829

Browse files
Add optimizaiton tips in sidebar
1 parent 6adcb14 commit 2c2f829

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

assets/src/dashboard/parts/connected/Sidebar.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
import {
55
Button,
6+
ExternalLink,
67
Icon,
78
TextControl
89
} from '@wordpress/components';
@@ -18,6 +19,21 @@ const reasons = [
1819
optimoleDashboardApp.strings.upgrade.reason_4
1920
];
2021

22+
const statuses = [
23+
{
24+
label: optimoleDashboardApp.strings.optimization_status.statusTitle1,
25+
description: optimoleDashboardApp.strings.optimization_status.statusSubTitle1
26+
},
27+
{
28+
label: optimoleDashboardApp.strings.optimization_status.statusTitle2,
29+
description: optimoleDashboardApp.strings.optimization_status.statusSubTitle2
30+
},
31+
{
32+
label: optimoleDashboardApp.strings.optimization_status.statusTitle3,
33+
description: optimoleDashboardApp.strings.optimization_status.statusSubTitle3
34+
}
35+
];
36+
2137
const Sidebar = () => {
2238
const {
2339
name,
@@ -121,6 +137,29 @@ const Sidebar = () => {
121137
{ optimoleDashboardApp.strings.premium_support }
122138
</Button>
123139
) }
140+
141+
<div className="bg-white flex flex-col text-gray-700 border-0 rounded-lg shadow-md p-8">
142+
<h3 className="text-base m-0">{ optimoleDashboardApp.strings.optimization_status.title }</h3>
143+
<ul>
144+
{ statuses.map( ( status, index ) => (
145+
<li
146+
key={ index }
147+
className="flex items-start gap-2"
148+
>
149+
<Icon icon="yes-alt" className="text-light-black mt-1" />
150+
<div className="text-light-black font-normal text-base">
151+
<div className='font-semibold'>
152+
{ status.label }
153+
</div>
154+
<div>
155+
{ status.description }
156+
</div>
157+
</div>
158+
</li>
159+
) ) }
160+
</ul>
161+
<ExternalLink className='font-semibold text-sm' href='https://docs.optimole.com/article/2238-optimization-tips'>{ optimoleDashboardApp.strings.optimization_tips }</ExternalLink>
162+
</div>
124163
</div>
125164
);
126165
};

inc/admin.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,16 @@ private function get_dashboard_strings() {
19851985
],
19861986
'cron_error' => sprintf( /* translators: 1 is code to disable cron, 2 value of the constant */ __( 'It seems that you have the %1$s constant defined as %2$s. The offloading process uses cron events to offload the images in the background. Please remove the constant from your wp-config.php file in order for the offloading process to work.', 'optimole-wp' ), '<code>DISABLE_WP_CRON</code>', '<code>true</code>' ),
19871987
'cancel' => __( 'Cancel', 'optimole-wp' ),
1988+
'optimization_status' => [
1989+
'title' => __( 'Optimization Status', 'optimole-wp' ),
1990+
'statusTitle1' => __( 'Image Handling Active', 'optimole-wp' ),
1991+
'statusSubTitle1' => __( 'All images are optimized automatically', 'optimole-wp' ),
1992+
'statusTitle2' => __( 'Smart Lazy-Loading Enabled', 'optimole-wp' ),
1993+
'statusSubTitle2' => __( 'Images load as visitors scroll', 'optimole-wp' ),
1994+
'statusTitle3' => __( 'Image Scalling Active', 'optimole-wp' ),
1995+
'statusSubTitle3' => __( 'All images are perfectly sized for devices', 'optimole-wp' ),
1996+
],
1997+
'optimization_tips' => __( 'View all optimization tips', 'optimole-wp' ),
19881998
];
19891999
}
19902000

0 commit comments

Comments
 (0)