-
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 #376 from newfold-labs/enhance/dark-mode-logic
Minor dark mode fixes and slot filled footers
- Loading branch information
Showing
17 changed files
with
175 additions
and
40 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/OnboardingSPA/components/Footer/components/SiteGenFooter/index.js
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,15 @@ | ||
import { Fill } from '@wordpress/components'; | ||
import { FOOTER_SITEGEN, FOOTER_START } from '../../../../../constants'; | ||
import ToggleDarkMode from '../../../ToggleDarkMode'; | ||
|
||
const SiteGenFooter = () => { | ||
return ( | ||
<> | ||
<Fill name={ `${ FOOTER_SITEGEN }/${ FOOTER_START }` }> | ||
<ToggleDarkMode /> | ||
</Fill> | ||
</> | ||
); | ||
}; | ||
|
||
export default SiteGenFooter; |
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,37 @@ | ||
import { FOOTER_END, FOOTER_START } from '../../../constants'; | ||
import { Slot } from '@wordpress/components'; | ||
import { useSelect } from '@wordpress/data'; | ||
import { Fragment, Suspense } from '@wordpress/element'; | ||
|
||
import { store as nfdOnboardingStore } from '../../store'; | ||
|
||
const Footer = () => { | ||
const { footers, footerActiveView } = useSelect( ( select ) => { | ||
return { | ||
footers: select( nfdOnboardingStore ).getFooters(), | ||
footerActiveView: | ||
select( nfdOnboardingStore ).getFooterActiveView(), | ||
}; | ||
} ); | ||
return ( | ||
<div className={ 'nfd-onboarding-footer' }> | ||
<Suspense fallback={ <Fragment /> }> | ||
{ footers.map( ( footer ) => { | ||
return ( | ||
<Fragment key={ footer.id }> | ||
<footer.footer /> | ||
</Fragment> | ||
); | ||
} ) } | ||
</Suspense> | ||
<div className="nfd-onboarding-footer__start"> | ||
<Slot name={ `${ footerActiveView }/${ FOOTER_START }` } /> | ||
</div> | ||
<div className="nfd-onboarding-footer__end"> | ||
<Slot name={ `${ footerActiveView }/${ FOOTER_END }` } /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Footer; |
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,22 @@ | ||
.nfd-onboarding-footer { | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
z-index: 1; | ||
|
||
display: flex; | ||
flex-direction: row; | ||
|
||
height: auto; | ||
width: 100%; | ||
border: none; | ||
|
||
&__end { | ||
position: absolute; | ||
right: 25px; | ||
} | ||
|
||
&--background { | ||
background-color: rgba(var(--nfd-onboarding-secondary-rgb), 0.75); | ||
} | ||
} |
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
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,15 @@ | ||
import { lazy } from '@wordpress/element'; | ||
|
||
import { FOOTER_SITEGEN } from '../../../constants'; | ||
|
||
const SiteGenFooter = lazy( () => | ||
import( '../../components/Footer/components/SiteGenFooter' ) | ||
); | ||
|
||
export const footers = [ | ||
{ | ||
id: FOOTER_SITEGEN, | ||
footer: SiteGenFooter, | ||
enabled: true, | ||
}, | ||
]; |
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
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
Oops, something went wrong.