mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-23 10:00:08 +08:00
refactor: update styles and improve navbar handling
- Removed unnecessary margin-bottom style from bubble markdown. - Adjusted margin in Prompt component for better layout. - Enhanced useAppInit hook to include navbar position logic for background styling. - Added alignment to ErrorBlock alert for improved visual consistency.
This commit is contained in:
parent
7217a7216e
commit
c1d8bf38ef
@ -165,9 +165,6 @@ ul {
|
|||||||
}
|
}
|
||||||
.markdown {
|
.markdown {
|
||||||
display: flow-root;
|
display: flow-root;
|
||||||
*:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import { useEffect } from 'react'
|
|||||||
import { useDefaultModel } from './useAssistant'
|
import { useDefaultModel } from './useAssistant'
|
||||||
import useFullScreenNotice from './useFullScreenNotice'
|
import useFullScreenNotice from './useFullScreenNotice'
|
||||||
import { useRuntime } from './useRuntime'
|
import { useRuntime } from './useRuntime'
|
||||||
import { useSettings } from './useSettings'
|
import { useNavbarPosition, useSettings } from './useSettings'
|
||||||
import useUpdateHandler from './useUpdateHandler'
|
import useUpdateHandler from './useUpdateHandler'
|
||||||
|
|
||||||
const logger = loggerService.withContext('useAppInit')
|
const logger = loggerService.withContext('useAppInit')
|
||||||
@ -37,6 +37,7 @@ export function useAppInit() {
|
|||||||
customCss,
|
customCss,
|
||||||
enableDataCollection
|
enableDataCollection
|
||||||
} = useSettings()
|
} = useSettings()
|
||||||
|
const { isLeftNavbar } = useNavbarPosition()
|
||||||
const { minappShow } = useRuntime()
|
const { minappShow } = useRuntime()
|
||||||
const { setDefaultModel, setQuickModel, setTranslateModel } = useDefaultModel()
|
const { setDefaultModel, setQuickModel, setTranslateModel } = useDefaultModel()
|
||||||
const avatar = useLiveQuery(() => db.settings.get('image://avatar'))
|
const avatar = useLiveQuery(() => db.settings.get('image://avatar'))
|
||||||
@ -100,16 +101,15 @@ export function useAppInit() {
|
|||||||
}, [language])
|
}, [language])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const transparentWindow = windowStyle === 'transparent' && isMac && !minappShow
|
const isMacTransparentWindow = windowStyle === 'transparent' && isMac
|
||||||
|
|
||||||
if (minappShow) {
|
if (minappShow && isLeftNavbar) {
|
||||||
window.root.style.background =
|
window.root.style.background = isMacTransparentWindow ? 'var(--color-background)' : 'var(--navbar-background)'
|
||||||
windowStyle === 'transparent' && isMac ? 'var(--color-background)' : 'var(--navbar-background)'
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
window.root.style.background = transparentWindow ? 'var(--navbar-background-mac)' : 'var(--navbar-background)'
|
window.root.style.background = isMacTransparentWindow ? 'var(--navbar-background-mac)' : 'var(--navbar-background)'
|
||||||
}, [windowStyle, minappShow, theme])
|
}, [windowStyle, minappShow, theme, isLeftNavbar])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isLocalAi) {
|
if (isLocalAi) {
|
||||||
|
|||||||
@ -89,6 +89,7 @@ const Alert = styled(AntdAlert)`
|
|||||||
margin: 0.5rem 0 !important;
|
margin: 0.5rem 0 !important;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
align-items: center;
|
||||||
& .ant-alert-close-icon {
|
& .ant-alert-close-icon {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ const Container = styled.div<{ $isDark: boolean }>`
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 0.5px solid var(--color-border);
|
border: 0.5px solid var(--color-border);
|
||||||
margin: 15px 24px;
|
margin: 15px 20px;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user