chore: replace function expression with inline statement
replace destructuring for better static analysis remove unused variables
This commit is contained in:
@@ -7,10 +7,10 @@ import { useIntl } from "react-intl"
|
||||
import styles from "./bookingButton.module.css"
|
||||
|
||||
export default function BookingButton({ href }: { href: string }) {
|
||||
const { formatMessage } = useIntl()
|
||||
const intl = useIntl()
|
||||
return (
|
||||
<a className={styles.button} href={href}>
|
||||
{formatMessage({ id: "Book" })}
|
||||
{intl.formatMessage({ id: "Book" })}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function MyPagesMobileDropdown({
|
||||
}: {
|
||||
navigation: Navigation
|
||||
}) {
|
||||
const { formatMessage } = useIntl()
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
const { toggleDropdown, isMyPagesMobileMenuOpen } = useDropdownStore()
|
||||
|
||||
@@ -69,7 +69,7 @@ export default function MyPagesMobileDropdown({
|
||||
color="burgundy"
|
||||
variant="myPageMobileDropdown"
|
||||
>
|
||||
{formatMessage({ id: "Log out" })}
|
||||
{intl.formatMessage({ id: "Log out" })}
|
||||
</Link>
|
||||
</li>
|
||||
) : null}
|
||||
|
||||
@@ -21,7 +21,7 @@ export default async function TopMenu({
|
||||
links,
|
||||
languageSwitcher,
|
||||
}: TopMenuProps) {
|
||||
const { formatMessage } = await getIntl()
|
||||
const intl = await getIntl()
|
||||
const user = await getName()
|
||||
return (
|
||||
<div className={styles.topMenu}>
|
||||
@@ -60,7 +60,7 @@ export default async function TopMenu({
|
||||
className={styles.sessionLink}
|
||||
prefetch={false}
|
||||
>
|
||||
{formatMessage({ id: "Log out" })}
|
||||
{intl.formatMessage({ id: "Log out" })}
|
||||
</Link>
|
||||
</>
|
||||
) : (
|
||||
@@ -69,7 +69,7 @@ export default async function TopMenu({
|
||||
trackingId="loginStartTopMenu"
|
||||
className={`${styles.sessionLink} ${styles.loginLink}`}
|
||||
>
|
||||
{formatMessage({ id: "Log in" })}
|
||||
{intl.formatMessage({ id: "Log in" })}
|
||||
</LoginButton>
|
||||
)}
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user