mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 21:05:55 +01:00
feat(react/ribbon): port edited notes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createContext, render, type JSX, type RefObject } from "preact";
|
||||
import { ComponentChild, createContext, render, type JSX, type RefObject } from "preact";
|
||||
import Component from "../../components/component";
|
||||
|
||||
export const ParentComponent = createContext<Component | null>(null);
|
||||
@@ -39,4 +39,9 @@ export function renderReactWidgetAtElement(parentComponent: Component, el: JSX.E
|
||||
|
||||
export function disposeReactWidget(container: Element) {
|
||||
render(null, container);
|
||||
}
|
||||
|
||||
export function separateByCommas(components: ComponentChild[]) {
|
||||
return components.reduce<any>((acc, item) =>
|
||||
(acc.length ? [...acc, ", ", item] : [item]), []);
|
||||
}
|
||||
Reference in New Issue
Block a user