mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
add some changes that are rendering properly
This commit is contained in:
@@ -36,6 +36,7 @@ export interface NoticeProps {
|
||||
zIndex?: number,
|
||||
style?: React.CSSProperties
|
||||
biggerCloseButton?: boolean;
|
||||
children?: React.ReactNode
|
||||
}
|
||||
|
||||
export interface NoticeState {
|
||||
|
||||
@@ -4,7 +4,8 @@ export interface NoticeTextSelectionProps {
|
||||
icon?: string,
|
||||
text: string,
|
||||
idSuffix: string,
|
||||
onClick?: (event: React.MouseEvent) => unknown
|
||||
onClick?: (event: React.MouseEvent) => unknown,
|
||||
children?: React.ReactNode
|
||||
}
|
||||
|
||||
export interface NoticeTextSelectionState {
|
||||
|
||||
@@ -23,6 +23,7 @@ export interface SponsorTimeEditProps {
|
||||
submissionNotice: SubmissionNoticeComponent;
|
||||
categoryList?: Category[];
|
||||
categoryChangeListener?: (index: number, category: Category) => void;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export interface SponsorTimeEditState {
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface CategorySkipOptionsProps {
|
||||
category: Category;
|
||||
defaultColor?: string;
|
||||
defaultPreviewColor?: string;
|
||||
children?: React.ReactNode[];
|
||||
}
|
||||
|
||||
export interface CategorySkipOptionsState {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import { createRoot, Root } from 'react-dom/client';
|
||||
import Config from "../../config";
|
||||
import { Keybind } from "../../types";
|
||||
import KeybindDialogComponent from "./KeybindDialogComponent";
|
||||
@@ -14,6 +14,7 @@ export interface KeybindState {
|
||||
}
|
||||
|
||||
let dialog;
|
||||
let root: Root;
|
||||
|
||||
class KeybindComponent extends React.Component<KeybindProps, KeybindState> {
|
||||
constructor(props: KeybindProps) {
|
||||
@@ -56,11 +57,12 @@ class KeybindComponent extends React.Component<KeybindProps, KeybindState> {
|
||||
dialog = parent.document.createElement("div");
|
||||
dialog.id = "keybind-dialog";
|
||||
parent.document.body.prepend(dialog);
|
||||
ReactDOM.render(<KeybindDialogComponent option={this.props.option} closeListener={(updateWith) => this.closeEditDialog(updateWith)} />, dialog);
|
||||
root = createRoot(dialog);
|
||||
root.render(<KeybindDialogComponent option={this.props.option} closeListener={(updateWith) => this.closeEditDialog(updateWith)} />);
|
||||
}
|
||||
|
||||
closeEditDialog(updateWith: Keybind): void {
|
||||
ReactDOM.unmountComponentAtNode(dialog);
|
||||
root.unmount();
|
||||
dialog.remove();
|
||||
if (updateWith != null)
|
||||
this.setState({keybind: updateWith});
|
||||
|
||||
@@ -5,6 +5,7 @@ import { exportTimes, exportTimesAsHashParam } from "../../utils/exporter";
|
||||
|
||||
export interface UnsubmittedVideosListItemProps {
|
||||
videoID: string;
|
||||
children?: React.ReactNode[];
|
||||
}
|
||||
|
||||
export interface UnsubmittedVideosListItemState {
|
||||
|
||||
Reference in New Issue
Block a user