Skip to content

Commit

Permalink
added missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya authored Jul 31, 2024
1 parent ea90360 commit 199b343
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions web/src/components/EEA_Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
"use client";

import { useContext } from "react";
import { SettingsContext } from "./settings/SettingsProvider";
import Image from "next/image";

export function Logo({
height,
width,
className,
}: {
height?: number;
width?: number;
className?: string;
}) {
const settings = useContext(SettingsContext);

height = height || 32;
width = width || 70;

if (
!settings ||
!settings.enterpriseSettings ||
!settings.enterpriseSettings.use_custom_logo
) {
return (
<div style={{ height, width }} className={className}>
<Image src="/EEA_logo_compact_EN.svg" alt="Logo" width={width} height={height} />
</div>
);
}

return (
<div
style={{ height, width }}
className={`flex-none relative ${className}`}
>
{/* TODO: figure out how to use Next Image here */}
<img
src="/api/enterprise-settings/logo"
alt="Logo"
style={{ objectFit: "contain", height, width }}
/>
</div>
);
}
export function Logo_empty({
height,
width,
className,
}: {
height?: number;
width?: number;
className?: string;
}) {
const settings = useContext(SettingsContext);

height = height || 32;
width = width || 32;
if (
!settings ||
!settings.enterpriseSettings ||
!settings.enterpriseSettings.use_custom_logo
) {
return (
<div style={{ height, width }} className={className}>
</div>
);
}

return (
<div
style={{ height, width }}
className={`flex-none relative ${className}`}
>
{/* TODO: figure out how to use Next Image here */}
<img
src="/api/enterprise-settings/logo"
alt="Logo"
style={{ objectFit: "contain", height, width }}
/>
</div>
);
}

0 comments on commit 199b343

Please sign in to comment.