Skip to content

Commit 60417b6

Browse files
committed
feat: edge config
Signed-off-by: Innei <[email protected]>
1 parent 52cd236 commit 60417b6

File tree

7 files changed

+148
-111
lines changed

7 files changed

+148
-111
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@tanstack/react-query-persist-client": "4.29.19",
5050
"@upstash/redis": "1.22.0",
5151
"@vercel/analytics": "1.0.1",
52+
"@vercel/edge-config": "0.2.1",
5253
"axios": "1.4.0",
5354
"clsx": "1.2.1",
5455
"daisyui": "3.1.10",

pnpm-lock.yaml

+36-68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/layout.tsx

+37-28
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ToastContainer } from 'react-toastify'
55
import type { AggregateRoot } from '@mx-space/api-client'
66

77
import { ClerkProvider } from '@clerk/nextjs'
8+
import { get } from '@vercel/edge-config'
89

910
import PKG from '~/../package.json'
1011
import { appConfig } from '~/app.config'
@@ -102,39 +103,14 @@ export default async function RootLayout(props: Props) {
102103

103104
aggregationData = data
104105

106+
console.log('geet', await get('greeting'))
107+
105108
return (
106109
// <ClerkProvider localization={ClerkZhCN}>
107110
<ClerkProvider>
108111
<html lang="zh-CN" className="noise" suppressHydrationWarning>
109112
<head>
110-
<script
111-
dangerouslySetInnerHTML={{
112-
__html: `var version = "${version}";
113-
${function info() {
114-
console.log(
115-
`%c Mix Space %c https://github.com/mx-space `,
116-
'color: #fff; margin: 1em 0; padding: 5px 0; background: #2980b9;',
117-
'margin: 1em 0; padding: 5px 0; background: #efefef;',
118-
)
119-
console.log(
120-
`%c Shiro ${version} %c https://innei.ren `,
121-
'color: #fff; margin: 1em 0; padding: 5px 0; background: #39C5BB;',
122-
'margin: 1em 0; padding: 5px 0; background: #efefef;',
123-
)
124-
125-
const motto = `
126-
This Personal Space Powered By Mix Space.
127-
Written by TypeScript, Coding with Love.
128-
--------
129-
Stay hungry. Stay foolish. --Steve Jobs
130-
`
131-
132-
if (document.firstChild?.nodeType !== Node.COMMENT_NODE) {
133-
document.prepend(document.createComment(motto))
134-
}
135-
}.toString()}; info()`,
136-
}}
137-
/>
113+
<SayHi />
138114
</head>
139115
<body
140116
className={`${sansFont.variable} ${serifFont.variable} m-0 h-full p-0 font-sans`}
@@ -154,3 +130,36 @@ Stay hungry. Stay foolish. --Steve Jobs
154130
</ClerkProvider>
155131
)
156132
}
133+
134+
const SayHi = () => {
135+
return (
136+
<script
137+
dangerouslySetInnerHTML={{
138+
__html: `var version = "${version}";
139+
${function info() {
140+
console.log(
141+
`%c Mix Space %c https://github.com/mx-space `,
142+
'color: #fff; margin: 1em 0; padding: 5px 0; background: #2980b9;',
143+
'margin: 1em 0; padding: 5px 0; background: #efefef;',
144+
)
145+
console.log(
146+
`%c Shiro ${version} %c https://innei.ren `,
147+
'color: #fff; margin: 1em 0; padding: 5px 0; background: #39C5BB;',
148+
'margin: 1em 0; padding: 5px 0; background: #efefef;',
149+
)
150+
151+
const motto = `
152+
This Personal Space Powered By Mix Space.
153+
Written by TypeScript, Coding with Love.
154+
--------
155+
Stay hungry. Stay foolish. --Steve Jobs
156+
`
157+
158+
if (document.firstChild?.nodeType !== Node.COMMENT_NODE) {
159+
document.prepend(document.createComment(motto))
160+
}
161+
}.toString()}; info()`,
162+
}}
163+
/>
164+
)
165+
}

0 commit comments

Comments
 (0)