Skip to content

Commit

Permalink
fix image require
Browse files Browse the repository at this point in the history
  • Loading branch information
mstfash committed Mar 18, 2023
1 parent cbfd9f2 commit 01d4e19
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
14 changes: 9 additions & 5 deletions src/components/AuctionsOperations/AuctionsPayment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,15 @@ const AuctionsPayment = () => {
}

const returnClaimValues = () => {
if (Number(protInternalBalance) > 0) {
return { amount: protInternalBalance, symbol: 'FLX' }
}

return { amount: internalBalance, symbol: 'RAI' }
const amount =
Number(protInternalBalance) > Number(internalBalance)
? Number(protInternalBalance)
: Number(internalBalance)
const symbol =
Number(protInternalBalance) > Number(internalBalance)
? 'FLX'
: 'RAI'
return { amount, symbol }
}

const handleCancel = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Brand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {
}

const Brand = ({ height }: Props) => {
const imgUrl = require(`../assets/brand-white.png`)
const imgUrl = require(`../assets/brand-white.png`).default
return (
<Container>
<a href={'/'}>
Expand Down
5 changes: 4 additions & 1 deletion src/components/WalletModal/PendingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ export default function PendingView({
color={option.color}
header={option.name}
subheader={option.description}
icon={require(`../../assets/connectors/${option.iconName}`)}
icon={
require(`../../assets/connectors/${option.iconName}`)
.default
}
/>
)
}
Expand Down
8 changes: 5 additions & 3 deletions src/containers/Earn/Staking/Statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { formatNumber } from '../../../utils/helper'
const returnImg = (type = 'flx', width = '20px', height = '20px') => {
return (
<img
src={require(`../../../assets/${
type === 'flx' ? 'flx-logo.svg' : 'stFLX.svg'
}`)}
src={
require(`../../../assets/${
type === 'flx' ? 'flx-logo.svg' : 'stFLX.svg'
}`).default
}
width={width}
height={height}
alt=""
Expand Down

0 comments on commit 01d4e19

Please sign in to comment.