Skip to content

Commit 7c52d4d

Browse files
author
Julian Roeland
committed
👌 - fix: pr fixes
1 parent a4c980b commit 7c52d4d

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

frontend/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
import { useAsync } from "react-use";
3030

3131
import "./App.css";
32-
import { Logo, LogoDropdown } from "./components/Logo";
32+
import { Logo } from "./components/Logo";
3333
import {
3434
OidcConfigContext,
3535
OidcConfigContextType,
@@ -106,7 +106,7 @@ function App() {
106106
value={{
107107
breadcrumbItems,
108108
primaryNavigationItems: [
109-
<LogoDropdown key="logo" width={32} />,
109+
<Logo key="logo" withDialog width={32} />,
110110
{
111111
children: <Solid.HomeIcon />,
112112
title: "Home",

frontend/src/components/Logo/Logo.tsx

+24-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1-
import { Body, Card, Dropdown, H3, Hr } from "@maykin-ui/admin-ui";
1+
import { Button, Card, H3, Hr, useDialog } from "@maykin-ui/admin-ui";
2+
import { useCallback } from "react";
23

34
export type LogoProps = {
45
width?: number;
6+
withDialog?: boolean;
57
};
68

7-
export function Logo({ width }: LogoProps) {
9+
function LogoImage({ width }: { width: number }) {
810
return <img src="/logo.svg" alt="Open Archiefbeheer Logo" width={width} />;
911
}
1012

11-
export function LogoDropdown({ width = 128 }: LogoProps) {
12-
return (
13-
<Dropdown
14-
aria-label="Versie"
15-
label={<Logo width={width} />}
16-
pad="v"
17-
variant="transparent"
18-
placement="right"
19-
activateOnHover={false}
20-
>
21-
<Body>
22-
<Card>
23-
<Logo width={128} />
24-
<H3>Versies</H3>
25-
<Hr />
26-
{/* TODO: Version info */}
27-
</Card>
28-
</Body>
29-
</Dropdown>
13+
export function Logo({ width = 128, withDialog = false }: LogoProps) {
14+
const dialog = useDialog();
15+
16+
const onClick = useCallback(() => {
17+
dialog(
18+
"Versie",
19+
<Card>
20+
<LogoImage width={128} />
21+
<H3>Versie</H3>
22+
<Hr />
23+
</Card>,
24+
);
25+
}, [dialog]);
26+
27+
return withDialog ? (
28+
<Button variant="transparent" onClick={onClick} pad={false}>
29+
<LogoImage width={width} />
30+
</Button>
31+
) : (
32+
<LogoImage width={width} />
3033
);
3134
}

0 commit comments

Comments
 (0)