Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Redesign roadmap upsell with HTML skeleton

Matt Roberts0de6bdf3b93f
diff --git a/locale/en/client.json b/locale/en/client.json
index d603b6b0e..c4ec5c49e 100644
--- a/locale/en/client.json
+++ b/locale/en/client.json
@@ -190,8 +190,8 @@
"postdetails.backtoall": "Back to all suggestions",
"postdetails.backtoroadmap": "Back to roadmap",
"roadmap.upsell.billing": "Upgrade to PRO",
- "roadmap.upsell.description": "The roadmap view is a PRO feature that lets you visualize your planned, in-progress, and completed posts in a kanban-style board.",
- "roadmap.upsell.title": "Roadmap",
+ "roadmap.upsell.description": "Upgrade to Pro to unlock your Roadmap",
+ "roadmap.upsell.title": "See what's happening in the Roadmap view",
"showpost.comment.copylink.error": "Could not copy comment link, please copy page URL",
"showpost.comment.copylink.success": "Successfully copied comment link to clipboard",
"showpost.comment.unknownhighlighted": "Unknown comment ID #{id}",
diff --git a/public/pages/Roadmap/Roadmap.page.scss b/public/pages/Roadmap/Roadmap.page.scss
index 34b9410ef..3a6175106 100644
--- a/public/pages/Roadmap/Roadmap.page.scss
+++ b/public/pages/Roadmap/Roadmap.page.scss
@@ -28,3 +28,68 @@
gap: spacing(4);
}
}
+
+#p-roadmap-upsell {
+ padding-top: spacing(8);
+ padding-bottom: spacing(12);
+}
+
+.c-roadmap-upsell {
+ max-width: 720px;
+ margin-left: auto;
+ margin-right: auto;
+ margin-top: spacing(-12); // pull copy up under the fading skeleton
+ position: relative;
+ z-index: 1;
+
+ &__title {
+ font-size: 2rem;
+ line-height: 1.2;
+ padding-top: spacing(8);
+
+ @include media("lg") {
+ font-size: 2.5rem;
+ }
+ }
+
+ &__subtitle {
+ font-size: 1rem;
+ }
+
+ &__skeleton {
+ pointer-events: none;
+ user-select: none;
+ margin-bottom: spacing(4);
+ mask-image: linear-gradient(to bottom, black 0%, black 35%, transparent 95%);
+ -webkit-mask-image: linear-gradient(to bottom, black 0%, black 35%, transparent 95%);
+ }
+
+ &__card {
+ background: white;
+ border: 1px solid var(--colors-gray-200);
+ border-radius: 8px;
+ padding: spacing(4);
+ display: flex;
+ flex-direction: column;
+ gap: spacing(3);
+ }
+
+ &__bar {
+ height: 14px;
+ border-radius: 4px;
+ background: var(--colors-gray-200);
+
+ &--sm {
+ width: 30%;
+ }
+
+ &--md {
+ width: 80%;
+ }
+
+ &--lg {
+ width: 65%;
+ height: 16px;
+ }
+ }
+}
diff --git a/public/pages/Roadmap/Roadmap.page.tsx b/public/pages/Roadmap/Roadmap.page.tsx
index f3dc7b502..98e47ab2d 100644
--- a/public/pages/Roadmap/Roadmap.page.tsx
+++ b/public/pages/Roadmap/Roadmap.page.tsx
@@ -4,7 +4,7 @@ import IconArrowLeft from "@fider/assets/images/heroicons-arrowleft.svg"
import React, { useState, useCallback } from "react"
import { Post, Tag } from "@fider/models"
-import { Header, ResponseLozenge, Button, Icon } from "@fider/components"
+import { Header, Button, Icon, ResponseLozenge } from "@fider/components"
import { ListPosts } from "@fider/pages/Home/components/ListPosts"
import { VStack, HStack } from "@fider/components/layout"
import { useFider, usePostOverlay } from "@fider/hooks"
@@ -89,28 +89,56 @@ const RoadmapBoard = (props: RoadmapPageProps) => {
)
}
+const SkeletonCard = () => (
+ <div className="c-roadmap-upsell__card">
+ <div className="c-roadmap-upsell__bar c-roadmap-upsell__bar--lg" />
+ <div className="c-roadmap-upsell__bar c-roadmap-upsell__bar--sm" />
+ <div className="c-roadmap-upsell__bar c-roadmap-upsell__bar--md" />
+ <div className="c-roadmap-upsell__bar c-roadmap-upsell__bar--md" />
+ </div>
+)
+
+const SkeletonColumn = ({ status }: { status: string }) => (
+ <div className="c-roadmap-column">
+ <div className="c-roadmap-column__header">
+ <ResponseLozenge status={status} response={null} />
+ </div>
+ <div className="c-roadmap-column__body">
+ <SkeletonCard />
+ <SkeletonCard />
+ </div>
+ </div>
+)
+
const RoadmapUpsell = () => {
const fider = useFider()
const isAdmin = fider.session.isAuthenticated && fider.session.user.isAdministrator
- const showBillingLink = isAdmin && fider.settings.isBillingEnabled
+ const showBillingCta = isAdmin && fider.settings.isBillingEnabled
return (
- <div className="page container">
- <div className="text-center py-8">
- <h2 className="text-display mb-2">
- <Trans id="roadmap.upsell.title">Roadmap</Trans>
- </h2>
- <p className="text-muted mb-4">
- <Trans id="roadmap.upsell.description">
- The roadmap view is a PRO feature that lets you visualize your planned, in-progress, and completed posts in a kanban-style board.
- </Trans>
+ <div id="p-roadmap-upsell" className="page container">
+ <div className="c-roadmap-upsell__skeleton" aria-hidden="true">
+ <div className="c-roadmap-board">
+ <SkeletonColumn status="planned" />
+ <SkeletonColumn status="started" />
+ <SkeletonColumn status="completed" />
+ </div>
+ </div>
+ <VStack spacing={4} className="c-roadmap-upsell flex-items-center text-center">
+ <h1 className="c-roadmap-upsell__title text-display">
+ <Trans id="roadmap.upsell.title">See what&apos;s happening in the Roadmap view</Trans>
+ </h1>
+ <p className="c-roadmap-upsell__subtitle text-muted">
+ <Trans id="roadmap.upsell.description">Upgrade to Pro to unlock your Roadmap</Trans>
</p>
- {showBillingLink && (
- <a href="/admin/billing" className="text-link">
- <Trans id="roadmap.upsell.billing">Upgrade to PRO</Trans>
+ {showBillingCta && (
+ <a href="/admin/billing">
+ <Button variant="primary" size="large">
+ <Trans id="roadmap.upsell.billing">Upgrade to PRO</Trans>
+ </Button>
</a>
)}
- </div>
+ </VStack>
</div>
)
}