From 61abce375f230bf8837a33ded0067015e4c7e143 Mon Sep 17 00:00:00 2001 From: ajayadav09 Date: Wed, 10 Apr 2024 18:18:58 +0530 Subject: [PATCH 1/2] changed url to wpsiteurl in preview --- src/OnboardingSPA/components/MiniPreview/index.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/OnboardingSPA/components/MiniPreview/index.js b/src/OnboardingSPA/components/MiniPreview/index.js index 13ad7920b..209d8a2e0 100644 --- a/src/OnboardingSPA/components/MiniPreview/index.js +++ b/src/OnboardingSPA/components/MiniPreview/index.js @@ -2,6 +2,7 @@ import { memo, useState, useEffect } from '@wordpress/element'; import { useSelect } from '@wordpress/data'; import { store as nfdOnboardingStore } from '../../store'; +import { wpSiteUrl } from '../../../constants'; import getContents from './contents'; @@ -23,7 +24,6 @@ const MiniPreview = ( { const content = getContents( brandUrl ); const titlePreview = title === '' ? content.defaultTitle : title; const descPreview = desc === '' ? content.defaultDesc : desc; - const urlPreview = title === '' ? content.defaultUrl : titleToUrl(); const [ facebook, setFacebook ] = useState( '' ); const [ twitter, setTwitter ] = useState( '' ); @@ -78,13 +78,6 @@ const MiniPreview = ( { { url: tiktok, image: 'var(--tiktok-icon)' }, ]; - function titleToUrl() { - return `https://${ title - ?.toLowerCase() - .replace( /\s/g, '' ) - .replace( /\W/g, '' ) }.com`; - } - function socialIconList() { return socialDataset.map( ( socialInfo, idx ) => { return ( @@ -180,7 +173,7 @@ const MiniPreview = ( { className="browser-row-search__search-box_input" type="text" onChange={ () => {} } - value={ urlPreview } + value={ wpSiteUrl } >
@@ -196,7 +189,7 @@ const MiniPreview = ( { { titlePreview } - { urlPreview } + { wpSiteUrl }
{ descPreview }
From 97c1468329ea081e0d40ba544e3e967852efbc7f Mon Sep 17 00:00:00 2001 From: ajayadav09 Date: Tue, 30 Apr 2024 18:24:55 +0530 Subject: [PATCH 2/2] removed default url --- src/OnboardingSPA/components/MiniPreview/contents.js | 3 +-- src/OnboardingSPA/components/MiniPreview/index.js | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/OnboardingSPA/components/MiniPreview/contents.js b/src/OnboardingSPA/components/MiniPreview/contents.js index 13780129c..91c3a8344 100644 --- a/src/OnboardingSPA/components/MiniPreview/contents.js +++ b/src/OnboardingSPA/components/MiniPreview/contents.js @@ -2,7 +2,7 @@ import { __, sprintf } from '@wordpress/i18n'; import { translations } from '../../utils/locales/translations'; -const getContents = ( brandUrl = '' ) => { +const getContents = () => { return { heading: __( 'Preview', 'wp-module-onboarding' ), defaultTitle: sprintf( @@ -15,7 +15,6 @@ const getContents = ( brandUrl = '' ) => { __( 'Just another WordPress %s', 'wp-module-onboarding' ), translations( 'Site' ) ), - defaultUrl: brandUrl, }; }; diff --git a/src/OnboardingSPA/components/MiniPreview/index.js b/src/OnboardingSPA/components/MiniPreview/index.js index 209d8a2e0..333a65e76 100644 --- a/src/OnboardingSPA/components/MiniPreview/index.js +++ b/src/OnboardingSPA/components/MiniPreview/index.js @@ -13,15 +13,14 @@ const MiniPreview = ( { isSocialFormOpen, setIsSocialFormOpen, } ) => { - const { socialDataStore, brandUrl } = useSelect( ( select ) => { + const { socialDataStore } = useSelect( ( select ) => { return { socialDataStore: select( nfdOnboardingStore ).getOnboardingSocialData(), - brandUrl: select( nfdOnboardingStore ).getNewfoldBrandUrl(), }; }, [] ); - const content = getContents( brandUrl ); + const content = getContents(); const titlePreview = title === '' ? content.defaultTitle : title; const descPreview = desc === '' ? content.defaultDesc : desc;