Initial commit: Plane
Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Synced from upstream: 8853637e981ed7d8a6cff32bd98e7afe20f54362
This commit is contained in:
1
apps/web/core/components/settings/mobile/index.ts
Normal file
1
apps/web/core/components/settings/mobile/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./nav";
|
||||
47
apps/web/core/components/settings/mobile/nav.tsx
Normal file
47
apps/web/core/components/settings/mobile/nav.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { useRef } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Menu } from "lucide-react";
|
||||
import { useOutsideClickDetector } from "@plane/hooks";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { ChevronRightIcon } from "@plane/propel/icons";
|
||||
import { useUserSettings } from "@/hooks/store/user";
|
||||
|
||||
type Props = {
|
||||
hamburgerContent: React.ComponentType<{ isMobile: boolean }>;
|
||||
activePath: string;
|
||||
};
|
||||
|
||||
export const SettingsMobileNav = observer((props: Props) => {
|
||||
const { hamburgerContent: HamburgerContent, activePath } = props;
|
||||
// refs
|
||||
const sidebarRef = useRef<HTMLDivElement>(null);
|
||||
// store hooks
|
||||
const { sidebarCollapsed, toggleSidebar } = useUserSettings();
|
||||
const { t } = useTranslation();
|
||||
|
||||
useOutsideClickDetector(sidebarRef, () => {
|
||||
if (!sidebarCollapsed) toggleSidebar(true);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="md:hidden">
|
||||
<div className="border-b border-custom-border-100 py-3 flex items-center gap-4">
|
||||
<div ref={sidebarRef} className="relative w-fit">
|
||||
{!sidebarCollapsed && <HamburgerContent isMobile />}
|
||||
<button
|
||||
type="button"
|
||||
className="z-50 group flex-shrink-0 size-6 grid place-items-center rounded border border-custom-border-200 transition-all bg-custom-background md:hidden"
|
||||
onClick={() => toggleSidebar()}
|
||||
>
|
||||
<Menu className="size-3.5 text-custom-text-200 transition-all group-hover:text-custom-text-100" />
|
||||
</button>
|
||||
</div>
|
||||
{/* path */}
|
||||
<div className="flex items-center gap-2">
|
||||
<ChevronRightIcon className="size-4 text-custom-text-300" />
|
||||
<span className="text-sm font-medium text-custom-text-200">{t(activePath)}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user