mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-11 22:32:17 +00:00
loginname as starting point
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { test } from "@playwright/test";
|
||||
|
||||
test("username and password", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.goto("/loginname");
|
||||
const loginname = page.getByLabel("Loginname");
|
||||
await loginname.pressSequentially("zitadel-admin@zitadel.localhost");
|
||||
await loginname.press("Enter");
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/solid";
|
||||
import { clsx } from "clsx";
|
||||
import {
|
||||
createContext,
|
||||
Dispatch,
|
||||
ReactNode,
|
||||
SetStateAction,
|
||||
useContext,
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
const MobileNavContext = createContext<
|
||||
[boolean, Dispatch<SetStateAction<boolean>>] | undefined
|
||||
>(undefined);
|
||||
|
||||
export function MobileNavContextProvider({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
return (
|
||||
<MobileNavContext.Provider value={[isOpen, setIsOpen]}>
|
||||
{children}
|
||||
</MobileNavContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useMobileNavToggle() {
|
||||
const context = useContext(MobileNavContext);
|
||||
if (context === undefined) {
|
||||
throw new Error(
|
||||
"useMobileNavToggle must be used within a MobileNavContextProvider",
|
||||
);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
export function MobileNavToggle({ children }: { children: ReactNode }) {
|
||||
const [isOpen, setIsOpen] = useMobileNavToggle();
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
className="group absolute right-0 top-0 flex h-14 items-center space-x-2 px-4 lg:hidden"
|
||||
onClick={() => setIsOpen(!isOpen)}
|
||||
>
|
||||
<div className="font-medium text-text-light-secondary-500 dark:text-text-dark-secondary-500 group-hover:text-text-light-500 dark:group-hover:text-text-dark-500">
|
||||
Menu
|
||||
</div>
|
||||
{isOpen ? (
|
||||
<XMarkIcon className="block w-6" />
|
||||
) : (
|
||||
<Bars3Icon className="block w-6" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
<div
|
||||
className={clsx("overflow-y-auto lg:static lg:block", {
|
||||
"fixed inset-x-0 bottom-0 top-14 bg-gray-900": isOpen,
|
||||
hidden: !isOpen,
|
||||
})}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user