From 011d40fb842a99b64c2a8b0a7b91d0cef6c741fd Mon Sep 17 00:00:00 2001 From: Nathan Gaberel Date: Wed, 16 Sep 2020 10:53:20 +0100 Subject: [PATCH] Add basic support page page link blocks. --- packages/react/lib/Block.tsx | 7 +++++++ packages/types/lib/index.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react/lib/Block.tsx b/packages/react/lib/Block.tsx index 5c8b8ac..c2a2637 100644 --- a/packages/react/lib/Block.tsx +++ b/packages/react/lib/Block.tsx @@ -1,6 +1,7 @@ import React from "react"; import debug from "debug"; import { BlockValues, TextSection, TextModifier } from "@notion-cms/types"; +import NotionLink from "./NotionLink"; const log = debug("notion-cms:react"); @@ -19,6 +20,12 @@ const applyModifier = ( return {children}; case "a": return {children}; + case "p": + return ( + + Page {mod[1]} + + ); default: log('Ignoring unknown text modifier "%s": %O', mod[0], mod); return children; diff --git a/packages/types/lib/index.ts b/packages/types/lib/index.ts index 9b13f88..9f30631 100644 --- a/packages/types/lib/index.ts +++ b/packages/types/lib/index.ts @@ -66,7 +66,7 @@ export interface PageBlockValues extends BaseBlockValues { }; } -export type TextModifier = ["b"] | ["i"] | ["a", string]; +export type TextModifier = ["b"] | ["i"] | ["a", string] | ["p", UUID]; export type TextSection = [string, TextModifier[]]; interface TextBlockValues