Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions components/avatar-or-identicon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -50,7 +48,7 @@ export default function AvatarOrIdenticon({
<Avatar
userLogin={handle}
size={size}
src={`${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${avatar}?width=100&height=100`}
src={`${publicRuntimeConfig?.urls?.ipfs}/${avatar}?width=100&height=100`}
className="border-primary"
/>
</If>
Expand Down
4 changes: 1 addition & 3 deletions components/bounties/select-network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,7 +68,7 @@ export default function SelectNetwork({
value: network,
preIcon: (
<NetworkLogo
src={`${baseApiImgUrl}/${settings?.urls?.ipfs}/${network?.logoIcon}`}
src={`${settings?.urls?.ipfs}/${network?.logoIcon}`}
alt={`${network?.name} logo`}
isBepro={network?.name.toLowerCase() === 'bepro'}
size="sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {Network} from "interfaces/network";

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

import {baseApiImgUrl} from "../../../services/api";

interface SelectNetworkDropdownProps {
value?: Network;
onSelect: (network: Network) => void;
Expand Down Expand Up @@ -51,7 +49,7 @@ export default function CreateBountyNetworkDropdown({
label: network?.name,
preIcon: (
<img
src={`${baseApiImgUrl}/${settings?.urls?.ipfs}/${network?.logoIcon}?width=16&height=16`}
src={`${settings?.urls?.ipfs}/${network?.logoIcon}?width=16&height=16`}
alt={`${network?.name} logo`}
width={16}
height={16}
Expand Down
3 changes: 1 addition & 2 deletions components/chain-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import getConfig from "next/config";

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

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

Expand Down Expand Up @@ -32,7 +31,7 @@ export default function ChainIcon({
const chainIcon = src && ipfsUrl ?
<img
className={`rounded-circle ${className}`}
src={`${baseApiImgUrl}/${ipfsUrl}/${src}?width=${size}&height=${size}${imgFormat ? `&format=${imgFormat}` : ""}`}
src={`${ipfsUrl}/${src}?width=${size}&height=${size}${imgFormat ? `&format=${imgFormat}` : ""}`}
height={size}
width={size}
/> :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,7 +15,7 @@ export default function MarketplaceWithNetworkLogo ({
return(
<div className="position-relative">
<NetworkLogo
src={`${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${marketplaceLogo}`}
src={`${publicRuntimeConfig?.urls?.ipfs}/${marketplaceLogo}`}
shape="square"
size="lg"
noBg
Expand Down
4 changes: 1 addition & 3 deletions components/lists/filters/marketplace/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import {SelectOption} from "types/utils";
import useBreakPoint from "x-hooks/use-breakpoint";
import useQueryFilter from "x-hooks/use-query-filter";

import {baseApiImgUrl} from "../../../../services/api";

const { publicRuntimeConfig } = getConfig();
export default function MarketplaceFilter({
marketplaces,
Expand All @@ -36,7 +34,7 @@ export default function MarketplaceFilter({
value: marketplace?.name,
label: marketplace?.name,
preIcon: <NetworkLogo
src={`${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${marketplace?.logoIcon}`}
src={`${publicRuntimeConfig?.urls?.ipfs}/${marketplace?.logoIcon}`}
alt={`${marketplace?.name} logo`}
size="sm"
noBg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {formatNumberToNScale} from "helpers/formatNumber";

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

import {baseApiImgUrl} from "../../../../services/api";

type MarketplaceListItemProps = {
marketplace: GroupedMarketplace
};
Expand Down Expand Up @@ -79,7 +77,7 @@ export function MarketplaceListItem({
<ResponsiveListItem
icon={
<NetworkLogo
src={`${baseApiImgUrl}/${settings?.urls?.ipfs}/${marketplace?.logoIcon}?format=svg`}
src={`${settings?.urls?.ipfs}/${marketplace?.logoIcon}?format=svg`}
shape="square"
size="lg"
noBg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { IssueData } from "interfaces/issue-data";

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

import {baseApiImgUrl} from "../../../../services/api";

interface NftsListItemProps {
nft: IssueData
}
Expand All @@ -17,7 +15,7 @@ export default function NftsListItem ({

const transactionHash = nft?.payments?.at(0)?.transactionHash;
const imageUrl =
nft?.nftImage ? `${baseApiImgUrl}/${settings?.urls?.ipfs}/${nft?.nftImage}` : null;
nft?.nftImage ? `${settings?.urls?.ipfs}/${nft?.nftImage}` : null;
const transactionUrl = `${nft?.network?.chain?.blockScanner}/${transactionHash}`;
const taskUrl = `/${nft?.network?.name?.toLowerCase()}/task/${nft?.id}`;

Expand Down
3 changes: 1 addition & 2 deletions components/navigation/navbar/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import useMarketplace from "x-hooks/use-marketplace";
import {useSettings} from "x-hooks/use-settings";
import useSupportedChain from "x-hooks/use-supported-chain";

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

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

const isOnNetwork = pathname?.includes("[network]");
const logoPath = baseApiImgUrl.concat("/", settings?.urls?.ipfs);
const logoPath = settings?.urls?.ipfs;
const logos = {
fullLogo: activeMarketplace?.fullLogo && `${logoPath}/${activeMarketplace.fullLogo}`,
logoIcon: activeMarketplace?.logoIcon && `${logoPath}/${activeMarketplace.logoIcon}`
Expand Down
4 changes: 1 addition & 3 deletions components/network/settings/logo-and-colors/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ import {useUserStore} from "x-hooks/stores/user/user.store";
import useNetworkTheme from "x-hooks/use-network-theme";
import useReactQueryMutation from "x-hooks/use-react-query-mutation";

import {baseApiImgUrl} from "../../../../services/api";


const { publicRuntimeConfig } = getConfig();

const MAX_LOGOS_SIZE_LIMIT_IN_MB = 1;

const getDefaultIconValue = (hash: string) => ({
value: {
preview: `${baseApiImgUrl}/${publicRuntimeConfig?.urls?.ipfs}/${hash}`,
preview: `${publicRuntimeConfig?.urls?.ipfs}/${hash}`,
raw: null,
},
validated: null,
Expand Down
4 changes: 1 addition & 3 deletions components/networks-list/network-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -62,7 +60,7 @@ export default function NetworkListItem({
onClick={onClick}
icon={
<NetworkLogo
src={`${baseApiImgUrl}/${settings?.urls?.ipfs}/${network?.logoIcon}`}
src={`${settings?.urls?.ipfs}/${network?.logoIcon}`}
alt={`${network?.name} logo`}
isBepro={network?.name.toLowerCase() === 'bepro'}
noBg
Expand Down
4 changes: 1 addition & 3 deletions components/seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {useRouter} from "next/router";

import {IssueData} from "interfaces/issue-data";

import {baseApiImgUrl} from "../services/api";

const { publicRuntimeConfig } = getConfig();

interface ISeoProps {
Expand All @@ -27,7 +25,7 @@ const Seo: React.FC<ISeoProps> = ({ 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());

Expand Down
4 changes: 1 addition & 3 deletions contexts/network-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<NetworkSettings | undefined>(undefined);

const ALLOWED_PATHS = [
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions pages/profile/[identifier].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions services/chain-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
Expand Down