-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
We’ll take it from here!
step when user tries to migrate a wpco…
…m site (#95294) * Add support migration instructions step * Connect steps with migration flows * Fix mobile issues
- Loading branch information
1 parent
4fca5b7
commit 5a45738
Showing
7 changed files
with
143 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...declarative-flow/internals/steps-repository/site-migration-support-instructions/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { recordTracksEvent } from '@automattic/calypso-analytics'; | ||
import { StepContainer } from '@automattic/onboarding'; | ||
import { translate, useTranslate } from 'i18n-calypso'; | ||
import { useSearchParams } from 'react-router-dom'; | ||
import FormattedHeader from 'calypso/components/formatted-header'; | ||
import { useSiteSlugParam } from 'calypso/landing/stepper/hooks/use-site-slug-param'; | ||
import { UserData } from 'calypso/lib/user/user'; | ||
import { useSelector } from 'calypso/state'; | ||
import { getCurrentUser } from 'calypso/state/current-user/selectors'; | ||
import FlowCard from '../components/flow-card'; | ||
import { redirect } from '../import/util'; | ||
import type { Step } from '../../types'; | ||
|
||
import './style.scss'; | ||
|
||
const StepContent = () => { | ||
const siteSlug = useSiteSlugParam(); | ||
|
||
return ( | ||
<div className="migration-support-instructions__list"> | ||
<FlowCard | ||
className="migration-support-instructions__card" | ||
title={ translate( 'Explore features' ) } | ||
text={ translate( 'Discover the features available on WordPress.com.' ) } | ||
onClick={ () => redirect( `/home/${ siteSlug }` ) } | ||
/> | ||
|
||
<FlowCard | ||
className="migration-support-instructions__card" | ||
title={ translate( 'Learn about WordPress.com' ) } | ||
text={ translate( | ||
'Access guides and tutorials to better understand how to use WordPress.com.' | ||
) } | ||
onClick={ () => redirect( '/support' ) } | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export const SiteMigrationSupportInstructions: Step = ( { stepName } ) => { | ||
const translate = useTranslate(); | ||
const user = useSelector( getCurrentUser ) as UserData; | ||
const [ query ] = useSearchParams(); | ||
const variation = query.get( 'variation' ) || 'default'; | ||
|
||
const contentVariation = { | ||
default: translate( | ||
'We apologize for the problems you’re running into. Our Happiness Engineers will reach out to you shortly at {{strong}}%(email)s{{/strong}} to help you figure out your next steps together.', | ||
{ | ||
args: { | ||
email: user.email!, | ||
}, | ||
components: { | ||
strong: <strong />, | ||
}, | ||
} | ||
), | ||
goals_shared: translate( | ||
'Thanks for sharing your goals. Our Happiness Engineers will reach out to you shortly at {{strong}}%(email)s{{/strong}} to help you figure out your next steps together.', | ||
{ | ||
args: { | ||
email: user.email!, | ||
}, | ||
components: { | ||
strong: <strong />, | ||
}, | ||
} | ||
), | ||
}; | ||
|
||
const content = | ||
contentVariation[ variation as keyof typeof contentVariation ] ?? contentVariation.default; | ||
|
||
return ( | ||
<StepContainer | ||
stepName={ stepName } | ||
hideBack | ||
formattedHeader={ | ||
<FormattedHeader | ||
headerText={ translate( 'We’ll take it from here!' ) } | ||
subHeaderText={ content } | ||
subHeaderAlign="center" | ||
/> | ||
} | ||
isHorizontalLayout={ false } | ||
stepContent={ <StepContent /> } | ||
recordTracksEvent={ recordTracksEvent } | ||
/> | ||
); | ||
}; | ||
|
||
export default SiteMigrationSupportInstructions; |
18 changes: 18 additions & 0 deletions
18
...eclarative-flow/internals/steps-repository/site-migration-support-instructions/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.migration-support-instructions { | ||
padding: 0 24px; | ||
|
||
.migration-support-instructions__list { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
width: 100%; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.migration-support-instructions__card { | ||
max-width: 520px; | ||
width: 100%; | ||
margin: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters