Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Lysak committed Dec 2, 2024
1 parent 7f8740e commit f5ecdd2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/ConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ const PersonOverlay = styled.div(
`,
)

const getTestId = (isTabBar: boolean | undefined, inHeader: boolean | undefined) => {
if (isTabBar) return 'tabbar-connect-button'
if (!inHeader) return 'body-connect-button'
return 'connect-button'
}

type Props = {
isTabBar?: boolean
large?: boolean
Expand All @@ -104,9 +110,7 @@ export const ConnectButton = ({ isTabBar, large, inHeader }: Props) => {
return (
<StyledButtonWrapper $large={large} $isTabBar={isTabBar}>
<Button
data-testid={
isTabBar ? 'tabbar-connect-button' : !inHeader ? 'body-connect-button' : 'connect-button'
}
data-testid={getTestId(isTabBar, !inHeader)}
onClick={() => openConnectModal?.()}
size={breakpoints.sm || large ? 'medium' : 'small'}
width={inHeader ? '45' : undefined}
Expand Down

0 comments on commit f5ecdd2

Please sign in to comment.