@@ -13,6 +13,8 @@ import { addQueryArgs } from '@wordpress/url';
13
13
14
14
import SPCRecommendation from './SPCRecommendation' ;
15
15
import OptimizationStatus from './OptimizationStatus' ;
16
+ import { globe , user } from '../../utils/icons' ;
17
+ import Tooltip from '../components/Tooltip' ;
16
18
17
19
const reasons = [
18
20
optimoleDashboardApp . strings . upgrade . reason_1 ,
@@ -47,31 +49,23 @@ const Sidebar = ({ settings }) => {
47
49
48
50
return (
49
51
< div className = "grid md:grid-cols-2 xl:flex xl:flex-col xl:mt-8 xl:mb-5 p-0 transition-all ease-in-out duration-700 gap-5 shrink-0 xl:w-[350px]" >
50
- < div className = "bg-white gap-5 flex flex-col text-gray-700 border-0 rounded-lg shadow-md p-8" >
51
- < TextControl
52
- label = { optimoleDashboardApp . strings . logged_in_as }
53
- value = { name }
54
- className = "optml__placeholder"
55
- disabled
56
- />
57
-
58
- < TextControl
59
- label = { optimoleDashboardApp . strings . private_cdn_url }
60
- value = { domain }
61
- className = "optml__placeholder"
62
- disabled
63
- />
52
+ < div className = "bg-white gap-3 flex flex-col text-gray-700 border-0 rounded-lg shadow-md p-8" >
64
53
65
- < hr className = "m-0 border-grayish-blue" />
54
+ < div className = "grid gap-4" >
55
+ < PlaceholderInput icon = { user } value = { name } tooltipText = { optimoleDashboardApp . strings . logged_in_as } />
56
+ < PlaceholderInput icon = { globe } value = { domain } tooltipText = { optimoleDashboardApp . strings . private_cdn_url } />
57
+ </ div >
66
58
67
- < p className = "font-semibold text-xs text-light-black m-0" > { optimoleDashboardApp . strings . looking_for_api_key } </ p >
59
+ < hr className = "m-0 border-t-grayish-blue" / >
68
60
69
- < p
70
- className = "m-0 -mt-3"
71
- dangerouslySetInnerHTML = { {
72
- __html : optimoleDashboardApp . strings . optml_dashboard
73
- } }
74
- />
61
+ < div className = "border-t border-gray-300 block grid gap-2" >
62
+ < p className = "font-semibold text-xs text-light-black m-0" > { optimoleDashboardApp . strings . looking_for_api_key } </ p >
63
+ < span
64
+ dangerouslySetInnerHTML = { {
65
+ __html : optimoleDashboardApp . strings . optml_dashboard
66
+ } }
67
+ />
68
+ </ div >
75
69
</ div >
76
70
77
71
{ 'free' === plan ? (
@@ -137,3 +131,22 @@ const Sidebar = ({ settings }) => {
137
131
} ;
138
132
139
133
export default Sidebar ;
134
+
135
+
136
+ const PlaceholderInput = ( { icon = null , value, tooltipText = '' } ) => {
137
+ return (
138
+ < Tooltip text = { tooltipText } >
139
+ < div className = "grid grid-cols-1 text-gray-700 hover:text-info transition-all ease-in-out duration-300" >
140
+ < input
141
+ value = { value }
142
+ type = "text"
143
+ disabled
144
+ className = "col-start-1 row-start-1 block w-full rounded-md !bg-light-blue py-1.5 !pl-9 pr-3 !text-gray-500 !m-0 text-sm !py-0.5 !border-0"
145
+ />
146
+ < span className = "pointer-events-none col-start-1 row-start-1 flex items-center ml-3 w-4 h-4 self-center" >
147
+ { icon }
148
+ </ span >
149
+ </ div >
150
+ </ Tooltip >
151
+ ) ;
152
+ } ;
0 commit comments