diff --git a/packages/web/components/elements/Button.tsx b/packages/web/components/elements/Button.tsx index 6a407e770..831fc58cc 100644 --- a/packages/web/components/elements/Button.tsx +++ b/packages/web/components/elements/Button.tsx @@ -20,7 +20,7 @@ export const Button = styled('button', { }, ctaDarkYellow: { border: '1px solid transparent', - fontSize: '13px', + fontSize: '14px', fontWeight: 500, fontFamily: 'Inter', borderRadius: '5px', @@ -77,8 +77,8 @@ export const Button = styled('button', { fontFamily: 'Inter', borderRadius: '8px', cursor: 'pointer', - color: 'white', p: '10px 12px', + color: '$thTextContrast2', bg: 'rgb(125, 125, 125, 0.3)', '&:hover': { bg: 'rgb(47, 47, 47, 0.1)', diff --git a/packages/web/components/elements/FeatureHelpBox.tsx b/packages/web/components/elements/FeatureHelpBox.tsx new file mode 100644 index 000000000..603c829e5 --- /dev/null +++ b/packages/web/components/elements/FeatureHelpBox.tsx @@ -0,0 +1,118 @@ +import { HStack, SpanBox, VStack } from './LayoutPrimitives' +import { ArrowRightIcon } from './icons/ArrowRightIcon' +import { theme } from '../tokens/stitches.config' +import { Button } from './Button' +import { CloseIcon } from './icons/CloseIcon' +import { HelpfulOwlImage } from './images/HelpfulOwlImage' +import { ArrowSquareOut } from 'phosphor-react' + +type FeatureHelpBoxProps = { + helpTitle: string + helpMessage: string + + helpCTAText?: string + onClickCTA?: () => void + + docsMessage: string + docsDestination: string + + onDismiss: () => void +} + +export const FeatureHelpBox = (props: FeatureHelpBoxProps) => { + return ( + + + + + + + + + ) +} + +const HelpSection = (props: FeatureHelpBoxProps) => { + return ( + + + + {props.helpTitle} + + + + {props.helpMessage} + + {props.helpCTAText && props.onClickCTA && ( + + )} + + + + ) +} diff --git a/packages/web/components/elements/SuggestionBox.tsx b/packages/web/components/elements/SuggestionBox.tsx index 95dc32660..ae6cafcee 100644 --- a/packages/web/components/elements/SuggestionBox.tsx +++ b/packages/web/components/elements/SuggestionBox.tsx @@ -85,7 +85,7 @@ export const SuggestionBox = (props: SuggestionBoxProps) => { fontWeight: '600', }} > - + )} diff --git a/packages/web/components/elements/icons/CloseIcon.tsx b/packages/web/components/elements/icons/CloseIcon.tsx new file mode 100644 index 000000000..384f28150 --- /dev/null +++ b/packages/web/components/elements/icons/CloseIcon.tsx @@ -0,0 +1,39 @@ +/* eslint-disable functional/no-class */ +/* eslint-disable functional/no-this-expression */ +import { IconProps } from './IconProps' + +import React from 'react' + +export class CloseIcon extends React.Component { + render() { + const size = (this.props.size || 26).toString() + const color = (this.props.color || '#2A2A2A').toString() + + return ( + + + + + + + ) + } +} diff --git a/packages/web/components/elements/images/HelpfulOwlImage.tsx b/packages/web/components/elements/images/HelpfulOwlImage.tsx new file mode 100644 index 000000000..3268d3a29 --- /dev/null +++ b/packages/web/components/elements/images/HelpfulOwlImage.tsx @@ -0,0 +1,17 @@ +import Image from 'next/image' + +type HelpfulOwlImageProps = { + width: number + height: number +} + +export const HelpfulOwlImage = (props: HelpfulOwlImageProps) => { + return ( + Picture of an owl reading + ) +} diff --git a/packages/web/components/templates/settings/SettingsTable.tsx b/packages/web/components/templates/settings/SettingsTable.tsx index 0460ab8a0..dda8dd4fa 100644 --- a/packages/web/components/templates/settings/SettingsTable.tsx +++ b/packages/web/components/templates/settings/SettingsTable.tsx @@ -10,6 +10,7 @@ import { theme } from '../../tokens/stitches.config' import { SettingsLayout } from '../SettingsLayout' import { SuggestionBox } from '../../elements/SuggestionBox' import { usePersistedState } from '../../../lib/hooks/usePersistedState' +import { FeatureHelpBox } from '../../elements/FeatureHelpBox' type SettingsTableProps = { pageId: string @@ -57,9 +58,13 @@ type MoreOptionsProps = { } type SuggestionInfo = { - text: string + title: string + message: string docs: string key: string + + CTAText?: string + onClickCTA?: () => void } const MoreOptions = (props: MoreOptionsProps) => ( @@ -315,19 +320,17 @@ export const SettingsTable = (props: SettingsTableProps): JSX.Element => { }} > {props.suggestionInfo && showSuggestion && ( - - { - setShowSuggestion(false) - }} - /> - + { + setShowSuggestion(false) + }} + helpCTAText={props.suggestionInfo.CTAText} + onClickCTA={props.suggestionInfo.onClickCTA} + /> )} { onAdd() setName('') @@ -122,9 +122,19 @@ export default function Api(): JSX.Element { setAddModalOpen(true) }} suggestionInfo={{ - text: 'Create API keys to connect Omnivore to other apps such as Logseq and Obsidian or to query the API. Check out the integrations page for more info on connecting to Omnivore via the API.', + title: + 'Use API keys to Integrate Omnivore with other apps and services', + message: + 'Create API keys to connect Omnivore to other apps such as Logseq and Obsidian or to query the API. Check out the integrations page for more info on connecting to Omnivore via the API.', docs: 'https://docs.omnivore.app/integrations/api.html', key: '--settings-apikeys-show-help', + CTAText: 'Create an API Key', + onClickCTA: () => { + onAdd() + setName('') + setExpiresAt(neverExpiresDate) + setAddModalOpen(true) + }, }} > {sortedApiKeys.length > 0 ? ( @@ -168,7 +178,7 @@ export default function Api(): JSX.Element { {addModalOpen && ( { + createEmail() + }, }} > {sortedEmailAddresses.length > 0 ? ( diff --git a/packages/web/pages/settings/emails/recent.tsx b/packages/web/pages/settings/emails/recent.tsx index ce1dace90..3a77c106e 100644 --- a/packages/web/pages/settings/emails/recent.tsx +++ b/packages/web/pages/settings/emails/recent.tsx @@ -172,7 +172,10 @@ export default function RecentEmails(): JSX.Element { pageInfoLink="https://docs.omnivore.app/using/inbox.html" headerTitle="Recently Received Emails" suggestionInfo={{ - text: 'View all the original content of emails that have been recently received in your Omnivore inbox. If an email was not correctly classified as an article you can mark it as an article.', + title: + 'View original emails that have been recently received in your Omnivore inbox.', + message: + "Your 30 most recent emails are stored below. You can click on each email to view its original content or it's text content. If an email was not correctly classified as an article you can mark it as an article and it will be added to your library.", docs: 'https://docs.omnivore.app/using/inbox.html', key: '--settings-recent-emails-show-help', }} diff --git a/packages/web/pages/settings/feeds/index.tsx b/packages/web/pages/settings/feeds/index.tsx index 7abae14d2..48f1d73cd 100644 --- a/packages/web/pages/settings/feeds/index.tsx +++ b/packages/web/pages/settings/feeds/index.tsx @@ -92,14 +92,20 @@ export default function Rss(): JSX.Element { pageId={'feeds'} pageInfoLink="https://docs.omnivore.app/using/feeds.html" headerTitle="Subscribed feeds" - createTitle="Add feed" + createTitle="Add a feed" createAction={() => { router.push('/settings/feeds/add') }} suggestionInfo={{ - text: 'Add RSS and Atom feeds to your Omnivore account. When you add a new feed the last 24hrs of items, or at least one item will be added to your account.', + title: 'Add RSS and Atom feeds to your Omnivore account', + message: + 'When you add a new feed the last 24hrs of items, or at least one item will be added to your account. Feeds will be checked for updates every hour, and new items will be added to your library.', docs: 'https://docs.omnivore.app/using/feeds.html', key: '--settings-feeds-show-help', + CTAText: 'Add a feed', + onClickCTA: () => { + router.push('/settings/feeds/add') + }, }} > {subscriptions.length === 0 ? ( diff --git a/packages/web/pages/settings/labels.tsx b/packages/web/pages/settings/labels.tsx index bfbd31665..03579e8bb 100644 --- a/packages/web/pages/settings/labels.tsx +++ b/packages/web/pages/settings/labels.tsx @@ -37,6 +37,7 @@ import { ConfirmationModal } from '../../components/patterns/ConfirmationModal' import { InfoLink } from '../../components/elements/InfoLink' import { SuggestionBox } from '../../components/elements/SuggestionBox' import { usePersistedState } from '../../lib/hooks/usePersistedState' +import { FeatureHelpBox } from '../../components/elements/FeatureHelpBox' const HeaderWrapper = styled(Box, { width: '100%', @@ -277,19 +278,21 @@ export default function LabelsPage(): JSX.Element { /> ) : null} {showLabelPageHelp && ( - - { - setShowLabelPageHelp(false) - }} - /> - + { + setShowLabelPageHelp(false) + }} + helpCTAText="Create a label" + onClickCTA={() => { + resetLabelState() + handleGenerateRandomColor() + setIsCreateMode(true) + }} + /> )} - Add Label - - - + Create a label diff --git a/packages/web/pages/settings/subscriptions.tsx b/packages/web/pages/settings/subscriptions.tsx index e38924e07..b6921e563 100644 --- a/packages/web/pages/settings/subscriptions.tsx +++ b/packages/web/pages/settings/subscriptions.tsx @@ -47,7 +47,9 @@ export default function SubscriptionsPage(): JSX.Element { pageInfoLink="https://docs.omnivore.app/using/feeds.html" headerTitle="Subscriptions" suggestionInfo={{ - text: 'View and manage all your Feed and Newsletter subscriptions. You can add RSS or Atom subscriptions on the Feeds page and create emails to subscribe to newsletters', + title: 'View and manage all your Feed and Newsletter subscriptions', + message: + 'Use this page to view and manage all the Feeds (RSS & Atom) and Newsletters you have subscribed to.', docs: 'https://docs.omnivore.app/using/inbox.html', key: '--settings-recent-subscriptions-show-help', }}