aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-13 16:35:39 +0800
committercrupest <crupest@outlook.com>2021-02-13 16:35:39 +0800
commitaeed3cb80d8c0a62d0ccc565733c4a213759c5bd (patch)
treefd00577d63c396bcbbd72a31d2f2aeda2fff6218 /FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
parent8211994b7175f2ad04663abc0c2605eb96143841 (diff)
downloadtimeline-aeed3cb80d8c0a62d0ccc565733c4a213759c5bd.tar.gz
timeline-aeed3cb80d8c0a62d0ccc565733c4a213759c5bd.tar.bz2
timeline-aeed3cb80d8c0a62d0ccc565733c4a213759c5bd.zip
...
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx')
-rw-r--r--FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
index caab1768..6a8dd63c 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePageTemplate.tsx
@@ -16,12 +16,14 @@ export interface TimelinePageTemplateProps<TManageItem> {
Omit<TimelinePageTemplateUIProps<TManageItem>, "CardComponent">
>;
notFoundI18nKey: string;
+ reloadKey: number;
+ onReload: () => void;
}
export default function TimelinePageTemplate<TManageItem>(
props: TimelinePageTemplateProps<TManageItem>
): React.ReactElement | null {
- const { name } = props;
+ const { name, reloadKey, onReload } = props;
const [dialog, setDialog] = React.useState<null | "property" | "member">(
null
@@ -68,7 +70,7 @@ export default function TimelinePageTemplate<TManageItem>(
return () => {
subscribe = false;
};
- }, [name]);
+ }, [name, reloadKey]);
let dialogElement: React.ReactElement | undefined;
const closeDialog = (): void => setDialog(null);
@@ -85,6 +87,7 @@ export default function TimelinePageTemplate<TManageItem>(
open
close={closeDialog}
timeline={timeline}
+ onChange={onReload}
/>
);
} else if (dialog === "member") {
@@ -95,7 +98,12 @@ export default function TimelinePageTemplate<TManageItem>(
}
dialogElement = (
- <TimelineMemberDialog open onClose={closeDialog} timeline={timeline} />
+ <TimelineMemberDialog
+ open
+ onClose={closeDialog}
+ timeline={timeline}
+ onChange={onReload}
+ />
);
}