2023-03-13 16:27:45 +00:00
|
|
|
import { Analytics } from "@vercel/analytics/react";
|
2023-04-02 13:56:34 +00:00
|
|
|
|
2023-03-26 12:29:02 +00:00
|
|
|
import { Home } from "./components/home";
|
2023-04-10 17:21:34 +00:00
|
|
|
import { getServerSideConfig } from "./config/server";
|
|
|
|
import { RUNTIME_CONFIG_DOM } from "./constant";
|
|
|
|
|
|
|
|
const serverConfig = getServerSideConfig();
|
|
|
|
|
|
|
|
// Danger! Don not write any secret value here!
|
|
|
|
// 警告!不要在这里写入任何敏感信息!
|
|
|
|
const DANGER_CONFIG = {
|
|
|
|
needCode: serverConfig?.needCode,
|
|
|
|
};
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
type DangerConfig = typeof DANGER_CONFIG;
|
|
|
|
}
|
2023-03-07 15:23:54 +00:00
|
|
|
|
2023-03-09 17:01:40 +00:00
|
|
|
export default function App() {
|
2023-03-13 16:27:45 +00:00
|
|
|
return (
|
|
|
|
<>
|
2023-04-10 17:21:34 +00:00
|
|
|
<div style={{ display: "none" }} id={RUNTIME_CONFIG_DOM}>
|
|
|
|
{JSON.stringify(DANGER_CONFIG)}
|
|
|
|
</div>
|
2023-03-13 16:27:45 +00:00
|
|
|
<Home />
|
2023-04-10 17:21:34 +00:00
|
|
|
{serverConfig?.isVercel && <Analytics />}
|
2023-03-13 16:27:45 +00:00
|
|
|
</>
|
|
|
|
);
|
2023-03-07 15:23:54 +00:00
|
|
|
}
|