diff --git a/ui/components/AccountsNotificationPanel/AccountsNotificationPanelAccounts.tsx b/ui/components/AccountsNotificationPanel/AccountsNotificationPanelAccounts.tsx index 8dc570307..5b0815a28 100644 --- a/ui/components/AccountsNotificationPanel/AccountsNotificationPanelAccounts.tsx +++ b/ui/components/AccountsNotificationPanel/AccountsNotificationPanelAccounts.tsx @@ -195,7 +195,7 @@ function WalletTypeHeader({ toggler={(toggle) => ( toggle()} icon="settings.svg" diff --git a/ui/components/DAppConnection/DAppConnectionInfoBar.tsx b/ui/components/DAppConnection/DAppConnectionInfoBar.tsx index 6abd6edf3..4527c18e4 100644 --- a/ui/components/DAppConnection/DAppConnectionInfoBar.tsx +++ b/ui/components/DAppConnection/DAppConnectionInfoBar.tsx @@ -41,11 +41,7 @@ function DefaultConnectionPopover({ close }: PopoverProps): ReactElement { onClick={animateThenClose} color="var(--green-20)" hoverColor="var(--white)" - customStyles={` - position: absolute; - top: 16px; - right: 16px; - `} + style={{ position: "absolute", top: 16, right: 16 }} />

{t("title")}

diff --git a/ui/components/NFTs/NFTCollection.tsx b/ui/components/NFTs/NFTCollection.tsx index 7e59fbec2..8b68298dd 100644 --- a/ui/components/NFTs/NFTCollection.tsx +++ b/ui/components/NFTs/NFTCollection.tsx @@ -133,7 +133,7 @@ export default function NFTCollection(props: { isLoaded={!isLoading && !!nfts.length} width={168} height={168} - customStyles="margin: 8px 0 34px;" + style={{ margin: "8px 0 34px" }} > {nfts.length === 1 ? (
diff --git a/ui/components/NFTs/NFTHover.tsx b/ui/components/NFTs/NFTHover.tsx index 55857fc8f..0440b900d 100644 --- a/ui/components/NFTs/NFTHover.tsx +++ b/ui/components/NFTs/NFTHover.tsx @@ -1,5 +1,5 @@ /* eslint-disable no-nested-ternary */ -import React, { ReactElement } from "react" +import React, { CSSProperties, ReactElement } from "react" import { useTranslation } from "react-i18next" import { I18nKey } from "../../_locales/i18n" import SharedIcon from "../Shared/SharedIcon" @@ -12,7 +12,7 @@ const icons: Record< background: string backgroundHover?: string size: number - style: string + style?: CSSProperties } > = { close: { @@ -21,21 +21,19 @@ const icons: Record< background: "var(--green-40)", backgroundHover: "var(--green-20)", size: 12, - style: "", }, expand: { icon: "chevron", label: "nfts.collectionHover.expand", background: "var(--success)", size: 12, - style: "margin-bottom: 3px;", + style: { marginBottom: 3 }, }, view: { icon: "eye", label: "nfts.collectionHover.view", background: "var(--trophy-gold)", size: 22, - style: "", }, } @@ -72,7 +70,7 @@ export default function NFTsHover(props: { icon={`${icon}@2x.png`} width={size} color="var(--hunter-green)" - customStyles={style} + style={style} />
diff --git a/ui/components/Shared/SharedImageWithFallback.tsx b/ui/components/Shared/SharedImageWithFallback.tsx index 1c94d8104..9ec5a5de6 100644 --- a/ui/components/Shared/SharedImageWithFallback.tsx +++ b/ui/components/Shared/SharedImageWithFallback.tsx @@ -1,10 +1,23 @@ -import React, { PropsWithoutRef, useEffect, useState } from "react" +import React, { + CSSProperties, + PropsWithoutRef, + useEffect, + useState, +} from "react" import classNames from "classnames" // Transparent pixel const defaultPlaceholder = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" +type SharedImageWithFallbackProps = PropsWithoutRef< + JSX.IntrinsicElements["img"] +> & { + fallback: string + placeholder?: string + style?: CSSProperties +} + export default function SharedImageWithFallback({ fallback, src = fallback, @@ -13,13 +26,9 @@ export default function SharedImageWithFallback({ loading, alt, className, - customStyles = "", + style, placeholder = defaultPlaceholder, -}: PropsWithoutRef & { - fallback: string - placeholder?: string - customStyles?: string -}): JSX.Element { +}: SharedImageWithFallbackProps): JSX.Element { const [isLoading, setIsLoading] = useState(true) const [imageSrc, setImageSrc] = useState(placeholder) @@ -49,6 +58,7 @@ export default function SharedImageWithFallback({ - ) } diff --git a/ui/components/Shared/SharedSkeletonLoader.tsx b/ui/components/Shared/SharedSkeletonLoader.tsx index 413ab97c9..17d204f26 100644 --- a/ui/components/Shared/SharedSkeletonLoader.tsx +++ b/ui/components/Shared/SharedSkeletonLoader.tsx @@ -1,4 +1,4 @@ -import React, { ReactElement, ReactNode } from "react" +import React, { CSSProperties, ReactElement, ReactNode } from "react" import classNames from "classnames" export default function SharedSkeletonLoader(props: { @@ -7,10 +7,9 @@ export default function SharedSkeletonLoader(props: { borderRadius?: number children?: ReactNode isLoaded?: boolean - customStyles?: string + style?: CSSProperties }): ReactElement { - const { width, height, borderRadius, isLoaded, customStyles, children } = - props + const { width, height, borderRadius, isLoaded, style, children } = props // Want to return a ReactElement to make this maximally easy to integrate, // whereas children can be a ReactNode; Fragment will let us achieve that. @@ -18,7 +17,11 @@ export default function SharedSkeletonLoader(props: { if (isLoaded) return <>{children} return ( -
+