Skip to content

Commit be4b22f

Browse files
authored
Merge pull request #965 from Codeinwp/refactor/welcome-screen
refactor: welcome screen
2 parents 8bfc444 + 1ad40a7 commit be4b22f

File tree

2 files changed

+44
-22
lines changed

2 files changed

+44
-22
lines changed

assets/src/dashboard/parts/connect/index.js

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const ConnectLayout = () => {
3939
const [ email, setEmail ] = useState( optimoleDashboardApp.current_user.email );
4040
const [ method, setMethod ] = useState( 'email' );
4141
const [ errors, setErrors ] = useState({});
42+
const [ showBenefits, setShowBenefits ] = useState( false );
4243

4344
const { setAutoConnect } = useDispatch( 'optimole' );
4445

@@ -184,29 +185,44 @@ const ConnectLayout = () => {
184185
/>
185186

186187

187-
<div className="flex py-3 items-center">
188-
<Icon icon="yes-alt" />
189-
<p
190-
className="text-base ml-3 m-0"
191-
dangerouslySetInnerHTML={ { __html: optimoleDashboardApp.strings.account_needed_subtitle_1 } }
192-
/>
193-
</div>
194-
195-
<div className="flex py-3 items-center">
196-
<Icon icon="yes-alt" />
197-
<p
198-
className="text-base ml-3 m-0"
199-
dangerouslySetInnerHTML={ { __html: optimoleDashboardApp.strings.account_needed_subtitle_2 } }
200-
/>
201-
</div>
202-
203-
<div className="flex py-3 items-center">
204-
<Icon icon="yes-alt" />
205-
<p
206-
className="text-base ml-3 m-0"
207-
dangerouslySetInnerHTML={ { __html: optimoleDashboardApp.strings.account_needed_subtitle_4 } }
188+
<button
189+
onClick={ () => setShowBenefits( ! showBenefits ) }
190+
className="inline-flex items-center bg-light-blue px-4 py-1.5 rounded-full mb-4 text-sm text-gray-500 cursor-pointer transition-all hover:bg-blue-100 border-none"
191+
role="button"
192+
>
193+
<span>{ optimoleDashboardApp.strings.account_needed_benefits_toggle }</span>
194+
<span
195+
className={ `dashicons dashicons-arrow-${ showBenefits ? 'up' : 'down' } ml-1` }
208196
/>
209-
</div>
197+
</button>
198+
199+
{ showBenefits && (
200+
<div className="mb-4">
201+
<div className="flex py-3 items-center">
202+
<Icon icon="yes-alt" />
203+
<p
204+
className="text-base ml-3 m-0"
205+
dangerouslySetInnerHTML={ { __html: optimoleDashboardApp.strings.account_needed_subtitle_1 } }
206+
/>
207+
</div>
208+
209+
<div className="flex py-3 items-center">
210+
<Icon icon="yes-alt" />
211+
<p
212+
className="text-base ml-3 m-0"
213+
dangerouslySetInnerHTML={ { __html: optimoleDashboardApp.strings.account_needed_subtitle_2 } }
214+
/>
215+
</div>
216+
217+
<div className="flex py-3 items-center">
218+
<Icon icon="yes-alt" />
219+
<p
220+
className="text-base ml-3 m-0"
221+
dangerouslySetInnerHTML={ { __html: optimoleDashboardApp.strings.account_needed_subtitle_4 } }
222+
/>
223+
</div>
224+
</div>
225+
) }
210226
</div>
211227

212228
<div className="optml-connect__form basis-4/12 p-8 bg-light-blue border border-blue-300 rounded-md">
@@ -254,6 +270,11 @@ const ConnectLayout = () => {
254270
<Button
255271
variant="secondary"
256272
className="optml__button flex w-full justify-center rounded font-bold mt-4 min-h-40 mb-4"
273+
style={{
274+
backgroundColor: '#EAE7F1',
275+
borderColor: '#9CA3AF',
276+
color: '#000000'
277+
}}
257278
onClick={ () => setMethod( 'key' ) }
258279
>
259280
{ optimoleDashboardApp.strings.api_exists }

inc/admin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,7 @@ private function get_dashboard_strings() {
15571557
'account_needed_sub_heading' => __( 'Stop sacrificing image quality for page speed. Optimole delivers both.', 'optimole-wp' ),
15581558
'account_needed_trust_badge' => __( 'TRUSTED BY 200,000+ HAPPY USERS', 'optimole-wp' ),
15591559
'account_needed_setup_time' => __( 'Setup is instant - just click connect', 'optimole-wp' ),
1560+
'account_needed_benefits_toggle' => __( 'See what you\'ll get', 'optimole-wp' ),
15601561
'invalid_key' => __( 'Invalid API Key', 'optimole-wp' ),
15611562
'keep_connected' => __( 'Ok, keep me connected', 'optimole-wp' ),
15621563
'cloud_library' => __( 'Cloud Library', 'optimole-wp' ),

0 commit comments

Comments
 (0)