feat(BOOK-212): Refactored LoginButton and added successful tracking functionality

Approved-by: Linus Flood
This commit is contained in:
Erik Tiekstra
2025-11-11 06:57:49 +00:00
parent 1b35618eb2
commit c93e2b6f0b
8 changed files with 91 additions and 71 deletions

View File

@@ -7,7 +7,6 @@ import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
import Footnote from "@scandic-hotels/design-system/Footnote"
import Checkbox from "@scandic-hotels/design-system/Form/Checkbox"
import { LoginButton } from "@scandic-hotels/design-system/LoginButton"
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
import Link from "@scandic-hotels/design-system/OldDSLink"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { trackLoginClick } from "@scandic-hotels/tracking/navigation"
@@ -74,23 +73,23 @@ export function JoinScandicFriendsCard({ name = "join" }: Props) {
</Typography>
</Checkbox>
<Button size="small" color="Primary" asChild>
<LoginButton
lang={lang}
className={styles.login}
color="white"
trackingId="join-scandic-friends-enter-details"
onClick={() => {
trackLoginClick("enter details")
}}
redirectTo={loginPathname}
>
{intl.formatMessage({
id: "enterDetails.joinScandicFriendsCard.loginButtonText",
defaultMessage: "Log in",
})}
</LoginButton>
</Button>
<LoginButton
color="Primary"
variant="Tertiary"
size="Small"
lang={lang}
className={styles.login}
loginPosition="enter-details"
onClick={() => {
trackLoginClick("enter details")
}}
redirectTo={loginPathname}
>
{intl.formatMessage({
id: "enterDetails.joinScandicFriendsCard.loginButtonText",
defaultMessage: "Log in",
})}
</LoginButton>
<div className={styles.terms}>
<Footnote color="uiTextPlaceholder">