Skip to content

Commit

Permalink
feat: edge config
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Jul 8, 2023
1 parent 52cd236 commit 60417b6
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 111 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@tanstack/react-query-persist-client": "4.29.19",
"@upstash/redis": "1.22.0",
"@vercel/analytics": "1.0.1",
"@vercel/edge-config": "0.2.1",
"axios": "1.4.0",
"clsx": "1.2.1",
"daisyui": "3.1.10",
Expand Down
104 changes: 36 additions & 68 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 37 additions & 28 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ToastContainer } from 'react-toastify'
import type { AggregateRoot } from '@mx-space/api-client'

import { ClerkProvider } from '@clerk/nextjs'
import { get } from '@vercel/edge-config'

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

aggregationData = data

console.log('geet', await get('greeting'))

return (
// <ClerkProvider localization={ClerkZhCN}>
<ClerkProvider>
<html lang="zh-CN" className="noise" suppressHydrationWarning>
<head>
<script
dangerouslySetInnerHTML={{
__html: `var version = "${version}";
${function info() {
console.log(
`%c Mix Space %c https://github.com/mx-space `,
'color: #fff; margin: 1em 0; padding: 5px 0; background: #2980b9;',
'margin: 1em 0; padding: 5px 0; background: #efefef;',
)
console.log(
`%c Shiro ${version} %c https://innei.ren `,
'color: #fff; margin: 1em 0; padding: 5px 0; background: #39C5BB;',
'margin: 1em 0; padding: 5px 0; background: #efefef;',
)
const motto = `
This Personal Space Powered By Mix Space.
Written by TypeScript, Coding with Love.
--------
Stay hungry. Stay foolish. --Steve Jobs
`
if (document.firstChild?.nodeType !== Node.COMMENT_NODE) {
document.prepend(document.createComment(motto))
}
}.toString()}; info()`,
}}
/>
<SayHi />
</head>
<body
className={`${sansFont.variable} ${serifFont.variable} m-0 h-full p-0 font-sans`}
Expand All @@ -154,3 +130,36 @@ Stay hungry. Stay foolish. --Steve Jobs
</ClerkProvider>
)
}

const SayHi = () => {
return (
<script
dangerouslySetInnerHTML={{
__html: `var version = "${version}";
${function info() {
console.log(
`%c Mix Space %c https://github.com/mx-space `,
'color: #fff; margin: 1em 0; padding: 5px 0; background: #2980b9;',
'margin: 1em 0; padding: 5px 0; background: #efefef;',
)
console.log(
`%c Shiro ${version} %c https://innei.ren `,
'color: #fff; margin: 1em 0; padding: 5px 0; background: #39C5BB;',
'margin: 1em 0; padding: 5px 0; background: #efefef;',
)
const motto = `
This Personal Space Powered By Mix Space.
Written by TypeScript, Coding with Love.
--------
Stay hungry. Stay foolish. --Steve Jobs
`
if (document.firstChild?.nodeType !== Node.COMMENT_NODE) {
document.prepend(document.createComment(motto))
}
}.toString()}; info()`,
}}
/>
)
}
Loading

1 comment on commit 60417b6

@vercel
Copy link

@vercel vercel bot commented on 60417b6 Jul 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-innei.vercel.app
innei.in
shiro-git-main-innei.vercel.app
springtide.vercel.app

Please sign in to comment.