From 46328972f64198556d9d0f39b1591f92f7b5d684 Mon Sep 17 00:00:00 2001 From: viet nguyen Date: Sat, 28 Oct 2023 13:58:11 -0700 Subject: [PATCH] fix: correct LCO action strs --- src/app/components/LandingCTA.tsx | 6 ++--- src/app/components/RecentEdits.tsx | 4 +-- src/app/components/RecentTags.tsx | 4 +-- src/app/layout.tsx | 3 ++- src/app/page.tsx | 3 +++ src/components/edit/RecentChangeHistory.tsx | 27 ++++++++++++--------- src/components/ui/Card/Card.tsx | 2 +- 7 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/app/components/LandingCTA.tsx b/src/app/components/LandingCTA.tsx index 6f8097b0a..205f18ce4 100644 --- a/src/app/components/LandingCTA.tsx +++ b/src/app/components/LandingCTA.tsx @@ -5,7 +5,7 @@ import { ReactNode } from 'react' export const LandingCTA: React.FC = () => { return ( -
+
@@ -42,7 +42,7 @@ const Card4All: React.FC = () => { title='Climbers' body={
    -
  • ☑️ Add missing climbs
  • +
  • ☑️ Add missing climbs.
  • ☑️ Help us make your local climbing's area page even better!
} @@ -81,7 +81,7 @@ interface CTACardProps { const Card: React.FC = ({ title, body, action, className }) => { return (
-

{title}

+

{title}

{body}
diff --git a/src/app/components/RecentEdits.tsx b/src/app/components/RecentEdits.tsx index 3dc33f8c4..f8cf8f061 100644 --- a/src/app/components/RecentEdits.tsx +++ b/src/app/components/RecentEdits.tsx @@ -2,7 +2,7 @@ import Link from 'next/link' import { ArrowRightIcon } from '@heroicons/react/24/outline' import { getChangeHistoryServerSide } from '@/js/graphql/contribAPI' -import { ChangesetRow } from '@/components/edit/RecentChangeHistory' +import { ChangesetCard } from '@/components/edit/RecentChangeHistory' /** * Cache time in seconds @@ -23,7 +23,7 @@ export const RecentEdits: React.FC = async () => {
{history.splice(0, 10).map(changetset => - + )}
diff --git a/src/app/components/RecentTags.tsx b/src/app/components/RecentTags.tsx index 3267334ad..c337553ab 100644 --- a/src/app/components/RecentTags.tsx +++ b/src/app/components/RecentTags.tsx @@ -24,12 +24,12 @@ export const RecentTags: React.FC = async () => { }) return ( -
+

Recent Tags

-
+

{ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 440854d65..86a754721 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -11,7 +11,8 @@ export const metadata: Metadata = { openGraph: { description: 'OpenBeta is a free climbing platform. Join the community and share your knowledge today.', images: '/south-africa-og.jpeg' - } + }, + metadataBase: new URL(`https://${process.env.VERCEL_URL ?? 'http://localhost:3000'}`) } export default function RootLayout ({ diff --git a/src/app/page.tsx b/src/app/page.tsx index 313cf6f79..77f94af73 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -5,6 +5,9 @@ import { RecentEdits, RecentEditsSkeleton } from './components/RecentEdits' import { RecentTags } from './components/RecentTags' import { USAToC } from './components/USAToC' +/** + * Root home page + */ export default async function Home (): Promise { return (
diff --git a/src/components/edit/RecentChangeHistory.tsx b/src/components/edit/RecentChangeHistory.tsx index 6f8d25946..59a254a0a 100644 --- a/src/components/edit/RecentChangeHistory.tsx +++ b/src/components/edit/RecentChangeHistory.tsx @@ -9,10 +9,14 @@ import { ChangesetType, ChangeType, AreaType, ClimbType, OrganizationType, Docum export interface RecentChangeHistoryProps { history: ChangesetType[] } + +/** + * Show all changes + */ export default function RecentChangeHistory ({ history }: RecentChangeHistoryProps): JSX.Element { return (
- {history.map(changetset => )} + {history.map(changetset => )}
) } @@ -21,7 +25,10 @@ interface ChangsetRowProps { changeset: ChangesetType } -export const ChangesetRow = ({ changeset }: ChangsetRowProps): JSX.Element => { +/** + * A card showing individual changeset + */ +export const ChangesetCard: React.FC = ({ changeset }) => { const { createdAt, editedByUser, operation, changes } = changeset // @ts-expect-error @@ -186,13 +193,6 @@ const ActionIcon = ({ icon, clz }: ActionIconProps): JSX.Element => (
{icon}
) -interface OpBadgeProps { - label: string - clz?: string -} - -const OpBadge = ({ label, clz = 'badge-outline' }: OpBadgeProps): JSX.Element => {label} - const operationLabelMap = { addArea: { borderCue: 'border-l-green-500', @@ -235,15 +235,18 @@ const operationLabelMap = { icon: } /> }, addOrganization: { - badge: , + badge: 'added an organization', + borderCue: 'border-l-green-500', icon: } clz='bg-success' /> }, updateOrganization: { - badge: , + badge: 'updated an organization', + borderCue: 'border-l-black', icon: } /> }, deleteOrganization: { - badge: , + badge: 'deleted an organization', + borderCue: 'border-l-pink-500', icon: } clz='bg-error' /> } } diff --git a/src/components/ui/Card/Card.tsx b/src/components/ui/Card/Card.tsx index e28cf9349..3ed9eb6ba 100644 --- a/src/components/ui/Card/Card.tsx +++ b/src/components/ui/Card/Card.tsx @@ -17,7 +17,7 @@ export default function Card ({ bordered = false }: CardProps): JSX.Element { return ( -
+
{header}
{image}