From 7e87a4823eac6025043c0a250939ad329197ad89 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 26 Apr 2024 08:59:44 +0800 Subject: [PATCH] feat: add layout and use sn pro font --- lib/views/error.tsx | 24 +-------------------- lib/views/index.tsx | 30 ++++---------------------- lib/views/layout.tsx | 50 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 49 deletions(-) create mode 100644 lib/views/layout.tsx diff --git a/lib/views/error.tsx b/lib/views/error.tsx index cc63e064da545e..50e724b8f50e43 100644 --- a/lib/views/error.tsx +++ b/lib/views/error.tsx @@ -1,30 +1,8 @@ import type { FC } from 'hono/jsx'; +import { Layout } from '@/views/layout'; import { gitHash, gitDate } from '@/utils/git-hash'; -const Layout: FC = (props) => ( - - - Welcome to RSSHub! - - - - {props.children} - -); - const Index: FC<{ requestPath: string; message: string; diff --git a/lib/views/index.tsx b/lib/views/index.tsx index 03850b6a8c9c73..cc5394000c06e9 100644 --- a/lib/views/index.tsx +++ b/lib/views/index.tsx @@ -1,34 +1,12 @@ import type { FC } from 'hono/jsx'; +import { Layout } from '@/views/layout'; import { config } from '@/config'; import { gitHash, gitDate } from '@/utils/git-hash'; import { getDebugInfo } from '@/utils/debug-info'; const startTime = Date.now(); -const Layout: FC = (props) => ( - - - Welcome to RSSHub! - - - - {props.children} - -); - const Index: FC<{ debugQuery: string | undefined }> = ({ debugQuery }) => { const debug = getDebugInfo(); @@ -166,13 +144,13 @@ const Index: FC<{ debugQuery: string | undefined }> = ({ debugQuery }) => {

Everything is RSSible

- + - + - +
{info.showDebug ? ( diff --git a/lib/views/layout.tsx b/lib/views/layout.tsx new file mode 100644 index 00000000000000..f988bda2d40b10 --- /dev/null +++ b/lib/views/layout.tsx @@ -0,0 +1,50 @@ +import type { FC } from 'hono/jsx'; + +export const Layout: FC = (props) => ( + + + Welcome to RSSHub! + + + + {props.children} + +);