diff --git a/components/avatar-or-identicon.tsx b/components/avatar-or-identicon.tsx index 75a9fb25d3..6f1b3687f9 100644 --- a/components/avatar-or-identicon.tsx +++ b/components/avatar-or-identicon.tsx @@ -9,8 +9,6 @@ import {truncateAddress} from "helpers/truncate-address"; import {User} from "interfaces/api"; import {SizeOptions} from "interfaces/utils"; -import {baseApiImgUrl} from "../services/api"; - export interface AvatarOrIdenticonProps { user: User | { address: string; handle?: string; avatar?: string; }; size?: SizeOptions | number; @@ -50,7 +48,7 @@ export default function AvatarOrIdenticon({ diff --git a/components/bounties/select-network.tsx b/components/bounties/select-network.tsx index cabcd78f40..f7507ee251 100644 --- a/components/bounties/select-network.tsx +++ b/components/bounties/select-network.tsx @@ -23,8 +23,6 @@ import useReactQuery from "x-hooks/use-react-query"; import {useSettings} from "x-hooks/use-settings"; import useSupportedChain from "x-hooks/use-supported-chain"; -import {baseApiImgUrl} from "../../services/api"; - interface SelectNetworkProps { isCurrentDefault?: boolean; onlyProfileFilters?: boolean; @@ -70,7 +68,7 @@ export default function SelectNetwork({ value: network, preIcon: ( void; @@ -51,7 +49,7 @@ export default function CreateBountyNetworkDropdown({ label: network?.name, preIcon: ( {`${network?.name} : diff --git a/components/common/marketplace-with-network-logo/marketplace-with-network-logo.view.tsx b/components/common/marketplace-with-network-logo/marketplace-with-network-logo.view.tsx index 5de0fd3b42..519579e349 100644 --- a/components/common/marketplace-with-network-logo/marketplace-with-network-logo.view.tsx +++ b/components/common/marketplace-with-network-logo/marketplace-with-network-logo.view.tsx @@ -3,8 +3,6 @@ import getConfig from "next/config"; import ChainIcon from "components/chain-icon"; import NetworkLogo from "components/network-logo"; -import {baseApiImgUrl} from "../../../services/api"; - const {publicRuntimeConfig} = getConfig(); interface MarketplaceWithNetworkLogoProps { networkLogo: string; @@ -17,7 +15,7 @@ export default function MarketplaceWithNetworkLogo ({ return(
({ value: { - preview: `${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${hash}`, + preview: `${publicRuntimeConfig?.urls?.ipfs}/${hash}`, raw: null, }, validated: null, diff --git a/components/networks-list/network-list-item.tsx b/components/networks-list/network-list-item.tsx index e547afb6ed..864b59a60a 100644 --- a/components/networks-list/network-list-item.tsx +++ b/components/networks-list/network-list-item.tsx @@ -12,8 +12,6 @@ import {Network} from "interfaces/network"; import {useSettings} from "x-hooks/use-settings"; -import {baseApiImgUrl} from "../../services/api"; - interface NetworkListItemProps { network: Network; tokenSymbolDefault: string; @@ -62,7 +60,7 @@ export default function NetworkListItem({ onClick={onClick} icon={ = ({ issueMeta }) => { const hash = issueMeta?.seoImage; const imageUrl = hash ? - `${baseApiImgUrl}/${publicRuntimeConfig.urls.ipfs}/${hash}` : `${homeUrl}/images/meta-thumbnail.jpeg`; + `${publicRuntimeConfig.urls.ipfs}/${hash}` : `${homeUrl}/images/meta-thumbnail.jpeg`; const description = removeMarkdown(issueMeta?.body?.substring(0, 160).trimEnd()); diff --git a/contexts/network-settings.tsx b/contexts/network-settings.tsx index eeb2be7a1d..1ac8727df9 100644 --- a/contexts/network-settings.tsx +++ b/contexts/network-settings.tsx @@ -38,8 +38,6 @@ import useNetworkTheme from "x-hooks/use-network-theme"; import {useSettings} from "x-hooks/use-settings"; import useSupportedChain from "x-hooks/use-supported-chain"; -import {baseApiImgUrl} from "../services/api"; - const NetworkSettingsContext = createContext(undefined); const ALLOWED_PATHS = [ @@ -72,7 +70,7 @@ export const NetworkSettingsProvider = ({ children }) => { const { service: daoService, serviceStarting, ...daoStore } = useDaoStore(); const { connectedChain } = useSupportedChain(); - const IPFS_URL = baseApiImgUrl.concat("/", settings?.urls?.ipfs); + const IPFS_URL = settings?.urls?.ipfs; const LIMITS = { percentageNeededForDispute: settings?.networkParametersLimits?.disputePercentage, draftTime: settings?.networkParametersLimits?.draftTime, diff --git a/pages/profile/[identifier].tsx b/pages/profile/[identifier].tsx index 614ece34b4..14387342b7 100644 --- a/pages/profile/[identifier].tsx +++ b/pages/profile/[identifier].tsx @@ -25,7 +25,6 @@ import {getBountiesListData} from "x-hooks/api/task"; import { getTasksWon } from "x-hooks/api/task/get-tasks-won"; import {useGetUserByAddress, useGetUserByLogin} from "x-hooks/api/user"; -import {baseApiImgUrl} from "../../services/api"; import {AnkrNftAsset} from "../../types/ankr-nft-asset"; import {getTaikaiPops} from "../../x-hooks/api/user/get-taikai-pops"; @@ -44,7 +43,7 @@ export default function PublicProfile(props: PublicProfileProps) { const { user } = props; const homeUrl = publicRuntimeConfig?.urls?.home; const imageUrl = user?.profileImage ? - `${baseApiImgUrl}/${publicRuntimeConfig.urls.ipfs}/${user?.profileImage}` : + `${publicRuntimeConfig.urls.ipfs}/${user?.profileImage}` : `${homeUrl}/images/meta-thumbnail.jpeg`; const about = removeMarkdown(user?.about?.substring(0, 160).trimEnd()); let title = truncateAddress(user?.address); diff --git a/services/chain-id.ts b/services/chain-id.ts index 753944f646..42801132ad 100644 --- a/services/chain-id.ts +++ b/services/chain-id.ts @@ -3,8 +3,6 @@ import getConfig from "next/config"; import {WinStorage} from "services/win-storage"; -import {baseApiImgUrl} from "./api"; - const { publicRuntimeConfig } = getConfig(); async function getChainIconsList() { @@ -35,7 +33,7 @@ async function getChainIcon(iconName: string) { if (found && found.icons.length) { const urlWithoutProtocol = found.icons[0].url.replace("ipfs://", ""); - return new URL(`/ipfs/${urlWithoutProtocol}`, baseApiImgUrl.concat("/", ipfsUrl)).href; + return new URL(`/ipfs/${urlWithoutProtocol}`, ipfsUrl).href; } return undefined;