Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader Onboarding: Setup basic framework and feature flag #95230

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions client/reader/following/main.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import config from '@automattic/calypso-config';
import clsx from 'clsx';
import { translate } from 'i18n-calypso';
import AsyncLoad from 'calypso/components/async-load';
import BloganuaryHeader from 'calypso/components/bloganuary-header';
import NavigationHeader from 'calypso/components/navigation-header';
import withDimensions from 'calypso/lib/with-dimensions';
import ReaderOnboarding from 'calypso/reader/onboarding';
import SuggestionProvider from 'calypso/reader/search-stream/suggestion-provider';
import Stream, { WIDE_DISPLAY_CUTOFF } from 'calypso/reader/stream';
import ReaderListFollowedSites from 'calypso/reader/stream/reader-list-followed-sites';
Expand All @@ -28,6 +30,7 @@ function FollowingStream( { ...props } ) {
} ) }
/>
<FollowingIntro />
{ config.isEnabled( 'reader/onboarding' ) && <ReaderOnboarding /> }
</Stream>
<AsyncLoad require="calypso/lib/analytics/track-resurrections" placeholder={ null } />
</>
Expand Down
52 changes: 52 additions & 0 deletions client/reader/onboarding/index.tsx
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;
20 changes: 20 additions & 0 deletions client/reader/onboarding/interests-modal/index.tsx
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;
30 changes: 30 additions & 0 deletions client/reader/onboarding/style.scss
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;
}
}
20 changes: 20 additions & 0 deletions client/reader/onboarding/subscribe-modal/index.tsx
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;
1 change: 1 addition & 0 deletions config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
"reader/full-errors": true,
"reader/list-management": true,
"reader/public-tag-pages": true,
"reader/onboarding": true,
"readymade-templates/showcase": true,
"redirect-fallback-browsers": false,
"rum-tracking/logstash": true,
Expand Down
Loading