|
1 | 1 | import { Button, IconArrowRight, IconCross } from "hds-react"; |
2 | 2 | import React from "react"; |
3 | 3 | import { useTranslation } from "next-i18next"; |
4 | | -import { useRouter } from "next/router"; |
5 | 4 | import styled from "styled-components"; |
6 | 5 | import { breakpoints } from "common/src/common/style"; |
7 | 6 | import { Container as CommonContainer } from "common"; |
8 | 7 | import ClientOnly from "common/src/ClientOnly"; |
9 | 8 | import { JustForDesktop, JustForMobile } from "@/modules/style/layout"; |
10 | 9 | import { truncatedText } from "@/styles/util"; |
| 10 | +import Link from "next/link"; |
11 | 11 |
|
12 | 12 | type Props = { |
13 | 13 | count: number; |
@@ -77,18 +77,19 @@ const DeleteButton = styled(Button).attrs({ |
77 | 77 | ${truncatedText} |
78 | 78 | `; |
79 | 79 |
|
80 | | -const SubmitButton = styled(Button)` |
| 80 | +const StyledLink = styled(Link)` |
81 | 81 | background-color: var(--color-white); |
82 | 82 | color: var(--color-bus); |
83 | 83 | ${truncatedText} |
| 84 | + display: flex; |
| 85 | + gap: var(--spacing-2-xs); |
84 | 86 | `; |
85 | 87 |
|
86 | 88 | const StartApplicationBar = ({ |
87 | 89 | count, |
88 | 90 | clearSelections, |
89 | 91 | }: Props): JSX.Element | null => { |
90 | 92 | const { t } = useTranslation(); |
91 | | - const router = useRouter(); |
92 | 93 |
|
93 | 94 | // This breaks SSR because the server knowns nothing about client side stores |
94 | 95 | // we can't fix it with CSS since it doesn't update properly |
@@ -124,17 +125,11 @@ const StartApplicationBar = ({ |
124 | 125 | </JustForMobile> |
125 | 126 | </DeleteButton> |
126 | 127 | </Left> |
127 | | - <SubmitButton |
128 | | - id="startApplicationButton" |
129 | | - variant="primary" |
130 | | - iconRight={<IconArrowRight />} |
131 | | - onClick={() => { |
132 | | - router.push(`/intro`); |
133 | | - }} |
134 | | - > |
| 128 | + <StyledLink id="startApplicationButton" href="/intro"> |
135 | 129 | <JustForDesktop>{t("shoppingCart:next")}</JustForDesktop> |
136 | 130 | <JustForMobile>{t("shoppingCart:nextShort")}</JustForMobile> |
137 | | - </SubmitButton> |
| 131 | + <IconArrowRight /> |
| 132 | + </StyledLink> |
138 | 133 | </InnerContainer> |
139 | 134 | </Container> |
140 | 135 | </BackgroundContainer> |
|
0 commit comments