mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 08:15:52 +01:00
client/read only note info bar: refactor
This commit is contained in:
19
apps/client/src/widgets/react/InfoBar.css
Normal file
19
apps/client/src/widgets/react/InfoBar.css
Normal file
@@ -0,0 +1,19 @@
|
||||
.info-bar {
|
||||
margin-top: 4px;
|
||||
padding: 8px 20px;
|
||||
color: var(--read-only-note-info-bar-color);
|
||||
font-size: .9em;
|
||||
|
||||
}
|
||||
|
||||
.info-bar-prominent {
|
||||
background: var(--alert-bar-background, var(--accented-background-color));
|
||||
}
|
||||
|
||||
.info-bar-subtle {
|
||||
color: var(--muted-text-color);
|
||||
border-bottom: 1px solid var(--main-border-color);
|
||||
margin-block: 0;
|
||||
margin-inline: 10px;
|
||||
padding-inline: 12px;
|
||||
}
|
||||
18
apps/client/src/widgets/react/InfoBar.tsx
Normal file
18
apps/client/src/widgets/react/InfoBar.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ComponentChildren } from "preact";
|
||||
|
||||
import "./InfoBar.css";
|
||||
|
||||
export type InfoBarParams = {
|
||||
type: "prominent" | "subtle"
|
||||
children: ComponentChildren;
|
||||
};
|
||||
|
||||
export default function InfoBar(props: InfoBarParams) {
|
||||
return <div className={`info-bar info-bar-${props.type}`}>
|
||||
{props?.children}
|
||||
</div>
|
||||
}
|
||||
|
||||
InfoBar.defaultProps = {
|
||||
type: "prominent"
|
||||
} as InfoBarParams
|
||||
Reference in New Issue
Block a user