Skip to content

Comments

160341-172821 Implement Text Style Tab#10779

Merged
yuki-takei merged 7 commits intofeat/160341-editor-guidefrom
feat/160341-172821-textstyletab
Feb 19, 2026
Merged

160341-172821 Implement Text Style Tab#10779
yuki-takei merged 7 commits intofeat/160341-editor-guidefrom
feat/160341-172821-textstyletab

Conversation

@mariko-h
Copy link

@mariko-h mariko-h commented Feb 12, 2026

@mariko-h
Copy link
Author

スクリーンショット 2026-02-12 14 45 23 スクリーンショット 2026-02-12 14 45 29

@mariko-h mariko-h changed the title 160341-172821 テキストスタイルタブの実装 160341-172821 Implement Text Style Tab Feb 12, 2026
<p className="mb-0">Click the close button or the background to close.</p>
{activeTab === 'textstyle' && <TextStyleTab />}
{activeTab === 'layout' && <LayoutTab />}
{activeTab === 'decoration' && <DecorationTab />}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
id: 'link-sandbox',
title: '',
code: '[砂場ページはこちら](/Sandbox)',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GROWI 本体は多言語対応しているので useTranslation を使って書いてください。(ここ以外の日本語で書かれている部分も)

ソースコード内部で useTranslation で全文検索するとどういう使われ方をしているのかわかると思います。

@mariko-h
Copy link
Author

mariko-h commented Feb 13, 2026

現在の表示はこちらになります。
スクリーンショット 2026-02-13 15 01 28
スクリーンショット 2026-02-13 15 01 34

<CustomNavTab
activeTab={activeTab}
navTabMapping={navTabMapping}
onNavSelected={tab => setActiveTab(tab as TabType)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertion を書かずに実装できますか?(TS の恩恵が薄れるのでなるべく as を書きたくないです)

const navTabMapping = useMemo(() => {
return {
textstyle: {
i18n: 'テキストスタイル',
Copy link
Member

@miya miya Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ動いてますか?
editor_guide.tabs.textstyle みたいな、i18n の key を入れれないといけないんじゃないかと思っていました。(間違っていたらすみません)

また i18n に入れたものはどこで消費されていますか?

使用例

const navTabMapping = useMemo(() => {
return {
pagelist: {
Icon: PageListTabIcon,
Content: PageListTabContent,
i18n: t('page_list'),
isLinkEnabled: () => !isSharedUser,
},
timeline: {
Icon: TimelineTabIcon,
Content: TimelineTabContent,
i18n: t('Timeline View'),
isLinkEnabled: () => !isSharedUser,
},
};
}, [isSharedUser, t]);

width: 'fit-content',
color: '#D63384', // 文字の色
border: '1px solid #D63384', // 枠線の色(太さ1px、実線、指定の色)
backgroundColor: 'transparent', // 背景を透明にする場合(必要に応じて)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ソースコード内のコメントは全て英語でお願いします (DeepL や Nani 等の機械翻訳で構いません)


export const TextStyleTab: React.FC = () => {
const { t } = useTranslation();
const ts = 'editor_guide.textstyle';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

もうしこしわかりやすい変数名にお願いします

@mariko-h
Copy link
Author

現在の表示はこちらになります。
スクリーンショット 2026-02-16 13 34 55
スクリーンショット 2026-02-16 13 35 01

color: '#ABB2BF',
verticalAlign: 'middle',
marginLeft: '4px',
}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style をこんなに細かく書きたくないですね
特に色はテーマによって変わるものなので

{t(`${i18nKey}.this`)} <strong>{t(`${i18nKey}.bold`)}</strong> {t(`${i18nKey}.is`)}
</div>
),
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この構造のオブジェクトの type を定義して、ここの宣言部分と GuideRow の props と両方で同じものを使ってください
TEXT_STYLE_GUIDES に適当な型のオブジェクトが紛れ込まないように

@yuki-takei yuki-takei merged commit ffe6544 into feat/160341-editor-guide Feb 19, 2026
14 checks passed
@yuki-takei yuki-takei deleted the feat/160341-172821-textstyletab branch February 19, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants