Skip to content

Build your personal knowledge base with Trilium Notes

client/shared note info bar: improve appearance

Adorian Doran50869d29dbab
diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.css
index 75c8590090..880e85f70f 100644
--- a/apps/client/src/stylesheets/theme-next/shell.css
+++ b/apps/client/src/stylesheets/theme-next/shell.css
@@ -1328,14 +1328,6 @@ body.mobile .note-title {
border-bottom: 2px solid #0000001c !important;
}
-/*
- * Read-only note info bar
- */
-
-.read-only-note-info-bar-widget {
- --link-color: var(--main-text-color);
-}
-
/*
* Promoted attributes
*/
diff --git a/apps/client/src/widgets/react/InfoBar.css b/apps/client/src/widgets/react/InfoBar.css
index 200b1de139..ec69f466cb 100644
--- a/apps/client/src/widgets/react/InfoBar.css
+++ b/apps/client/src/widgets/react/InfoBar.css
@@ -1,10 +1,11 @@
.info-bar {
+ --link-color: var(--main-text-color);
+
margin-top: 4px;
contain: unset !important;
padding: 8px 20px;
color: var(--read-only-note-info-bar-color);
font-size: .9em;
-
}
.info-bar-prominent {
diff --git a/apps/client/src/widgets/react/InfoBar.tsx b/apps/client/src/widgets/react/InfoBar.tsx
index 52435ab48f..084b25ddbf 100644
--- a/apps/client/src/widgets/react/InfoBar.tsx
+++ b/apps/client/src/widgets/react/InfoBar.tsx
@@ -1,15 +1,15 @@
-import { ComponentChildren } from "preact";
-
import "./InfoBar.css";
+import { ComponentChildren, CSSProperties } from "preact";
export type InfoBarParams = {
type: "prominent" | "subtle",
className: string;
+ style: CSSProperties
children: ComponentChildren;
};
export default function InfoBar(props: InfoBarParams) {
- return <div className={`info-bar ${props.className} info-bar-${props.type}`}>
+ return <div className={`info-bar ${props.className} info-bar-${props.type}`} style={props.style}>
{props?.children}
</div>
}
diff --git a/apps/client/src/widgets/shared_info.tsx b/apps/client/src/widgets/shared_info.tsx
index fad905ddc9..d3665478aa 100644
--- a/apps/client/src/widgets/shared_info.tsx
+++ b/apps/client/src/widgets/shared_info.tsx
@@ -49,7 +49,7 @@ export default function SharedInfo() {
});
return (
- <InfoBar className="shared-info-widget" type="subtle">
+ <InfoBar className="shared-info-widget" type="subtle" style={{display: (!link) ? "none" : undefined}}>
{link && (
<RawHtml html={syncServerHost
? t("shared_info.shared_publicly", { link })