-
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.
Reader Onboarding: Setup basic framework and feature flag (#95230)
* Setup basic framework and feature flag * Make the modal fullscreen
- Loading branch information
1 parent
b8fdc88
commit a861d35
Showing
6 changed files
with
126 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React, { useState } from 'react'; | ||
import InterestsModal from './interests-modal'; | ||
import SubscribeModal from './subscribe-modal'; | ||
|
||
import './style.scss'; | ||
|
||
const ReaderOnboarding = () => { | ||
const [ isInterestsModalOpen, setIsInterestsModalOpen ] = useState( false ); | ||
const [ isDiscoverModalOpen, setIsDiscoverModalOpen ] = useState( false ); | ||
|
||
return ( | ||
<> | ||
<div className="reader-onboarding"> | ||
<div className="reader-onboarding__intro-column"> | ||
<h2>Your personal reading adventure</h2> | ||
<p>Tailor your feed, connect with your favorite topics</p> | ||
</div> | ||
<div className="reader-onboarding__steps-column"> | ||
<ul> | ||
<li> | ||
<button | ||
className="reader-onboarding__link-button" | ||
onClick={ () => setIsInterestsModalOpen( true ) } | ||
> | ||
Select some of your interests | ||
</button> | ||
</li> | ||
<li> | ||
<button | ||
className="reader-onboarding__link-button" | ||
onClick={ () => setIsDiscoverModalOpen( true ) } | ||
> | ||
Discover and subscribe to sites you'll love | ||
</button> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<InterestsModal | ||
isOpen={ isInterestsModalOpen } | ||
onClose={ () => setIsInterestsModalOpen( false ) } | ||
/> | ||
<SubscribeModal | ||
isOpen={ isDiscoverModalOpen } | ||
onClose={ () => setIsDiscoverModalOpen( false ) } | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default ReaderOnboarding; |
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,20 @@ | ||
import { Modal } from '@wordpress/components'; | ||
import React from 'react'; | ||
|
||
interface InterestsModalProps { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
} | ||
|
||
const InterestsModal: React.FC< InterestsModalProps > = ( { isOpen, onClose } ) => { | ||
return ( | ||
isOpen && ( | ||
<Modal title="Select Your Interests" onRequestClose={ onClose } isFullScreen> | ||
<p>Interest content here.</p> | ||
<button onClick={ onClose }>Close</button> | ||
</Modal> | ||
) | ||
); | ||
}; | ||
|
||
export default InterestsModal; |
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,30 @@ | ||
.reader-onboarding { | ||
display: flex; | ||
width: 100%; | ||
flex-wrap: wrap; | ||
|
||
&__link-button { | ||
background: none; | ||
border: none; | ||
padding: 0; | ||
color: #00e; | ||
text-decoration: underline; | ||
cursor: pointer; | ||
font: inherit; | ||
} | ||
|
||
&__intro-column, | ||
&__steps-column { | ||
flex: 1 1 300px; | ||
min-width: 300px; // Minimum width before wrapping | ||
padding: 20px; | ||
} | ||
|
||
&__intro-column { | ||
background-color: #aaa; | ||
} | ||
|
||
&__steps-column { | ||
background-color: #eee; | ||
} | ||
} |
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,20 @@ | ||
import { Modal } from '@wordpress/components'; | ||
import React from 'react'; | ||
|
||
interface SubscribeModalProps { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
} | ||
|
||
const SubscribeModal: React.FC< SubscribeModalProps > = ( { isOpen, onClose } ) => { | ||
return ( | ||
isOpen && ( | ||
<Modal title="Discover and Subscribe" onRequestClose={ onClose } isFullScreen> | ||
<p>Subscription content here.</p> | ||
<button onClick={ onClose }>Close</button> | ||
</Modal> | ||
) | ||
); | ||
}; | ||
|
||
export default SubscribeModal; |
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