Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
'use client'
|
||||
"use client"
|
||||
|
||||
import { type ComponentProps } from 'react'
|
||||
import { type ComponentProps } from "react"
|
||||
|
||||
import { variants } from './variants'
|
||||
import { variants } from "./variants"
|
||||
|
||||
import type { VariantProps } from 'class-variance-authority'
|
||||
import Link from 'next/link'
|
||||
import { useIntl } from 'react-intl'
|
||||
import { ButtonIconName } from '../Button/types'
|
||||
import { MaterialIcon } from '../Icons/MaterialIcon'
|
||||
import { Typography } from '../Typography'
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import Link from "next/link"
|
||||
import { useIntl } from "react-intl"
|
||||
import { ButtonIconName } from "../Button/types"
|
||||
import { MaterialIcon } from "../Icons/MaterialIcon"
|
||||
import { Typography } from "../Typography"
|
||||
|
||||
export interface ButtonLinkProps
|
||||
extends
|
||||
Omit<ComponentProps<typeof Link>, 'color'>,
|
||||
Omit<ComponentProps<typeof Link>, "color">,
|
||||
VariantProps<typeof variants> {
|
||||
leadingIconName?: ButtonIconName | null
|
||||
trailingIconName?: ButtonIconName | null
|
||||
@@ -44,30 +44,30 @@ export default function ButtonLink({
|
||||
|
||||
const intl = useIntl()
|
||||
const newTabText = intl.formatMessage({
|
||||
id: 'common.linkOpenInNewTab',
|
||||
defaultMessage: 'Opens in a new tab/window',
|
||||
id: "common.linkOpenInNewTab",
|
||||
defaultMessage: "Opens in a new tab/window",
|
||||
})
|
||||
|
||||
return (
|
||||
<Typography
|
||||
variant={
|
||||
size === 'sm'
|
||||
? 'Body/Supporting text (caption)/smBold'
|
||||
: 'Body/Paragraph/mdBold'
|
||||
size === "sm"
|
||||
? "Body/Supporting text (caption)/smBold"
|
||||
: "Body/Paragraph/mdBold"
|
||||
}
|
||||
>
|
||||
<Link
|
||||
className={classNames}
|
||||
href={href}
|
||||
target={target}
|
||||
title={target === '_blank' ? newTabText : ''}
|
||||
title={target === "_blank" ? newTabText : ""}
|
||||
{...props}
|
||||
>
|
||||
{leadingIconName ? (
|
||||
<MaterialIcon
|
||||
icon={leadingIconName}
|
||||
color="CurrentColor"
|
||||
size={size === 'sm' ? 20 : 24}
|
||||
size={size === "sm" ? 20 : 24}
|
||||
/>
|
||||
) : null}
|
||||
{children}
|
||||
@@ -75,7 +75,7 @@ export default function ButtonLink({
|
||||
<MaterialIcon
|
||||
icon={trailingIconName}
|
||||
color="CurrentColor"
|
||||
size={size === 'sm' ? 20 : 24}
|
||||
size={size === "sm" ? 20 : 24}
|
||||
/>
|
||||
) : null}
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user