* refactor: menuRow directive to MenuRow component * refactor: migrate footer to react * refactor: migrate actions menu to react * refactor: migrate history menu to react * fix: click outside handler use capture to trigger event before re-render occurs which would otherwise cause node.contains to return incorrect result (specifically for the account menu) * refactor: migrate revision preview modal to react * refactor: migrate permissions modal to react * refactor: migrate password wizard to react * refactor: remove unused input modal directive * refactor: remove unused delay hide component * refactor: remove unused filechange directive * refactor: remove unused elemReady directive * refactor: remove unused sn-enter directive * refactor: remove unused lowercase directive * refactor: remove unused autofocus directive * refactor(wip): note view to react * refactor: use mutation observer to deinit textarea listeners * refactor: migrate challenge modal to react * refactor: migrate note group view to react * refactor(wip): migrate remaining classes * fix: navigation parent ref * refactor: fully remove angular assets * fix: account switcher * fix: application view state * refactor: remove unused password wizard type * fix: revision preview and permissions modal * fix: remove angular comment * refactor: react panel resizers for editor * feat: simple panel resizer * fix: use simple panel resizer everywhere * fix: simplify panel resizer state * chore: rename simple panel resizer to panel resizer * refactor: simplify column layout * fix: editor mount safety check * fix: use inline onLoad callback for iframe, as setting onload after it loads will never call it * chore: fix note view test * chore(deps): upgrade snjs
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { FunctionComponent } from 'preact';
|
|
|
|
export const Title: FunctionComponent = ({ children }) => (
|
|
<>
|
|
<h2 className="text-base m-0 mb-1">{children}</h2>
|
|
<div className="min-h-2" />
|
|
</>
|
|
);
|
|
|
|
export const Subtitle: FunctionComponent<{ className?: string }> = ({
|
|
children,
|
|
className = '',
|
|
}) => (
|
|
<h4 className={`font-medium text-sm m-0 mb-1 ${className}`}>{children}</h4>
|
|
);
|
|
|
|
export const SubtitleLight: FunctionComponent<{ className?: string }> = ({
|
|
children,
|
|
className = '',
|
|
}) => (
|
|
<h4 className={`font-normal text-sm m-0 mb-1 ${className}`}>{children}</h4>
|
|
);
|
|
|
|
export const Text: FunctionComponent<{ className?: string }> = ({
|
|
children,
|
|
className = '',
|
|
}) => <p className={`${className} text-xs`}>{children}</p>;
|
|
|
|
const buttonClasses = `block bg-default color-text rounded border-solid \
|
|
border-1 px-4 py-1.75 font-bold text-sm fit-content \
|
|
focus:bg-contrast hover:bg-contrast border-main`;
|
|
|
|
export const LinkButton: FunctionComponent<{
|
|
label: string;
|
|
link: string;
|
|
className?: string;
|
|
}> = ({ label, link, className }) => (
|
|
<a target="_blank" className={`${className} ${buttonClasses}`} href={link}>
|
|
{label}
|
|
</a>
|
|
);
|