Skip to content

Commit

Permalink
wip fix prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Nov 30, 2024
1 parent f8c9985 commit 206f3cf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
12 changes: 7 additions & 5 deletions src/components/@molecules/AddRecordButton/AddRecordButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ type Props = {
onAddRecord?: (value: string) => void
}

const WrappedPlusSVG = () => (
<SVGWrapper>
<PlusSVG />
</SVGWrapper>
)

export const AddRecordButton = ({
autocomplete,
createable,
Expand Down Expand Up @@ -429,11 +435,7 @@ export const AddRecordButton = ({
</ControlsContainer>
<ButtonContainer $state={state}>
<Button
prefix={
<SVGWrapper>
<PlusSVG />
</SVGWrapper>
}
prefix={WrappedPlusSVG}
colorStyle="transparent"
onClick={handleButtonClick}
size="medium"
Expand Down
14 changes: 7 additions & 7 deletions src/components/@molecules/BurnFuses/BurnFusesContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ const StyledButton = styled(Button)(
`,
)

const SelectedBurnButton = (permission: string) => () => (
<FlameSVG width="24" height="24" data-testid={`flame-selected-${permission}`} />
)

const UnselectedBurnButton = () => <StyledFlameSVG width="24" height="24" />

const BurnButton = ({
permission,
isBurned,
Expand All @@ -100,13 +106,7 @@ const BurnButton = ({
disabled={isBurned}
colorStyle={isSelected ? 'redSecondary' : 'greySecondary'}
size="small"
suffix={
isSelected ? (
<FlameSVG width="24" height="24" data-testid={`flame-selected-${permission}`} />
) : (
<StyledFlameSVG width="24" height="24" />
)
}
suffix={isSelected ? SelectedBurnButton(permission) : UnselectedBurnButton}
>
<ButtonInner data-testid={`burn-button-${permission}`}>
<Typography>{t(`permissions.${permission}`)}</Typography>
Expand Down
4 changes: 2 additions & 2 deletions src/components/@molecules/DisabledButtonWithTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentProps } from 'react'

import { Button, ButtonProps, Tooltip, type ReactNodeNoStrings } from '@ensdomains/thorin'
import { Button, ButtonProps, Tooltip } from '@ensdomains/thorin'

import { useTooltipSeenManager } from '@app/hooks/useTooltipSeenManager'

Expand Down Expand Up @@ -31,7 +31,7 @@ export const DisabledButtonWithTooltip = ({
mobileWidth?: number
buttonWidth?: ButtonProps['width']
colorStyle?: ButtonProps['colorStyle']
prefix?: ReactNodeNoStrings
prefix?: AsProp
loading?: boolean
}) => {
const { shouldShowTooltipIndicator, onSeen } = useTooltipSeenManager(buttonId)
Expand Down

0 comments on commit 206f3cf

Please sign in to comment.