From 66ffa8515bf6a58c6a240ceff245d70f98e1274e Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Sun, 20 Oct 2024 11:32:12 +0900 Subject: [PATCH] Refactor help modal with wordpress components --- src/settings/global-settings/help-modal.tsx | 126 +++++++++++--------- src/settings/global-settings/style.scss | 13 -- 2 files changed, 72 insertions(+), 67 deletions(-) diff --git a/src/settings/global-settings/help-modal.tsx b/src/settings/global-settings/help-modal.tsx index 50aae51..3029a24 100644 --- a/src/settings/global-settings/help-modal.tsx +++ b/src/settings/global-settings/help-modal.tsx @@ -8,7 +8,13 @@ import type { Dispatch, SetStateAction } from 'react'; */ import { __ } from '@wordpress/i18n'; import { createInterpolateElement } from '@wordpress/element'; -import { Modal, ExternalLink } from '@wordpress/components'; +import { + Modal, + ExternalLink, + __experimentalVStack as VStack, + __experimentalText as Text, + __experimentalHeading as Heading, +} from '@wordpress/components'; type Props = { setIsHelpModalOpen: Dispatch< SetStateAction< boolean > >; @@ -21,59 +27,71 @@ export default function HelpModal( { setIsHelpModalOpen }: Props ) { className="ftb-global-help-modal" onRequestClose={ () => setIsHelpModalOpen( false ) } > -

{ __( 'About default table style', 'flexible-table-block' ) }

-

- { __( - 'Flexible Table Block is a block that allows you to create tables in various styles. First of all, it is recommended to set the default style of the table from "Global Setting".', - 'flexible-table-block' - ) } -

-

{ __( 'Select multiple cells', 'flexible-table-block' ) }

-

- { createInterpolateElement( - __( - 'Hold Ctrl key to select multiple cells or hold Shift key to select the range. Selecting multiple cells is used to merge cells or to change styles of multiple cells.', - 'flexible-table-block' - ), - { code: } - ) } -

-

{ __( 'About scroll table', 'flexible-table-block' ) }

-

- { __( - 'If table scrolling is enabled, set "Table Width" or "Table Min Width" larger than the content width.', - 'flexible-table-block' - ) } -

-

{ __( 'About accessibility', 'flexible-table-block' ) }

-

- { createInterpolateElement( - __( - 'You can tell screenreaders exactly by properly defining id, headers, and scope attributes for each cell.', - 'flexible-table-block' - ), - { code: } - ) } -

-

- { createInterpolateElement( - __( - 'Refer to this page for the specifications of each attribute.', - 'flexible-table-block' - ), - { - Link: ( - // @ts-ignore - - ), - } - ) } -

+ + + + { __( 'About default table style', 'flexible-table-block' ) } + + + { __( + 'Flexible Table Block is a block that allows you to create tables in various styles. First of all, it is recommended to set the default style of the table from "Global Setting".', + 'flexible-table-block' + ) } + + + + { __( 'Select multiple cells', 'flexible-table-block' ) } + + { createInterpolateElement( + __( + 'Hold Ctrl key to select multiple cells or hold Shift key to select the range. Selecting multiple cells is used to merge cells or to change styles of multiple cells.', + 'flexible-table-block' + ), + { code: } + ) } + + + + { __( 'About scroll table', 'flexible-table-block' ) } + + { __( + 'If table scrolling is enabled, set "Table Width" or "Table Min Width" larger than the content width.', + 'flexible-table-block' + ) } + + + + { __( 'About accessibility', 'flexible-table-block' ) } + + { createInterpolateElement( + __( + 'You can tell screenreaders exactly by properly defining id, headers, and scope attributes for each cell.', + 'flexible-table-block' + ), + { code: } + ) } + + + { createInterpolateElement( + __( + 'Refer to this page for the specifications of each attribute.', + 'flexible-table-block' + ), + { + Link: ( + // @ts-ignore + + ), + } + ) } + + + ); } diff --git a/src/settings/global-settings/style.scss b/src/settings/global-settings/style.scss index 9e133eb..7a5d084 100644 --- a/src/settings/global-settings/style.scss +++ b/src/settings/global-settings/style.scss @@ -216,17 +216,4 @@ .ftb-global-help-modal { max-width: 600px; - - h2 { - margin: 1.5em 0 0.5em; - font-size: 0.9rem; - } - - p { - margin: 0 0 1em; - } - - hr { - margin: 1.5em 0; - } }