feat(teacher-portal): 完整实现 teacher-portal 微前端
包含 settings/students/api、graphql、mocks、ui-tokens 设计令牌等
This commit is contained in:
@@ -1,14 +1,40 @@
|
||||
import './globals.css';
|
||||
import type { Metadata } from 'next';
|
||||
import { Inter, Fraunces, JetBrains_Mono } from 'next/font/google';
|
||||
import "./globals.css";
|
||||
import type { Metadata } from "next";
|
||||
import { Inter, Fraunces, JetBrains_Mono } from "next/font/google";
|
||||
import { GraphQLProvider } from "./providers";
|
||||
import { ErrorBoundary } from "@edu/ui-components";
|
||||
|
||||
const inter = Inter({ subsets: ['latin'], variable: '--font-inter' });
|
||||
const fraunces = Fraunces({ subsets: ['latin'], variable: '--font-fraunces' });
|
||||
const mono = JetBrains_Mono({ subsets: ['latin'], variable: '--font-mono' });
|
||||
/**
|
||||
* 字体加载(next/font/google self-host)
|
||||
*
|
||||
* 通过 CSS 变量暴露字体族,业务代码用 var(--font-family-sans/serif/mono)
|
||||
* 禁止字体名字面量(project_rules §3.10)
|
||||
*
|
||||
* 03-long-term-architecture.md §3.5 字体加载策略:
|
||||
* - font-display: swap(FOUT,优先文本可见性)
|
||||
* - 首屏字体 preload,次屏 lazy
|
||||
*/
|
||||
const inter = Inter({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-inter",
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
const fraunces = Fraunces({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-fraunces",
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
const mono = JetBrains_Mono({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-jetbrains-mono",
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Edu Teacher Portal',
|
||||
description: 'K12 智慧教务平台 - 教师端',
|
||||
title: "Edu Teacher Portal",
|
||||
description: "K12 智慧教务平台 - 教师端",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
@@ -17,8 +43,15 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<html lang="zh-CN" className={`${inter.variable} ${fraunces.variable} ${mono.variable}`}>
|
||||
<body>{children}</body>
|
||||
<html
|
||||
lang="zh-CN"
|
||||
className={`${inter.variable} ${fraunces.variable} ${mono.variable}`}
|
||||
>
|
||||
<body>
|
||||
<ErrorBoundary>
|
||||
<GraphQLProvider>{children}</GraphQLProvider>
|
||||
</ErrorBoundary>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user