@@ -71,26 +71,26 @@ const navigate = ( tabId ) => {
71
71
72
72
const quickactions = [
73
73
{
74
- icon : < Icon icon = { bolt } className = "text-info" /> ,
74
+ icon : bolt ,
75
75
title : optimoleDashboardApp . strings . quick_actions . speed_test_title ,
76
76
description : optimoleDashboardApp . strings . quick_actions . speed_test_desc ,
77
77
link : optimoleDashboardApp . strings . quick_actions . speed_test_link ,
78
78
value : 'speedTest'
79
79
} ,
80
80
{
81
- icon : < Icon icon = { update } className = "text-info" /> ,
81
+ icon : update ,
82
82
title : optimoleDashboardApp . strings . quick_actions . clear_cache_images ,
83
83
description : optimoleDashboardApp . strings . quick_actions . clear_cache ,
84
84
value : clearCache
85
85
} ,
86
86
{
87
- icon : < Icon icon = { offloadImage } className = "text-info" /> ,
87
+ icon : offloadImage ,
88
88
title : optimoleDashboardApp . strings . quick_actions . offload_images ,
89
89
description : optimoleDashboardApp . strings . quick_actions . offload_images_desc ,
90
90
value : ( ) => navigate ( settingsTab . offload_image )
91
91
} ,
92
92
{
93
- icon : < Icon icon = { settings } className = "text-info" /> ,
93
+ icon : settings ,
94
94
title : optimoleDashboardApp . strings . quick_actions . advance_settings ,
95
95
description : optimoleDashboardApp . strings . quick_actions . configure_settings ,
96
96
value : ( ) => navigate ( settingsTab . advance )
@@ -162,25 +162,25 @@ const Dashboard = () => {
162
162
} ;
163
163
164
164
return (
165
- < >
165
+ < div className = "grid gap-5" >
166
166
< div className = "bg-white p-8 border-0 rounded-lg shadow-md" >
167
167
{ ( 0 < optimoleDashboardApp . strings . notice_just_activated . length && 'active' === userStatus ) && < ActivatedNotice /> }
168
168
169
169
{ 'inactive' === userStatus && < InactiveWarning /> }
170
170
171
- < div className = 'py -6 gap-6 flex-col sm:flex-row items-start sm:items-center ' >
172
- < div className = 'flex w-full justify-between sm:items-center ' >
173
- < div className = "text-gray-800 text-2xl font-bold " >
171
+ < div className = 'pb -6 gap-6 flex-col sm:flex-row items-start' >
172
+ < div className = 'flex flex-col md:flex-row gap-3 w-full justify-between' >
173
+ < div className = "text-gray-800 text-xl font-semibold " >
174
174
{ optimoleDashboardApp . strings . dashboard_title }
175
175
</ div >
176
176
< div className = "flex items-center gap-2" >
177
- < div className = "text-gray-600 text-base font-normal ml-2 " >
177
+ < div className = "text-gray-600 text-base" >
178
178
{ optimoleDashboardApp . strings . quota }
179
179
< span className = "pl-2 text-gray-800 font-bold" >
180
180
{ userData . visitors_pretty } / { userData . visitors_limit_pretty }
181
181
</ span >
182
182
</ div >
183
- < div className = 'w-20' >
183
+ < div className = 'md: w-20 grow md:grow-0 ' >
184
184
< ProgressBar
185
185
value = { userData . visitors }
186
186
max = { userData . visitors_limit }
@@ -197,35 +197,35 @@ const Dashboard = () => {
197
197
'gap-8 flex-col sm:flex-row items-start sm:items-center'
198
198
) }
199
199
>
200
- < div >
201
- < div className = "text-gray-800 text-xl font-bold " >
200
+ < div className = "grid gap-2" >
201
+ < div className = "text-gray-700 text-lg font-semibold " >
202
202
{ optimoleDashboardApp . strings . banner_title }
203
203
</ div >
204
- < div className = "text-gray-600 text-base " >
204
+ < div className = "text-gray-600 text-sm " >
205
205
{ optimoleDashboardApp . strings . banner_description }
206
206
</ div >
207
207
</ div >
208
208
</ div >
209
209
210
- < div className = "flex py -5 gap-5 flex-col md:flex-row" >
210
+ < div className = "flex pt -5 gap-5 flex-col md:flex-row" >
211
211
{ metrics . map ( metric => {
212
212
return (
213
213
< div
214
214
key = { metric . value }
215
215
className = { classNames (
216
- 'p-3 basis-1/3 flex-col items-start border rounded-md border-solid bg-white border-light- gray border-slate-400 '
216
+ 'p-3 basis-1/3 flex-col items-start border rounded-md border-solid bg-white border-gray-300 '
217
217
) }
218
218
>
219
219
< div className = "flex w-full flex-col" >
220
- < div className = "not-italic font-normal text-sm text-gray-500" >
220
+ < div className = "text-sm text-gray-500" >
221
221
{ metric . label }
222
222
</ div >
223
223
224
224
< div >
225
225
{ formatMetricValue ( metric . value ) }
226
226
</ div >
227
227
228
- < div className = "font-normal text-sm text- gray-600" >
228
+ < div className = "font-normal text-gray-600" >
229
229
{ metric . description }
230
230
</ div >
231
231
</ div >
@@ -234,39 +234,42 @@ const Dashboard = () => {
234
234
} ) }
235
235
</ div >
236
236
</ div >
237
- < div className = "my-3 bg-white p-8 border-0 rounded-lg shadow-md" >
238
- < div className = "text-gray-800 font-bold text-2xl" > { optimoleDashboardApp . strings . quick_action_title } </ div >
239
- < div className = "grid grid-cols-1 md:grid-cols-2 gap-5 py-5" >
240
- { quickactions . map ( ( action , index ) => (
241
- < div
242
- key = { index }
243
- className = "flex items-start items-center gap-3 p-4 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors"
244
- >
245
- { action . icon }
246
- < div className = "flex flex-col" >
247
- < span className = "font-medium text-base text-gray-800" > { action . title } </ span >
248
- { 'speedTest' === action . value ? (
249
- < a href = { action . link } target = "_blank" className = "text-info text-sm font-medium hover:text-info" > { action . description } </ a >
250
- ) : (
251
- < Button
252
- variant = "default"
253
- className = "text-info text-sm font-medium p-0 h-5 focus:!shadow-none focus:!outline-none"
254
- onClick = { ( ) => action . value ( ) }
255
- >
256
- { action . description }
257
- </ Button >
258
- ) }
259
- </ div >
260
- </ div >
261
- ) ) }
237
+ < div className = "bg-white p-8 border-0 rounded-lg shadow-md" >
238
+ < div className = "text-gray-800 text-xl font-semibold mb-5" > { optimoleDashboardApp . strings . quick_action_title } </ div >
239
+ < div className = "grid md:grid-cols-2 gap-5" >
240
+ { quickactions . map ( ( action , index ) => {
241
+
242
+ const TAG = 'speedTest' === action . value ? 'a' : 'button' ;
243
+ const additionalProps = 'speedTest' === action . value ? {
244
+ href : action . link ,
245
+ target : '_blank'
246
+ } : {
247
+ onClick : ( ) => {
248
+ action . value ( ) ;
249
+ }
250
+ } ;
251
+ return (
252
+ < TAG
253
+ key = { index }
254
+ className = "flex items-center gap-3 p-4 bg-gray-50 rounded-lg hover:bg-light-blue hover:bg-info hover:border-info transition-background duration-300 group shadow-none border-gray-200 border border-solid cursor-pointer"
255
+ { ...additionalProps }
256
+ >
257
+ < Icon icon = { action . icon } className = "text-info" />
258
+ < div className = "flex flex-col items-start gap-1" >
259
+ < span className = "font-medium text-base text-gray-800" > { action . title } </ span >
260
+ < span className = "text-info text-sm font-medium hover:text-info" > { action . description } </ span >
261
+ </ div >
262
+ </ TAG >
263
+ ) ;
264
+ } ) }
262
265
</ div >
263
266
</ div >
264
- < div className = "bg-white p-8 border-0 rounded-lg shadow-md" >
267
+ < div className = "bg-white p-8 border-0 rounded-lg shadow-md hidden lg:block " >
265
268
{ 'yes' !== optimoleDashboardApp . remove_latest_images && (
266
269
< LastImages />
267
270
) }
268
271
</ div >
269
- </ >
272
+ </ div >
270
273
) ;
271
274
} ;
272
275
0 commit comments