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 13ad7920b..333a65e76 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'; @@ -12,18 +13,16 @@ 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; - const urlPreview = title === '' ? content.defaultUrl : titleToUrl(); const [ facebook, setFacebook ] = useState( '' ); const [ twitter, setTwitter ] = useState( '' ); @@ -78,13 +77,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 +172,7 @@ const MiniPreview = ( { className="browser-row-search__search-box_input" type="text" onChange={ () => {} } - value={ urlPreview } + value={ wpSiteUrl } >