mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 12:51:26 +08:00
feat: add smooth transition animation to narrow mode toggle (#8740)
This commit is contained in:
parent
a789a59ad8
commit
b7394c98a4
@ -9,22 +9,23 @@ interface Props extends HTMLAttributes<HTMLDivElement> {
|
||||
const NarrowLayout: FC<Props> = ({ children, ...props }) => {
|
||||
const { narrowMode } = useSettings()
|
||||
|
||||
if (narrowMode) {
|
||||
return (
|
||||
<Container className="narrow-mode" {...props}>
|
||||
{children}
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
|
||||
return children
|
||||
return (
|
||||
<Container className={`narrow-mode ${narrowMode ? 'active' : ''}`} {...props}>
|
||||
{children}
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
|
||||
const Container = styled.div`
|
||||
max-width: 800px;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
transition: max-width 0.3s ease-in-out;
|
||||
|
||||
&.active {
|
||||
max-width: 800px;
|
||||
}
|
||||
`
|
||||
|
||||
export default NarrowLayout
|
||||
|
||||
Loading…
Reference in New Issue
Block a user