diff options
author | crupest <crupest@outlook.com> | 2020-06-17 14:51:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-17 14:51:33 +0800 |
commit | f737fed4f003fbeb7187629a7b730c64a87b72b9 (patch) | |
tree | 1ea1f406557a11d15ab5f55afd9075ec11f702fd /Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx | |
parent | 5eec1a0aac725d8b21303f94e720a79dca8d918e (diff) | |
download | timeline-f737fed4f003fbeb7187629a7b730c64a87b72b9.tar.gz timeline-f737fed4f003fbeb7187629a7b730c64a87b72b9.tar.bz2 timeline-f737fed4f003fbeb7187629a7b730c64a87b72b9.zip |
refactor(front): Fix #104 .
Diffstat (limited to 'Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx')
-rw-r--r-- | Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx b/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx index 66935e00..924e7883 100644 --- a/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx +++ b/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx @@ -26,7 +26,7 @@ export interface TimelineCardComponentProps<TTimeline, TManageItems> { } export interface TimelinePageTemplateUIProps< - TTimeline extends { name: string }, + TTimeline extends { uniqueId: string }, TManageItems > { avatarKey?: string | number; @@ -43,7 +43,7 @@ export interface TimelinePageTemplateUIProps< } export default function TimelinePageTemplateUI< - TTimeline extends { name: string }, + TTimeline extends { uniqueId: string }, TEditItems >( props: TimelinePageTemplateUIProps<TTimeline, TEditItems> @@ -127,11 +127,11 @@ export default function TimelinePageTemplateUI< const [cardHeight, setCardHeight] = React.useState<number>(0); - const genCardCollapseLocalStorageKey = (timelineName: string): string => - `timeline.${timelineName}.cardCollapse`; + const genCardCollapseLocalStorageKey = (uniqueId: string): string => + `timeline.${uniqueId}.cardCollapse`; const cardCollapseLocalStorageKey = - timeline != null ? genCardCollapseLocalStorageKey(timeline.name) : null; + timeline != null ? genCardCollapseLocalStorageKey(timeline.uniqueId) : null; const [infoCardCollapse, setInfoCardCollapse] = React.useState<boolean>(true); React.useEffect(() => { @@ -171,7 +171,7 @@ export default function TimelinePageTemplateUI< <TimelinePostEdit onPost={props.onPost} onHeightChange={onPostEditHeightChange} - timelineName={timeline.name} + timelineUniqueId={timeline.uniqueId} /> </> ); @@ -202,7 +202,7 @@ export default function TimelinePageTemplateUI< const newState = !infoCardCollapse; setInfoCardCollapse(newState); window.localStorage.setItem( - genCardCollapseLocalStorageKey(timeline.name), + genCardCollapseLocalStorageKey(timeline.uniqueId), newState.toString() ); }} |