Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Close menu after clicking link #112

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib",
"[terraform]": {
Expand Down
9 changes: 6 additions & 3 deletions apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ColorSchemeScript } from "@mantine/core";
import "@mantine/core/styles.css";
import "@mantine/notifications/styles.css";
import type { FC, ReactNode } from "react";
import { Metadata } from "next";
import { ColorSchemeScript } from "@mantine/core";
import dynamic from "next/dynamic";
import type { FC, ReactNode } from "react";
import { Providers } from "../providers/providers";
import Shell from "../components/layout/shell";

export const metadata: Metadata = {
title: {
Expand All @@ -18,6 +18,9 @@ export const metadata: Metadata = {
},
};

const Shell = dynamic(() => import("../components/layout/shell"), {
ssr: false,
});
interface LayoutProps {
children: ReactNode;
}
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/components/layout/shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const Shell: FC<{ children: ReactNode }> = ({ children }) => {
const { isConnected } = useAccount();
const { colorScheme, toggleColorScheme } = useMantineColorScheme();
const themeDefaultProps = theme.components?.AppShell?.defaultProps ?? {};

return (
<AppShell
header={themeDefaultProps.header}
Expand Down Expand Up @@ -137,12 +138,14 @@ const Shell: FC<{ children: ReactNode }> = ({ children }) => {
label="Home"
href="/"
leftSection={<TbHome />}
onClick={toggle}
data-testid="home-link"
/>

<NavLink
component={Link}
label="Applications"
onClick={toggle}
href="/applications"
leftSection={<TbApps />}
data-testid="applications-link"
Expand All @@ -151,6 +154,7 @@ const Shell: FC<{ children: ReactNode }> = ({ children }) => {
<NavLink
component={Link}
label="Inputs"
onClick={toggle}
href="/inputs"
leftSection={<TbInbox />}
data-testid="inputs-link"
Expand All @@ -160,7 +164,6 @@ const Shell: FC<{ children: ReactNode }> = ({ children }) => {
label="Send Transaction"
leftSection={<TbArrowsDownUp />}
disabled={!isConnected}
opened={isConnected && transaction}
onClick={toggleTransaction}
hiddenFrom="sm"
/>
Expand Down
Loading