From a861d359bd8e7e1072de832d77053129817fe689 Mon Sep 17 00:00:00 2001 From: Dusty Reagan Date: Wed, 9 Oct 2024 09:07:44 -0500 Subject: [PATCH] Reader Onboarding: Setup basic framework and feature flag (#95230) * Setup basic framework and feature flag * Make the modal fullscreen --- client/reader/following/main.jsx | 3 ++ client/reader/onboarding/index.tsx | 52 +++++++++++++++++++ .../onboarding/interests-modal/index.tsx | 20 +++++++ client/reader/onboarding/style.scss | 30 +++++++++++ .../onboarding/subscribe-modal/index.tsx | 20 +++++++ config/development.json | 1 + 6 files changed, 126 insertions(+) create mode 100644 client/reader/onboarding/index.tsx create mode 100644 client/reader/onboarding/interests-modal/index.tsx create mode 100644 client/reader/onboarding/style.scss create mode 100644 client/reader/onboarding/subscribe-modal/index.tsx diff --git a/client/reader/following/main.jsx b/client/reader/following/main.jsx index afa1435397fb94..595e4711e4176b 100644 --- a/client/reader/following/main.jsx +++ b/client/reader/following/main.jsx @@ -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'; @@ -28,6 +30,7 @@ function FollowingStream( { ...props } ) { } ) } /> + { config.isEnabled( 'reader/onboarding' ) && } diff --git a/client/reader/onboarding/index.tsx b/client/reader/onboarding/index.tsx new file mode 100644 index 00000000000000..83ca9cf508955c --- /dev/null +++ b/client/reader/onboarding/index.tsx @@ -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 ( + <> +
+
+

Your personal reading adventure

+

Tailor your feed, connect with your favorite topics

+
+
+
    +
  • + +
  • +
  • + +
  • +
+
+
+ + setIsInterestsModalOpen( false ) } + /> + setIsDiscoverModalOpen( false ) } + /> + + ); +}; + +export default ReaderOnboarding; diff --git a/client/reader/onboarding/interests-modal/index.tsx b/client/reader/onboarding/interests-modal/index.tsx new file mode 100644 index 00000000000000..bd3688c49489fb --- /dev/null +++ b/client/reader/onboarding/interests-modal/index.tsx @@ -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 && ( + +

Interest content here.

+ +
+ ) + ); +}; + +export default InterestsModal; diff --git a/client/reader/onboarding/style.scss b/client/reader/onboarding/style.scss new file mode 100644 index 00000000000000..2363e42db914bb --- /dev/null +++ b/client/reader/onboarding/style.scss @@ -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; + } +} diff --git a/client/reader/onboarding/subscribe-modal/index.tsx b/client/reader/onboarding/subscribe-modal/index.tsx new file mode 100644 index 00000000000000..dcbe0e5ee26533 --- /dev/null +++ b/client/reader/onboarding/subscribe-modal/index.tsx @@ -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 && ( + +

Subscription content here.

+ +
+ ) + ); +}; + +export default SubscribeModal; diff --git a/config/development.json b/config/development.json index 8c484f61a05971..4a4c399619afe3 100644 --- a/config/development.json +++ b/config/development.json @@ -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,