From 2b70058f70f590b05b5de9cad2c5b2db37f97b9a Mon Sep 17 00:00:00 2001 From: Bhwa233 <404174262@qq.com> Date: Sat, 16 Mar 2024 11:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=98=E5=8F=A0=E6=8C=89=E9=92=AE=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=8F=B3=E8=BE=B9=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/fukasawa/components/AsideLeft.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/themes/fukasawa/components/AsideLeft.js b/themes/fukasawa/components/AsideLeft.js index 0c8aa27d..984385cf 100644 --- a/themes/fukasawa/components/AsideLeft.js +++ b/themes/fukasawa/components/AsideLeft.js @@ -14,7 +14,7 @@ import { AdSlot } from '@/components/GoogleAdsense' import { siteConfig } from '@/lib/config' import MailChimpForm from './MailChimpForm' import { useGlobal } from '@/lib/global' -import { useEffect, useState } from 'react' +import { useEffect, useMemo, useState } from 'react' import { isBrowser } from '@/lib/utils' import { debounce } from 'lodash' @@ -75,14 +75,30 @@ function AsideLeft(props) { } } }, []) - + const position = useMemo(()=>{ + const isReverse = JSON.parse(siteConfig('LAYOUT_SIDEBAR_REVERSE')) + if(isCollapsed){ + if(isReverse){ + return 'right-2' + }else{ + return 'left-2' + } + }else{ + if(isReverse){ + return 'right-80' + }else{ + return 'left-80' + } + } + },[isCollapsed] ) + return