Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(client): default `InfoBar`'s type without `defaultProps`
Elian Doranfdb6a6d063fe
diff --git a/apps/client/src/widgets/react/InfoBar.tsx b/apps/client/src/widgets/react/InfoBar.tsxindex 084b25ddbf..f1aebbcb51 100644--- a/apps/client/src/widgets/react/InfoBar.tsx+++ b/apps/client/src/widgets/react/InfoBar.tsx@@ -2,18 +2,14 @@ import "./InfoBar.css";import { ComponentChildren, CSSProperties } from "preact";export type InfoBarParams = {- type: "prominent" | "subtle",+ type?: "prominent" | "subtle",className: string;style: CSSPropertieschildren: ComponentChildren;};-export default function InfoBar(props: InfoBarParams) {- return <div className={`info-bar ${props.className} info-bar-${props.type}`} style={props.style}>- {props?.children}+export default function InfoBar({ type = "prominent", className, style, children }: InfoBarParams) {+ return <div className={`info-bar ${className} info-bar-${type}`} style={style}>+ {children}</div>}--InfoBar.defaultProps = {- type: "prominent"-} as InfoBarParams\ No newline at end of file