fix: 开发者工具按钮仅在开发环境显示

This commit is contained in:
Linkon
2026-01-20 01:16:37 +08:00
parent 70bba94135
commit 5afa02ee52
@@ -96,7 +96,7 @@ export const GlobalSidebar: React.FC = () => {
<div <div
style={{ style={{
height: '100vh', height: '100vh',
width: `${84 * zoom}px`, width: `84px`,
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
justifyContent: 'flex-end', justifyContent: 'flex-end',
@@ -110,8 +110,8 @@ export const GlobalSidebar: React.FC = () => {
className={`global-sidebar-toggle ${!showToggle ? 'hidden' : ''}`} className={`global-sidebar-toggle ${!showToggle ? 'hidden' : ''}`}
style={{ style={{
willChange: 'opacity, transform', willChange: 'opacity, transform',
width: `${24 * zoom}px`, width: `24px`,
height: `${60 * zoom}px` height: `60px`
}} }}
> >
<ChevronLeftIcon /> <ChevronLeftIcon />
@@ -124,9 +124,9 @@ export const GlobalSidebar: React.FC = () => {
backgroundColor: 'var(--ss-card-bg)', backgroundColor: 'var(--ss-card-bg)',
height: 'fit-content', height: 'fit-content',
willChange: 'opacity, transform', willChange: 'opacity, transform',
width: `${60 * zoom}px`, width: `60px`,
padding: `${12 * zoom}px ${8 * zoom}px`, padding: `12px 8px`,
gap: `${12 * zoom}px` gap: `12px`
}} }}
> >
{/* 顶部的关闭/收起按钮 */} {/* 顶部的关闭/收起按钮 */}
@@ -171,6 +171,7 @@ export const GlobalSidebar: React.FC = () => {
</Button> </Button>
</Tooltip> </Tooltip>
{import.meta.env.DEV && (
<Tooltip content="开发者工具" placement="top"> <Tooltip content="开发者工具" placement="top">
<Button <Button
shape="circle" shape="circle"
@@ -180,6 +181,7 @@ export const GlobalSidebar: React.FC = () => {
<CodeIcon size="24px" /> <CodeIcon size="24px" />
</Button> </Button>
</Tooltip> </Tooltip>
)}
</div> </div>
</div> </div>
) )