Skip to content

Commit

Permalink
Merge pull request #19 from samvera/mobile-test-updates
Browse files Browse the repository at this point in the history
Add support for mobile tests
  • Loading branch information
jrgriffiniii authored Jul 29, 2024
2 parents f6d243e + bfb01f6 commit f89986e
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 298 deletions.
16 changes: 8 additions & 8 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ export default defineConfig({
},

/* Test against mobile viewports. */
// {
// name: "Mobile Chrome",
// use: { ...devices["Pixel 5"] },
// },
// {
// name: "Mobile Safari",
// use: { ...devices["iPhone 12"] },
// },
{
name: "Mobile Chrome",
use: { ...devices["Pixel 5"] },
},
{
name: "Mobile Safari",
use: { ...devices["iPhone 12"] },
},

/* Test against branded browsers. */
// {
Expand Down
15 changes: 7 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/app/features/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import BgLayer from "@/components/layout/bg-layer";
import Container from "@/components/layout/container";
import FeatureList from "@/components/features/list";
import Header from "@/components/layout/header";
import Implementations from "@/components/features/implementations";
import MainWrapper from "@/components/layout/main-wrapper";
import { Metadata } from "next";
Expand All @@ -14,7 +13,6 @@ export const metadata: Metadata = {
export default async function FeaturesPage() {
return (
<div className="">
<Header />
<MainWrapper>
<BgLayer>
<PageHeader
Expand Down
2 changes: 0 additions & 2 deletions src/app/getting-started/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import BgLayer from "@/components/layout/bg-layer";
import Container from "@/components/layout/container";
import FaqList from "@/components/faq";
import GettingStartedList from "@/components/getting-started/list";
import Header from "@/components/layout/header";
import HostedSolutions from "@/components/hosted-solutions";
import MainWrapper from "@/components/layout/main-wrapper";
import { Metadata } from "next";
Expand All @@ -15,7 +14,6 @@ export const metadata: Metadata = {
export default function GettingStartedPage() {
return (
<div className="">
<Header />
<BgLayer>
<MainWrapper>
<PageHeader
Expand Down
2 changes: 0 additions & 2 deletions src/app/news/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import BgLayer from "@/components/layout/bg-layer";
import Container from "@/components/layout/container";
import Header from "@/components/layout/header";
import MainWrapper from "@/components/layout/main-wrapper";
import { Metadata } from "next";
import NewsList from "@/components/news/list";
Expand All @@ -14,7 +13,6 @@ export const metadata: Metadata = {
export default function Homepage() {
return (
<div className="">
<Header />
<MainWrapper>
<BgLayer>
<PageHeader
Expand Down
2 changes: 0 additions & 2 deletions src/app/presentations/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import BgLayer from "@/components/layout/bg-layer";
import Container from "@/components/layout/container";
import Header from "@/components/layout/header";
import MainWrapper from "@/components/layout/main-wrapper";
import { Metadata } from "next";
import PageHeader from "@/components/page-header";
Expand All @@ -14,7 +13,6 @@ export const metadata: Metadata = {
export default function PresentationsPage() {
return (
<div className="">
<Header />
<MainWrapper>
<BgLayer>
<PageHeader
Expand Down
17 changes: 13 additions & 4 deletions src/components/layout/header.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"use client";

import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/outline";
import { Dialog, DialogPanel } from "@headlessui/react";
import React, { useEffect } from "react";

import { Dialog } from "@headlessui/react";
import Image from "next/image";
import Link from "next/link";
import React from "react";
import hykuLogo from "../../../public/logo-hyku.png";
import { usePathname } from "next/navigation";
import { useState } from "react";

export type NavItem = {
Expand Down Expand Up @@ -40,6 +41,13 @@ export const navigation: NavItem[] = [

const Header = () => {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const pathname = usePathname();

useEffect(() => {
if (mobileMenuOpen) {
setMobileMenuOpen(false);
}
}, [pathname]);

return (
<header className="absolute inset-x-0 top-0 z-50">
Expand Down Expand Up @@ -94,9 +102,10 @@ const Header = () => {
className="lg:hidden"
open={mobileMenuOpen}
onClose={setMobileMenuOpen}
data-testid="mobile-menu"
>
<div className="fixed inset-0 z-50" />
<Dialog.Panel className="fixed inset-y-0 right-0 z-50 w-full overflow-y-auto bg-background px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10">
<DialogPanel className="fixed inset-y-0 right-0 z-50 w-full overflow-y-auto bg-background px-6 py-6 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10">
<div className="flex items-center justify-between">
<a href="#" className="-m-1.5 p-1.5">
<span className="sr-only">Your Company</span>
Expand Down Expand Up @@ -136,7 +145,7 @@ const Header = () => {
</div>
</div>
</div>
</Dialog.Panel>
</DialogPanel>
</Dialog>
</header>
);
Expand Down
Loading

0 comments on commit f89986e

Please sign in to comment.