From dc6a53e38c6e4ce41c3e9490ad5fc4ea3d410369 Mon Sep 17 00:00:00 2001 From: xeltica Date: Thu, 9 Sep 2021 12:58:57 +0900 Subject: [PATCH] wip --- src/frontend/components/Card.tsx | 16 +++ src/frontend/components/SettingPage.tsx | 153 +++++++++++++++++------- src/frontend/misc/theme.ts | 3 + src/frontend/style.scss | 12 ++ 4 files changed, 140 insertions(+), 44 deletions(-) create mode 100644 src/frontend/components/Card.tsx create mode 100644 src/frontend/misc/theme.ts diff --git a/src/frontend/components/Card.tsx b/src/frontend/components/Card.tsx new file mode 100644 index 0000000..8d5b87b --- /dev/null +++ b/src/frontend/components/Card.tsx @@ -0,0 +1,16 @@ +import React from 'react'; + +export type CardProps = { + className?: string; + bodyClassName?: string; +}; + +export const Card: React.FC = ({children, className, bodyClassName}) => { + return ( +
+
+ {children} +
+
+ ); +}; diff --git a/src/frontend/components/SettingPage.tsx b/src/frontend/components/SettingPage.tsx index b3104f3..872fa0d 100644 --- a/src/frontend/components/SettingPage.tsx +++ b/src/frontend/components/SettingPage.tsx @@ -1,9 +1,11 @@ -import React, { useEffect, useMemo, useReducer } from 'react'; +import React, { useEffect, useMemo, useReducer, useState } from 'react'; import { AlertMode } from '../../common/types/alert-mode'; import { IUser } from '../../common/types/user'; import { Visibility } from '../../common/types/visibility'; import { useGetSessionQuery } from '../services/session'; import { defaultTemplate } from '../../common/default-template'; +import { Card } from './Card'; +import { Theme } from '../misc/theme'; type SettingDraftType = Pick { template: data?.template ?? null, }); + const themes: Array<{ theme: Theme, name: string }> = [ + { + theme: 'light', + name: 'ライトテーマ' + }, + { + theme: 'dark', + name: 'ダークテーマ' + }, + { + theme: 'system', + name: 'システム設定に準じる' + }, + ]; + + const [currentTheme, setCurrentTheme] = useState('light'); + const [currentLang, setCurrentLang] = useState('ja-JP'); + useEffect(() => { if (data) { dispatchDraft({ @@ -52,53 +72,98 @@ export const SettingPage: React.VFC = () => {
) : (
-
-
-

スコア通知方法

-
- - {draft.alertMode === 'notification' && ( -
- - 「Misskey に通知」オプションは古いMisskeyでは動作しません。 -
- )} -
- { draft.alertMode === 'note' && ( -
- - - + +

スコア通知方法

+
+ + {draft.alertMode === 'notification' && ( +
+ + 「Misskey に通知」オプションは古いMisskeyでは動作しません。
)} - {saveButton}
-
-
-
-

テンプレート

-