diff --git a/packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx b/packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx index 347a793367..0f16c2fb61 100644 --- a/packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx +++ b/packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx @@ -122,7 +122,7 @@ export const WorkingGroupOpening = () => { header={ - + {opening.title} diff --git a/packages/ui/src/common/components/page/PreviousPage.tsx b/packages/ui/src/common/components/page/PreviousPage.tsx index 17df2025eb..893d5e0bed 100644 --- a/packages/ui/src/common/components/page/PreviousPage.tsx +++ b/packages/ui/src/common/components/page/PreviousPage.tsx @@ -1,3 +1,4 @@ +import { History } from 'history' import React from 'react' import { useHistory } from 'react-router-dom' import styled from 'styled-components' @@ -8,14 +9,21 @@ import { Arrow } from '../icons' interface PreviousPageProps { children?: React.ReactNode showOverflow?: boolean + customLink?: string } - -export const PreviousPage = ({ children, showOverflow }: PreviousPageProps) => { +const setPrevHistory = (history: History, customLink?: string) => { + if (history.action === 'POP' && customLink) { + history.push(customLink) + } else { + history.goBack() + } +} +export const PreviousPage = ({ children, showOverflow, customLink }: PreviousPageProps) => { const history = useHistory() return ( - history.goBack()} size="small" square> + setPrevHistory(history, customLink)} size="small" square>