diff --git a/frontend/src/components/Banner/Banner.tsx b/frontend/src/components/Banner/Banner.tsx index fd128ccc26..cd3aad9234 100644 --- a/frontend/src/components/Banner/Banner.tsx +++ b/frontend/src/components/Banner/Banner.tsx @@ -21,6 +21,7 @@ export interface BannerProps { children: string useMarkdown?: boolean showCloseButton?: boolean + bannerColor?: string } export const Banner = ({ @@ -28,6 +29,7 @@ export const Banner = ({ children, useMarkdown = false, showCloseButton, + bannerColor, }: BannerProps): JSX.Element => { const { isOpen, onToggle } = useDisclosure({ defaultIsOpen: true, @@ -45,7 +47,12 @@ export const Banner = ({ return ( - + { + const isMobile = useIsMobile() + const styles = useMultiStyleConfig('Banner', { variant }) + + const LearnMoreButton = () => ( + + ) + + return ( + + + + {title && ( + + {title} + + )} + + {body} + + {isMobile ? : null} + + {isMobile ? null : ( +
+ +
+ )} +
+
+ ) +} diff --git a/frontend/src/constants/links.ts b/frontend/src/constants/links.ts index bca8e83ac5..e67c6cee92 100644 --- a/frontend/src/constants/links.ts +++ b/frontend/src/constants/links.ts @@ -33,6 +33,8 @@ export const GUIDE_EMAIL_RELIABILITY = export const GUIDE_PREFILL = 'https://go.gov.sg/formsg-guide-prefills' export const GUIDE_STRIPE_ONBOARDING = 'https://go.gov.sg/formsg-stripe-onboarding' +export const GUIDE_PAYMENTS_PUBLIC = 'https://go.gov.sg/formsg-guide-payments' +export const GUIDE_PAYMENTS_ENTRY = 'https://go.gov.sg/formsg-payment-overview' export const ACCEPTED_FILETYPES_SPREADSHEET = 'https://go.gov.sg/formsg-cwl' diff --git a/frontend/src/features/login/LoginPage.tsx b/frontend/src/features/login/LoginPage.tsx index 2524f2a4bc..3c5c2019bc 100644 --- a/frontend/src/features/login/LoginPage.tsx +++ b/frontend/src/features/login/LoginPage.tsx @@ -6,12 +6,14 @@ import { Box, chakra, Flex, GridItem, GridProps, Text } from '@chakra-ui/react' import { AppFooter } from '~/app/AppFooter' import { ReactComponent as BrandLogoSvg } from '~assets/svgs/brand/brand-hort-colour.svg' +import { GUIDE_PAYMENTS_PUBLIC } from '~constants/links' import { LOGGED_IN_KEY } from '~constants/localStorage' import { LANDING_ROUTE } from '~constants/routes' import { useLocalStorage } from '~hooks/useLocalStorage' import { getBannerProps } from '~utils/getBannerProps' import { sendLoginOtp, verifyLoginOtp } from '~services/AuthService' import { Banner } from '~components/Banner' +import { FeatureBanner } from '~components/FeatureBanner/FeatureBanner' import Link from '~components/Link' import { AppGrid } from '~templates/AppGrid' @@ -149,13 +151,25 @@ export const LoginPage = (): JSX.Element => { await sendLoginOtp(email).then(({ otpPrefix }) => setOtpPrefix(otpPrefix)) } + const bannerColorIntensity = 600 + const bannerColor = `primary.${bannerColorIntensity}` // So banner colors are different from the blue background (left of login screen). + return ( {bannerProps ? ( - + {bannerProps.msg} ) : null} + diff --git a/frontend/src/features/rollout-announcement/Announcements.tsx b/frontend/src/features/rollout-announcement/Announcements.tsx index d1746dfefc..362b3f540e 100644 --- a/frontend/src/features/rollout-announcement/Announcements.tsx +++ b/frontend/src/features/rollout-announcement/Announcements.tsx @@ -1,3 +1,5 @@ +import { GUIDE_PAYMENTS_ENTRY } from '~constants/links' + import PaymentsAnnouncementGraphic from './assets/payments.json' // When updating this, remember to update the ROLLOUT_ANNOUNCEMENT_KEY_PREFIX with the new date @@ -8,7 +10,7 @@ export const NEW_FEATURES = [ title: 'Collect payments on your form', description: 'Citizens can now pay for fees and services directly on your form! We integrate with Stripe to provide reliable payments and hassle-free reconciliations. Payment methods we support include debit / credit cards and PayNow.', - learnMoreLink: 'https://go.gov.sg/formsg-payment-overview', + learnMoreLink: GUIDE_PAYMENTS_ENTRY, animationData: PaymentsAnnouncementGraphic, }, ] diff --git a/frontend/src/features/whats-new/FeatureUpdateList.ts b/frontend/src/features/whats-new/FeatureUpdateList.ts index 510331ef63..a0ab0796f8 100644 --- a/frontend/src/features/whats-new/FeatureUpdateList.ts +++ b/frontend/src/features/whats-new/FeatureUpdateList.ts @@ -1,6 +1,8 @@ import dedent from 'dedent' import { JsonObject, RequireExactlyOne } from 'type-fest' +import { GUIDE_PAYMENTS_ENTRY } from '~constants/links' + import Animation1 from './assets/1-payments.json' import Animation2 from './assets/2-search-and-filter.json' import Animation3 from './assets/3-dnd.json' @@ -33,8 +35,7 @@ export const FEATURE_UPDATE_LIST: FeatureUpdateList = { { title: 'Collect payments on your form', date: new Date('31 May 2023 GMT+8'), - description: - 'Citizens can now pay for fees and services directly on your form! We integrate with Stripe to provide reliable payments and hassle-free reconciliations. Payment methods we support include debit / credit cards and PayNow. [Learn more](https://go.gov.sg/formsg-payment-overview)', + description: `Citizens can now pay for fees and services directly on your form! We integrate with Stripe to provide reliable payments and hassle-free reconciliations. Payment methods we support include debit / credit cards and PayNow. [Learn more](${GUIDE_PAYMENTS_ENTRY})`, image: { animationData: Animation1, alt: 'Collect payments on your form', diff --git a/frontend/src/features/workspace/components/WorkspacePageContent.tsx b/frontend/src/features/workspace/components/WorkspacePageContent.tsx index ff4fa59242..7fcae618e2 100644 --- a/frontend/src/features/workspace/components/WorkspacePageContent.tsx +++ b/frontend/src/features/workspace/components/WorkspacePageContent.tsx @@ -1,6 +1,7 @@ import { useMemo } from 'react' import { Box, Container, Grid } from '@chakra-ui/react' +import { GUIDE_PAYMENTS_ENTRY } from '~constants/links' import { ROLLOUT_ANNOUNCEMENT_KEY_PREFIX } from '~constants/localStorage' import { useLocalStorage } from '~hooks/useLocalStorage' import InlineMessage from '~components/InlineMessage' @@ -39,6 +40,8 @@ export const WorkspacePageContent = ({ [isUserLoading, hasSeenAnnouncement], ) + const dashboardMessage = `Introducing payments! Citizens can now pay for fees and services directly on your form. [Learn more](${GUIDE_PAYMENTS_ENTRY})` + return totalFormsCount === 0 ? ( - Introducing payments! Citizens can now pay for fees and services - directly on your form. [Learn - more](https://go.gov.sg/formsg-payment-overview) + {dashboardMessage} { return ( <> +