部分公共组件配置化

This commit is contained in:
tangly1024.com
2023-11-08 19:05:35 +08:00
parent f96aa2242f
commit b2759c6d5e
34 changed files with 301 additions and 239 deletions

View File

@@ -1,8 +1,8 @@
import React from 'react'
import React, { createRef } from 'react'
import { init } from '@waline/client'
import BLOG from '@/blog.config'
import { useRouter } from 'next/router'
import '@waline/client/dist/waline.css'
import { siteConfig } from '@/lib/config'
const path = ''
let waline = null
@@ -12,7 +12,7 @@ let waline = null
* @returns
*/
const WalineComponent = (props) => {
const containerRef = React.createRef()
const containerRef = createRef()
const router = useRouter()
const updateWaline = url => {
@@ -26,8 +26,8 @@ const WalineComponent = (props) => {
waline = init({
...props,
el: containerRef.current,
serverURL: BLOG.COMMENT_WALINE_SERVER_URL,
lang: BLOG.lang,
serverURL: siteConfig('COMMENT_WALINE_SERVER_URL'),
lang: siteConfig('LANG'),
reaction: true,
dark: 'html.dark',
emoji: [