-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from newfold-labs/PRESS-2-1194-Add-coming-soo…
…n-to-Site-Features Add Coming Soon to Site Features
- Loading branch information
Showing
16 changed files
with
213 additions
and
24 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
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
28 changes: 15 additions & 13 deletions
28
src/OnboardingSPA/components/CheckboxTemplate/CheckboxList/stylesheet.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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
.checkbox-list { | ||
display: flex; | ||
justify-content: center; | ||
align-items: flex-start; | ||
display: flex; | ||
justify-content: center; | ||
align-items: flex-start; | ||
|
||
@media (max-width: #{ ($break-xlarge) }) { | ||
flex-direction: column; | ||
} | ||
@media (max-width: #{ ($break-medium) }) { | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
&-col { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
justify-content: center; | ||
} | ||
} | ||
&-col { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
justify-content: center; | ||
} | ||
} |
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,27 @@ | ||
import { __, sprintf } from '@wordpress/i18n'; | ||
|
||
import { translations } from '../../utils/locales/translations'; | ||
|
||
const getContents = () => { | ||
return { | ||
title: __( 'Coming Soon', 'wp-module-onboarding' ), | ||
subtitle: sprintf( | ||
/* translators: %s: site or store */ | ||
__( | ||
'Keep your %s private until you click launch', | ||
'wp-module-onboarding' | ||
), | ||
translations( 'site' ) | ||
), | ||
desc: sprintf( | ||
/* translators: %s: site or store */ | ||
__( | ||
"We'll show a placeholder page to logged-out visitors while you build your %s.", | ||
'wp-module-onboarding' | ||
), | ||
translations( 'site' ) | ||
), | ||
}; | ||
}; | ||
|
||
export default getContents; |
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,40 @@ | ||
import { useSelect, useDispatch } from '@wordpress/data'; | ||
|
||
import getContents from './contents'; | ||
import { CheckboxItem } from '../CheckboxTemplate'; | ||
import { store as nfdOnboardingStore } from '../../store'; | ||
|
||
const ComingSoon = () => { | ||
const content = getContents(); | ||
|
||
const { currentData } = useSelect( ( select ) => { | ||
return { | ||
currentData: | ||
select( nfdOnboardingStore ).getCurrentOnboardingData(), | ||
}; | ||
}, [] ); | ||
|
||
const { setCurrentOnboardingData } = useDispatch( nfdOnboardingStore ); | ||
|
||
async function handleComingSoon( name, selection ) { | ||
currentData.data.comingSoon = selection; | ||
setCurrentOnboardingData( currentData ); | ||
} | ||
|
||
return ( | ||
<div className="coming_soon__wrapper"> | ||
<CheckboxItem | ||
name="coming_soon" | ||
title={ content.title } | ||
subtitle={ content.subtitle } | ||
icon={ '--site-features-comingsoon' } | ||
desc={ content.desc } | ||
callback={ handleComingSoon } | ||
fullWidth={ true } | ||
isSelectedDefault={ currentData?.data?.comingSoon } | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ComingSoon; |
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,8 @@ | ||
.coming_soon { | ||
|
||
&__wrapper { | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.site-features__heading { | ||
margin: 100px; | ||
|
||
@media (max-width: #{ ($break-medium) }) { | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { onboardingRestURL } from './common'; | ||
import { resolve } from './resolve'; | ||
|
||
import apiFetch from '@wordpress/api-fetch'; | ||
|
||
export async function setComingSoon( comingSoon ) { | ||
return await resolve( | ||
apiFetch( { | ||
url: onboardingRestURL( 'settings/coming-soon' ), | ||
method: 'POST', | ||
data: { | ||
comingSoon, | ||
}, | ||
} ).then() | ||
); | ||
} |