Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TH-1334 | Remove back button #756

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions apps/sports-helsinki/src/domain/venue/venueHero/VenueHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const VenueHero: React.FC<Props> = ({ venue }) => {
const locale = useLocale();
const router = useRouter();
const search = router.asPath.split('?')[1];
const returnParam = extractLatestReturnPath(search, `/${locale}`);
const returnParam = extractLatestReturnPath(search, ``);

const goBack = ({ returnPath, remainingQueryString = '' }: ReturnParams) => {
const goBackUrl = `${
Expand Down Expand Up @@ -93,16 +93,18 @@ const VenueHero: React.FC<Props> = ({ venue }) => {
<PageSection className={classNames(styles.heroSection)}>
<ContentContainer className={styles.contentContainer}>
<div className={styles.contentWrapper}>
<div className={styles.backButtonWrapper}>
<IconButton
role="link"
ariaLabel={t('venue:hero.ariaLabelBackButton')}
backgroundColor="white"
icon={<IconArrowLeft aria-hidden />}
onClick={() => goBack(returnParam)}
size="default"
/>
</div>
{returnParam?.returnPath && (
<div className={styles.backButtonWrapper}>
<IconButton
role="link"
ariaLabel={t('venue:hero.ariaLabelBackButton')}
backgroundColor="white"
icon={<IconArrowLeft aria-hidden />}
onClick={() => goBack(returnParam)}
size="default"
/>
</div>
)}
<div>
<BackgroundImage
className={styles.image}
Expand Down
26 changes: 14 additions & 12 deletions packages/components/src/components/eventHero/EventHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ const EventHero: React.FC<EventHeroProps> = ({
const buttonText = getEventHeroButtonText(event, 'button', t);
const buttonAriaLabelText = getEventHeroButtonText(event, 'ariaLabel', t);
const showKeywords = Boolean(today || thisWeek || keywords.length);
const returnParam = extractLatestReturnPath(search, `/${locale}`);

const returnParam = extractLatestReturnPath(search, ``);
const goBack = ({ returnPath, remainingQueryString = '' }: ReturnParams) => {
const goBackUrl = `${
returnPath.startsWith('/') ? '' : '/'
Expand All @@ -95,16 +94,19 @@ const EventHero: React.FC<EventHeroProps> = ({
<PageSection className={classNames(styles.heroSection)}>
<ContentContainer className={styles.contentContainer}>
<div className={styles.contentWrapper}>
<div className={styles.backButtonWrapper}>
<IconButton
role="link"
ariaLabel={t('hero.ariaLabelBackButton')}
backgroundColor="white"
icon={<IconArrowLeft aria-hidden />}
onClick={() => goBack(returnParam)}
size="default"
/>
</div>
{returnParam?.returnPath && (
<div className={styles.backButtonWrapper}>
<IconButton
role="link"
ariaLabel={t('hero.ariaLabelBackButton')}
backgroundColor="white"
icon={<IconArrowLeft aria-hidden />}
onClick={() => goBack(returnParam)}
size="default"
/>
</div>
)}

<div>
<BackgroundImage
className={styles.image}
Expand Down
Loading