Skip to content

Commit

Permalink
feat(core): adjust app sidebar (#8572)
Browse files Browse the repository at this point in the history
  • Loading branch information
EYHN committed Oct 22, 2024
1 parent 6a9a7d8 commit b8cb504
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
19 changes: 1 addition & 18 deletions packages/frontend/core/src/modules/app-sidebar/views/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export function AppSidebar({ children }: PropsWithChildren) {
const smallScreenMode = useLiveData(appSidebarService.smallScreenMode$);
const hovering = useLiveData(appSidebarService.hovering$) && open !== true;
const resizing = useLiveData(appSidebarService.resizing$);
const [deferredHovering, setDeferredHovering] = useState(false);
const [initialized, setInitialized] = useState(false);

useEffect(() => {
Expand All @@ -65,29 +64,13 @@ export function AppSidebar({ children }: PropsWithChildren) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
if (open) {
// if open, we don't need to show the floating sidebar
setDeferredHovering(false);
return;
}
// we make a little delay here.
// this allow the sidebar close animation to complete.
const timeout = setTimeout(() => {
setDeferredHovering(hovering);
}, 150);
return () => {
clearTimeout(timeout);
};
}, [hovering, open]);

const sidebarState = smallScreenMode
? open
? 'floating-with-mask'
: 'close'
: open
? 'open'
: deferredHovering
: hovering
? 'floating'
: 'close';

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/i18n/src/i18n-completenesses.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"fr": 77,
"hi": 2,
"it": 1,
"ja": 75,
"ja": 100,
"ko": 91,
"pl": 0,
"pt-BR": 99,
Expand Down

0 comments on commit b8cb504

Please sign in to comment.