From bc0eeb546184be88441600b4bbdb0e33b3ea38ff Mon Sep 17 00:00:00 2001 From: Xeltica Date: Thu, 27 Jan 2022 21:12:58 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/views/frontend.pug | 2 +- src/frontend/App.tsx | 2 +- src/frontend/components/AccountsPage.tsx | 48 ++--- src/frontend/components/AnnouncementList.tsx | 2 +- src/frontend/components/MisshaiPage.scss | 17 ++ src/frontend/components/MisshaiPage.tsx | 202 ++++++++++--------- src/frontend/components/NekomimiPage.tsx | 2 - src/frontend/components/SettingPage.tsx | 2 +- src/frontend/langs/ja-JP.json | 9 +- src/frontend/pages/index.session.tsx | 4 +- src/frontend/pages/index.welcome.tsx | 51 ++--- src/frontend/style.scss | 12 +- 12 files changed, 193 insertions(+), 160 deletions(-) create mode 100644 src/frontend/components/MisshaiPage.scss diff --git a/src/backend/views/frontend.pug b/src/backend/views/frontend.pug index f5cac53..78e4247 100644 --- a/src/backend/views/frontend.pug +++ b/src/backend/views/frontend.pug @@ -15,7 +15,7 @@ html meta(name='twitter:site' content='@Xeltica') meta(name='twitter:creator' content='@Xeltica') link(rel="stylesheet" href="https://koruri.chillout.chat/koruri.css") - link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css") + link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css") style. .loading { display: flex; diff --git a/src/frontend/App.tsx b/src/frontend/App.tsx index 59123e1..1be4c30 100644 --- a/src/frontend/App.tsx +++ b/src/frontend/App.tsx @@ -59,7 +59,7 @@ const AppInner : React.VFC = () => { ) : (
- {$location.pathname !== '/' &&
} + {$location.pathname !== '/' &&
} diff --git a/src/frontend/components/AccountsPage.tsx b/src/frontend/components/AccountsPage.tsx index b5fac6e..8b6e371 100644 --- a/src/frontend/components/AccountsPage.tsx +++ b/src/frontend/components/AccountsPage.tsx @@ -30,32 +30,34 @@ export const AccountsPage: React.VFC = () => {
) : ( -
-
- {t('_accounts.switchAccount')} -
-
- { - accounts.length === accountTokens.length ? ( - accounts.map(account => ( - - - )) - ) : ( -
...
- ) - } + )) + ) : ( +
...
+ ) + } +
+ -
); }; diff --git a/src/frontend/components/AnnouncementList.tsx b/src/frontend/components/AnnouncementList.tsx index 6d8909f..c5e4a44 100644 --- a/src/frontend/components/AnnouncementList.tsx +++ b/src/frontend/components/AnnouncementList.tsx @@ -24,7 +24,7 @@ export const AnnouncementList: React.VFC = () => { return ( <> -

{t('announcements')}

+

{t('announcements')}

{announcements.map(a => ( diff --git a/src/frontend/components/MisshaiPage.scss b/src/frontend/components/MisshaiPage.scss new file mode 100644 index 0000000..145e8e9 --- /dev/null +++ b/src/frontend/components/MisshaiPage.scss @@ -0,0 +1,17 @@ +.misshaiPageLayout { + display: flex; + flex-wrap: wrap; + gap: var(--margin); + > .misshaiData { + flex: 1 0 300px; + } + > .misshaiRanking { + flex: 5 0 300px; + } + > .alertModeSetting { + flex: 1 0 300px; + } + > .templateSetting { + flex: 5 0 300px; + } +} \ No newline at end of file diff --git a/src/frontend/components/MisshaiPage.tsx b/src/frontend/components/MisshaiPage.tsx index f72671b..5d8676e 100644 --- a/src/frontend/components/MisshaiPage.tsx +++ b/src/frontend/components/MisshaiPage.tsx @@ -10,10 +10,11 @@ import { $post, $put } from '../misc/api'; import { useGetScoreQuery, useGetSessionQuery } from '../services/session'; import { showModal } from '../store/slices/screen'; import { AnnouncementList } from './AnnouncementList'; -import { Card } from './Card'; import { Ranking } from './Ranking'; import { Skeleton } from './Skeleton'; +import './MisshaiPage.scss'; + const variables = [ 'notesCount', 'followingCount', @@ -174,7 +175,7 @@ export const MisshaiPage: React.VFC = () => { const defaultTemplate = t('_template.default'); - return session.isLoading || score.isLoading ? ( + return session.isLoading || score.isLoading || !session.data || !score.data ? (
@@ -182,23 +183,16 @@ export const MisshaiPage: React.VFC = () => {
) : ( -
- {session.data && ( -
-

{t('welcomeBack', {acct: `@${session.data.username}@${session.data.host}`})}

-

- - {t('_missHai.rating')}{': '} - - {session.data.rating} -

-
- )} - - {score.data && ( - <> -
-

{t('_missHai.data')}

+
+
+
+ +
+
+
+
+
+

{t('_missHai.data')}

@@ -225,88 +219,104 @@ export const MisshaiPage: React.VFC = () => {
-
-
-

{t('_missHai.ranking')}

+

+ + {t('_missHai.rating')}{': '} + + {session.data.rating} +

+
+
+
+
+

{t('_missHai.ranking')}

{limit && } -
-
- -

{t('alertMode')}

-
- { - alertModes.map((mode) => ( - - )) - } -
- - { draft.alertMode === 'notification' && ( -
- - {t('_alertMode.notificationWarning')} -
- )} - { draft.alertMode === 'note' && ( - <> -

{t('visibility')}

-
- { - availableVisibilities.map((visibility) => ( - - )) - } -
-
+ +
+
+
+
+

{t('alertMode')}

+
+ { + alertModes.map((mode) => ( + - - )} - - -

{t('template')}

-

{t('_template.description')}

-
- - + )) + } +
+ { draft.alertMode === 'notification' && ( +
+ + {t('_alertMode.notificationWarning')}
-