* 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
67 lines
1.7 KiB
TypeScript
67 lines
1.7 KiB
TypeScript
import { NoteViewController } from '@standardnotes/snjs';
|
|
import { PureComponent } from '@/components/Abstract/PureComponent';
|
|
import { WebApplication } from '@/ui_models/application';
|
|
import { MultipleSelectedNotes } from '@/components/MultipleSelectedNotes';
|
|
import { NoteView } from '@/components/NoteView/NoteView';
|
|
|
|
type State = {
|
|
showMultipleSelectedNotes: boolean;
|
|
controllers: NoteViewController[];
|
|
};
|
|
|
|
type Props = {
|
|
application: WebApplication;
|
|
};
|
|
|
|
export class NoteGroupView extends PureComponent<Props, State> {
|
|
constructor(props: Props) {
|
|
super(props, props.application);
|
|
this.state = {
|
|
showMultipleSelectedNotes: false,
|
|
controllers: [],
|
|
};
|
|
}
|
|
|
|
componentDidMount(): void {
|
|
super.componentDidMount();
|
|
this.application.noteControllerGroup.addActiveControllerChangeObserver(
|
|
() => {
|
|
this.setState({
|
|
controllers: this.application.noteControllerGroup.noteControllers,
|
|
});
|
|
}
|
|
);
|
|
this.autorun(() => {
|
|
this.setState({
|
|
showMultipleSelectedNotes: this.appState.notes.selectedNotesCount > 1,
|
|
});
|
|
});
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div id="note-group-view" className="h-full app-column app-column-third">
|
|
{this.state.showMultipleSelectedNotes && (
|
|
<MultipleSelectedNotes
|
|
application={this.application}
|
|
appState={this.appState}
|
|
/>
|
|
)}
|
|
|
|
{!this.state.showMultipleSelectedNotes && (
|
|
<>
|
|
{this.state.controllers.map((controller) => {
|
|
return (
|
|
<NoteView
|
|
application={this.application}
|
|
controller={controller}
|
|
/>
|
|
);
|
|
})}
|
|
</>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
}
|