Skip to content

Commit 74c5713

Browse files
authored
Merge pull request #516 from layerx-labs/vhc-remove-cdn-usage
refactor: dont use cdn
2 parents 6091f9d + bd622b1 commit 74c5713

15 files changed

Lines changed: 15 additions & 42 deletions

File tree

components/avatar-or-identicon.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {truncateAddress} from "helpers/truncate-address";
99
import {User} from "interfaces/api";
1010
import {SizeOptions} from "interfaces/utils";
1111

12-
import {baseApiImgUrl} from "../services/api";
13-
1412
export interface AvatarOrIdenticonProps {
1513
user: User | { address: string; handle?: string; avatar?: string; };
1614
size?: SizeOptions | number;
@@ -50,7 +48,7 @@ export default function AvatarOrIdenticon({
5048
<Avatar
5149
userLogin={handle}
5250
size={size}
53-
src={`${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${avatar}?width=100&height=100`}
51+
src={`${publicRuntimeConfig?.urls?.ipfs}/${avatar}?width=100&height=100`}
5452
className="border-primary"
5553
/>
5654
</If>

components/bounties/select-network.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import useReactQuery from "x-hooks/use-react-query";
2323
import {useSettings} from "x-hooks/use-settings";
2424
import useSupportedChain from "x-hooks/use-supported-chain";
2525

26-
import {baseApiImgUrl} from "../../services/api";
27-
2826
interface SelectNetworkProps {
2927
isCurrentDefault?: boolean;
3028
onlyProfileFilters?: boolean;
@@ -70,7 +68,7 @@ export default function SelectNetwork({
7068
value: network,
7169
preIcon: (
7270
<NetworkLogo
73-
src={`${baseApiImgUrl}/${settings?.urls?.ipfs}/${network?.logoIcon}`}
71+
src={`${settings?.urls?.ipfs}/${network?.logoIcon}`}
7472
alt={`${network?.name} logo`}
7573
isBepro={network?.name.toLowerCase() === 'bepro'}
7674
size="sm"

components/bounty/create-bounty/create-bounty-network-dropdown.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import {Network} from "interfaces/network";
1010

1111
import {useSettings} from "x-hooks/use-settings";
1212

13-
import {baseApiImgUrl} from "../../../services/api";
14-
1513
interface SelectNetworkDropdownProps {
1614
value?: Network;
1715
onSelect: (network: Network) => void;
@@ -51,7 +49,7 @@ export default function CreateBountyNetworkDropdown({
5149
label: network?.name,
5250
preIcon: (
5351
<img
54-
src={`${baseApiImgUrl}/${settings?.urls?.ipfs}/${network?.logoIcon}?width=16&height=16`}
52+
src={`${settings?.urls?.ipfs}/${network?.logoIcon}?width=16&height=16`}
5553
alt={`${network?.name} logo`}
5654
width={16}
5755
height={16}

components/chain-icon.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import getConfig from "next/config";
44

55
import QuestionMarkIcon from "assets/icons/question-mark-icon";
66

7-
import {baseApiImgUrl} from "../services/api";
87
import If from "./If";
98
import ResponsiveWrapper from "./responsive-wrapper";
109

@@ -32,7 +31,7 @@ export default function ChainIcon({
3231
const chainIcon = src && ipfsUrl ?
3332
<img
3433
className={`rounded-circle ${className}`}
35-
src={`${baseApiImgUrl}/${ipfsUrl}/${src}?width=${size}&height=${size}${imgFormat ? `&format=${imgFormat}` : ""}`}
34+
src={`${ipfsUrl}/${src}?width=${size}&height=${size}${imgFormat ? `&format=${imgFormat}` : ""}`}
3635
height={size}
3736
width={size}
3837
/> :

components/common/marketplace-with-network-logo/marketplace-with-network-logo.view.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import getConfig from "next/config";
33
import ChainIcon from "components/chain-icon";
44
import NetworkLogo from "components/network-logo";
55

6-
import {baseApiImgUrl} from "../../../services/api";
7-
86
const {publicRuntimeConfig} = getConfig();
97
interface MarketplaceWithNetworkLogoProps {
108
networkLogo: string;
@@ -17,7 +15,7 @@ export default function MarketplaceWithNetworkLogo ({
1715
return(
1816
<div className="position-relative">
1917
<NetworkLogo
20-
src={`${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${marketplaceLogo}`}
18+
src={`${publicRuntimeConfig?.urls?.ipfs}/${marketplaceLogo}`}
2119
shape="square"
2220
size="lg"
2321
noBg

components/lists/filters/marketplace/controller.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import {SelectOption} from "types/utils";
1414
import useBreakPoint from "x-hooks/use-breakpoint";
1515
import useQueryFilter from "x-hooks/use-query-filter";
1616

17-
import {baseApiImgUrl} from "../../../../services/api";
18-
1917
const { publicRuntimeConfig } = getConfig();
2018
export default function MarketplaceFilter({
2119
marketplaces,
@@ -36,7 +34,7 @@ export default function MarketplaceFilter({
3634
value: marketplace?.name,
3735
label: marketplace?.name,
3836
preIcon: <NetworkLogo
39-
src={`${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${marketplace?.logoIcon}`}
37+
src={`${publicRuntimeConfig?.urls?.ipfs}/${marketplace?.logoIcon}`}
4038
alt={`${marketplace?.name} logo`}
4139
size="sm"
4240
noBg

components/lists/marketplaces/marketplace-list-item/marketplace-list-item.view.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import {formatNumberToNScale} from "helpers/formatNumber";
1111

1212
import {useSettings} from "x-hooks/use-settings";
1313

14-
import {baseApiImgUrl} from "../../../../services/api";
15-
1614
type MarketplaceListItemProps = {
1715
marketplace: GroupedMarketplace
1816
};
@@ -79,7 +77,7 @@ export function MarketplaceListItem({
7977
<ResponsiveListItem
8078
icon={
8179
<NetworkLogo
82-
src={`${baseApiImgUrl}/${settings?.urls?.ipfs}/${marketplace?.logoIcon}?format=svg`}
80+
src={`${settings?.urls?.ipfs}/${marketplace?.logoIcon}?format=svg`}
8381
shape="square"
8482
size="lg"
8583
noBg

components/lists/nfts/nfts-list-item/nfts-list-item.controller.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { IssueData } from "interfaces/issue-data";
44

55
import {useSettings} from "x-hooks/use-settings";
66

7-
import {baseApiImgUrl} from "../../../../services/api";
8-
97
interface NftsListItemProps {
108
nft: IssueData
119
}
@@ -17,7 +15,7 @@ export default function NftsListItem ({
1715

1816
const transactionHash = nft?.payments?.at(0)?.transactionHash;
1917
const imageUrl =
20-
nft?.nftImage ? `${baseApiImgUrl}/${settings?.urls?.ipfs}/${nft?.nftImage}` : null;
18+
nft?.nftImage ? `${settings?.urls?.ipfs}/${nft?.nftImage}` : null;
2119
const transactionUrl = `${nft?.network?.chain?.blockScanner}/${transactionHash}`;
2220
const taskUrl = `/${nft?.network?.name?.toLowerCase()}/task/${nft?.id}`;
2321

components/navigation/navbar/controller.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import useMarketplace from "x-hooks/use-marketplace";
99
import {useSettings} from "x-hooks/use-settings";
1010
import useSupportedChain from "x-hooks/use-supported-chain";
1111

12-
import {baseApiImgUrl} from "../../../services/api";
1312
import {userPointsOfUser} from "../../../x-hooks/use-points-of-user";
1413

1514
export default function NavBar() {
@@ -21,7 +20,7 @@ export default function NavBar() {
2120
const { active: activeMarketplace, getURLWithNetwork } = useMarketplace();
2221

2322
const isOnNetwork = pathname?.includes("[network]");
24-
const logoPath = baseApiImgUrl.concat("/", settings?.urls?.ipfs);
23+
const logoPath = settings?.urls?.ipfs;
2524
const logos = {
2625
fullLogo: activeMarketplace?.fullLogo && `${logoPath}/${activeMarketplace.fullLogo}`,
2726
logoIcon: activeMarketplace?.logoIcon && `${logoPath}/${activeMarketplace.logoIcon}`

components/network/settings/logo-and-colors/controller.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ import {useUserStore} from "x-hooks/stores/user/user.store";
1616
import useNetworkTheme from "x-hooks/use-network-theme";
1717
import useReactQueryMutation from "x-hooks/use-react-query-mutation";
1818

19-
import {baseApiImgUrl} from "../../../../services/api";
20-
2119

2220
const { publicRuntimeConfig } = getConfig();
2321

2422
const MAX_LOGOS_SIZE_LIMIT_IN_MB = 1;
2523

2624
const getDefaultIconValue = (hash: string) => ({
2725
value: {
28-
preview: `${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${hash}`,
26+
preview: `${publicRuntimeConfig?.urls?.ipfs}/${hash}`,
2927
raw: null,
3028
},
3129
validated: null,

0 commit comments

Comments
 (0)