feat(ui): add desktop footer, legal custom link and about dialog
This commit is contained in:
1 parent
bc7bdc481e
commit
c181ffea54
12 files changed
+179
-13
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import React from 'react';
|
||||
import { AuthStatus } from '../lib/types';
|
||||
import { APP_VERSION } from '../version';
|
||||
import { LegalLinks } from './LegalLinks';
|
||||
|
||||
interface AppFooterProps {
|
||||
legal?: AuthStatus['legal'];
|
||||
onOpenAbout: () => void;
|
||||
}
|
||||
|
||||
export const AppFooter: React.FC<AppFooterProps> = ({ legal, onOpenAbout }) => {
|
||||
return (
|
||||
<footer className="hidden sm:flex shrink-0 w-full max-w-6xl mx-auto px-4 py-2 items-center justify-between text-[11px] text-faint border-t border-border/40 select-none">
|
||||
<div className="flex items-center gap-3">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onOpenAbout}
|
||||
className="font-semibold text-muted hover:text-main transition-colors cursor-pointer"
|
||||
>
|
||||
MindSift
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onOpenAbout}
|
||||
className="font-mono hover:text-main transition-colors cursor-pointer"
|
||||
title="Über MindSift & Versionsdetails"
|
||||
>
|
||||
{APP_VERSION}
|
||||
</button>
|
||||
<span className="text-border">·</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onOpenAbout}
|
||||
className="hover:text-main transition-colors cursor-pointer underline-offset-2 hover:underline"
|
||||
>
|
||||
Über MindSift
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<LegalLinks legal={legal} className="!text-faint gap-3" />
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
@@ -28,7 +28,9 @@ export const LegalLinks: React.FC<LegalLinksProps> = ({ legal, className = '', c
|
||||
}))
|
||||
.filter((e) => e.url || e.hasContent);
|
||||
|
||||
if (entries.length === 0 && !children) return null;
|
||||
const customHref = legal?.customLinkUrl && safeHref(legal.customLinkUrl);
|
||||
|
||||
if (entries.length === 0 && !children && !customHref) return null;
|
||||
|
||||
const openText = async (type: LegalType) => {
|
||||
setError(null);
|
||||
@@ -52,6 +54,16 @@ export const LegalLinks: React.FC<LegalLinksProps> = ({ legal, className = '', c
|
||||
</button>
|
||||
)
|
||||
)}
|
||||
{customHref && (
|
||||
<a
|
||||
href={customHref as string}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="hover:text-main underline-offset-2 hover:underline"
|
||||
>
|
||||
{legal?.customLinkLabel || legal?.customLinkUrl}
|
||||
</a>
|
||||
)}
|
||||
{children}
|
||||
{error && <span className="text-status-err">{error}</span>}
|
||||
{open && (
|
||||
|
||||
Reference in new issue
Block a user