From 7988289db6d33a4fee661937221f72582e306206 Mon Sep 17 00:00:00 2001 From: chenjunyu19 <1335546814@qq.com> Date: Sat, 30 Jul 2022 18:14:53 +0800 Subject: [PATCH] chore: move constexpr out of FC --- GZCTF/ClientApp/src/pages/About.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GZCTF/ClientApp/src/pages/About.tsx b/GZCTF/ClientApp/src/pages/About.tsx index 8cf45a0c0..5e52f7116 100644 --- a/GZCTF/ClientApp/src/pages/About.tsx +++ b/GZCTF/ClientApp/src/pages/About.tsx @@ -4,7 +4,11 @@ import LogoHeader from '../components/LogoHeader' import WithNavBar from '../components/WithNavbar' import MainIcon from '../components/icon/MainIcon' -const MODULE_LOAD_DATE = new Date() +const sha = import.meta.env.VITE_APP_GIT_SHA ?? '000000' +const tag = import.meta.env.VITE_APP_GIT_NAME ?? 'develop' +const timestamp = import.meta.env.VITE_APP_BUILD_TIMESTAMP ?? '2022-07-23T12:00:00+08:00' +const builtdate = import.meta.env.DEV ? new Date() : new Date(timestamp) + const dateTimeFormat = new Intl.DateTimeFormat(undefined, { dateStyle: 'long', timeStyle: 'long' }) const useStyles = createStyles((theme) => ({ @@ -14,10 +18,6 @@ const useStyles = createStyles((theme) => ({ })) const About: FC = () => { - const sha = import.meta.env.VITE_APP_GIT_SHA ?? '000000' - const tag = import.meta.env.VITE_APP_GIT_NAME ?? 'develop' - const timestamp = import.meta.env.VITE_APP_BUILD_TIMESTAMP ?? '2022-07-23T12:00:00+08:00' - const builtdate = import.meta.env.DEV ? MODULE_LOAD_DATE : new Date(timestamp) const { classes } = useStyles() return (