diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 345154caa36140c0c127d08bb266106045bf1256..cec64603d931b789ace17b0aaccf271a6849a7ea 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -1,4 +1,5 @@ import { useNavigation } from "../utils" +import { Ourlink } from "./interfaces"; export function TabScrollLink({tab, scrollId, num}:{tab: string, scrollId: string, num: string}){ const {goToPageWithTabAndScroll} = useNavigation(); @@ -7,14 +8,7 @@ export function TabScrollLink({tab, scrollId, num}:{tab: string, scrollId: strin ) } -interface Ourlink{ - path: string, - text: string, - scrollToId?: string, - tabId?: string, - subTabId?: string, - collapseId?: string -} + // 2^4 = 16 possible combinations diff --git a/src/components/interfaces.tsx b/src/components/interfaces.tsx new file mode 100644 index 0000000000000000000000000000000000000000..53b9ceb7f6bd2d7cce70ef5da9ba958b8e4a4f97 --- /dev/null +++ b/src/components/interfaces.tsx @@ -0,0 +1,8 @@ +export interface Ourlink{ + path: string, + text: string, + scrollToId?: string, + tabId?: string, + subTabId?: string, + collapseId?: string +} \ No newline at end of file diff --git a/src/data/hptimelinedata.tsx b/src/data/hptimelinedata.tsx index d62320d1ecf90a6e762decc89eb13c4095e860d3..728b7b4f6be8a115a1a1ac8dd62f1510d9165830 100644 --- a/src/data/hptimelinedata.tsx +++ b/src/data/hptimelinedata.tsx @@ -8,25 +8,14 @@ import RnhaleSources from "../sources/rnhale-sources"; import WischmeyerSources from "../sources/wimscheyer-sources"; import { useNavigation } from "../utils"; -function HPLinktoOtherHPTab({tab, text}:{tab: string, text: string}){ - const {goToPagesAndOpenTab} = useNavigation(); +function LinkFromTimeline({tab, text}:{tab: string, text: string}){ + const {goToPlace} = useNavigation(); return( - <a onClick={() => goToPagesAndOpenTab(tab, "")}> {text} </a> - ) -} -function HPgoToPageAndScroll({id, text, path}:{id: string, text: string, path: string}){ - const {goToPageAndScroll} = useNavigation(); - return( - <a onClick={() => goToPageAndScroll(id, path)}> {text} </a> - ) -} -function HPgoToPageWithTabAndScroll({id, text, path, scrollId}:{id: string, text: string, path: string, scrollId: string}){ - const {goToPageWithTabAndScroll} = useNavigation(); - return( - <a onClick={() => goToPageWithTabAndScroll({path: path, tabId: id, scrollToId: scrollId})}> {text} </a> + <a onClick={() => goToPlace(tab, "")}> {text} </a> ) } + /*function HPgoToPageAndOpenTab({id, text, path}:{id: string, text: string, path: string}){ const {goToPagesAndOpenTab} = useNavigation(); return(