Skip to content

Commit

Permalink
public image paths fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitmalhotra1420 committed May 20, 2024
1 parent 19d6d95 commit cb5f3af
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 55 deletions.
7 changes: 4 additions & 3 deletions src/components/ChainIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useAccount } from 'hooks';
import { SpanV2 } from './reusables/SharedStylingV2';
import { ErrorContext } from 'contexts/ErrorContext';
import { useClickAway } from 'hooks/useClickAway.js';
import { getPublicAssetPath } from 'helpers/RoutesHelper.js';

const ChainIndicator = ({ isDarkMode }) => {
const toggleArrowRef = useRef(null);
Expand All @@ -34,7 +35,7 @@ const ChainIndicator = ({ isDarkMode }) => {
id: chainId,
value: chainName,
title: chainName,
icon: `./svg/${LOGO_FROM_CHAIN_ID[chainId]}`,
icon: getPublicAssetPath(`svg/${LOGO_FROM_CHAIN_ID[chainId]}`),
function: () => {
switchChain(chainId);
setShowDropdown(false);
Expand All @@ -61,7 +62,7 @@ const ChainIndicator = ({ isDarkMode }) => {
>
<CurrentChainInfo>
<Image
src={`/svg/${LOGO_FROM_CHAIN_ID[currentChainId]}`}
src={getPublicAssetPath(`svg/${LOGO_FROM_CHAIN_ID[currentChainId]}`)}
width="24px"
height="24px"
/>
Expand All @@ -72,7 +73,7 @@ const ChainIndicator = ({ isDarkMode }) => {
<img
alt="arrow"
className={`${showDropdown ? 'down' : 'up'}`}
src="/svg/arrow.svg"
src={getPublicAssetPath('svg/arrow.svg')}
/>
</ToggleArrowImg>
</CurrentChain>
Expand Down
7 changes: 4 additions & 3 deletions src/components/ChainsSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Dropdown from './Dropdown';
// Internal Configs
import { appConfig, CHAIN_DETAILS } from 'config/index.js';
import { LOGO_FROM_CHAIN_ID } from 'helpers/UtilityHelper';
import { getPublicAssetPath } from 'helpers/RoutesHelper';

// Faucet URLs
const ChainsSelect = ({ channelsNetworkId, setChannelsNetworkId }) => {
Expand All @@ -33,7 +34,7 @@ const ChainsSelect = ({ channelsNetworkId, setChannelsNetworkId }) => {
id: chainId,
value: CHAIN_DETAILS[chainId].label,
title: CHAIN_DETAILS[chainId].label,
icon: `./svg/${LOGO_FROM_CHAIN_ID[chainId]}`,
icon: getPublicAssetPath(`svg/${LOGO_FROM_CHAIN_ID[chainId]}`),
function: () => {
setChannelsNetworkId(chainId);
setShowDropdown(false);
Expand All @@ -53,7 +54,7 @@ const ChainsSelect = ({ channelsNetworkId, setChannelsNetworkId }) => {
>
<ItemH padding="0 8px 0 0">
<Image
src={`./svg/${LOGO_FROM_CHAIN_ID[channelsNetworkId]}`}
src={getPublicAssetPath(`svg/${LOGO_FROM_CHAIN_ID[channelsNetworkId]}`)}
alt="active chain"
width="32px"
height="32px"
Expand All @@ -69,7 +70,7 @@ const ChainsSelect = ({ channelsNetworkId, setChannelsNetworkId }) => {
<img
alt="arrow"
className={`${showDropdown ? 'down' : 'up'}`}
src="/svg/arrow.svg"
src={getPublicAssetPath('svg/arrow.svg')}
/>
</ToggleArrowImg>
</Faucet>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Faucets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const Faucets = () => {
<img
alt="arrow"
className={`${showDropdown ? 'down' : 'up'}`}
src={getPublicAssetPath('/svg/arrow.svg')}
src={getPublicAssetPath('svg/arrow.svg')}
/>
</ToggleArrowImg>
</Faucet>
Expand Down
17 changes: 9 additions & 8 deletions src/components/ViewChannelItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import VerifiedTooltipContent from './VerifiedTooltipContent';
import APP_PATHS from 'config/AppPaths';
import { addresses, appConfig, CHAIN_DETAILS } from 'config/index.js';
import { IPFSGateway } from 'helpers/IpfsHelper';
import { getPublicAssetPath } from 'helpers/RoutesHelper';

// Create Header
function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, profileType }) {
Expand Down Expand Up @@ -539,7 +540,7 @@ function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, p
{channelObject && channelObject?.channel && (
<Span padding="0 0 0 5px">
<Image
src={`./svg/Ethereum.svg`}
src={getPublicAssetPath('svg/Ethereum.svg')}
alt="Ethereum"
width="20px"
height="20px"
Expand All @@ -553,9 +554,9 @@ function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, p
!MaskedAliasChannels[+channelObject?.alias_blockchain_id][channelObject?.channel] && (
<Span padding="0 0 0 5px">
<Image
src={`./svg/${
CHAIN_DETAILS[+channelObject.alias_blockchain_id]?.label?.split(' ')[0]
}.svg`}
src={getPublicAssetPath(
`svg/${CHAIN_DETAILS[+channelObject.alias_blockchain_id]?.label?.split(' ')[0]}.svg`
)}
alt="Polygon"
width="20px"
height="20px"
Expand Down Expand Up @@ -712,7 +713,7 @@ function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, p
{channelObject && channelObject?.channel && (
<Span padding="0 0 0 5px">
<Image
src={`./svg/Ethereum.svg`}
src={getPublicAssetPath('svg/Ethereum.svg')}
alt="Ethereum"
width="20px"
height="20px"
Expand All @@ -726,7 +727,7 @@ function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, p
!MaskedAliasChannels[+channelObject?.alias_blockchain_id][channelObject?.channel] && (
<Span padding="0 0 0 5px">
<Image
src={`./svg/${LOGO_FROM_CHAIN_ID[+channelObject.alias_blockchain_id]}`}
src={getPublicAssetPath(`svg/${LOGO_FROM_CHAIN_ID[+channelObject.alias_blockchain_id]}`)}
alt="Alias Chain Logo"
width="20px"
height="20px"
Expand Down Expand Up @@ -801,7 +802,7 @@ function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, p
<MetaInfoDisplayer
externalIcon={
<Image
src="./svg/users.svg"
src={getPublicAssetPath('svg/users.svg')}
alt="users"
width="14px"
height="14px"
Expand Down Expand Up @@ -1002,7 +1003,7 @@ function ViewChannelItem({ channelObjectProp, loadTeaser, playTeaser, minimal, p
<ActionTitle hideit={txInProgress}>Manage</ActionTitle>
<ImageV2
alt="arrow"
src="/svg/arrow.svg"
src={getPublicAssetPath('svg/arrow.svg')}
height="10px"
width="12px"
/>
Expand Down
7 changes: 4 additions & 3 deletions src/components/channel/ChannelProfileComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ButtonV2 } from 'components/reusables/SharedStylingV2';
import { IPFSGateway } from 'helpers/IpfsHelper';
import axios from 'axios';
import MetaInfoDisplayer from 'components/MetaInfoDisplayer';
import { getPublicAssetPath } from 'helpers/RoutesHelper';

const ChannelProfileComponent = ({ channelID, channelDetails }) => {
const themes = useTheme();
Expand Down Expand Up @@ -177,7 +178,7 @@ const ChannelProfileComponent = ({ channelID, channelDetails }) => {
{channelDetails && channelDetails?.channel && (
<Span padding="0 0 0 5px">
<Image
src={`./svg/Ethereum.svg`}
src={getPublicAssetPath('svg/Ethereum.svg')}
alt="Ethereum"
width="20px"
height="20px"
Expand All @@ -191,7 +192,7 @@ const ChannelProfileComponent = ({ channelID, channelDetails }) => {
!MaskedAliasChannels[+channelDetails?.alias_blockchain_id][channelDetails?.channel] && (
<Span padding="0 0 0 5px">
<Image
src={`./svg/${LOGO_FROM_CHAIN_ID[+channelDetails.alias_blockchain_id]}`}
src={getPublicAssetPath(`svg/${LOGO_FROM_CHAIN_ID[+channelDetails.alias_blockchain_id]}`)}
alt="Alias Chain Logo"
width="20px"
height="20px"
Expand Down Expand Up @@ -265,7 +266,7 @@ const ChannelProfileComponent = ({ channelID, channelDetails }) => {
<MetaInfoDisplayer
externalIcon={
<Image
src="./svg/users.svg"
src={getPublicAssetPath('svg/users.svg')}
alt="users"
width="14px"
height="14px"
Expand Down
9 changes: 5 additions & 4 deletions src/components/chat/w2wChat/TypeBar/Typebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import GifPicker from './Gifs/GifPicker';
// Internal configs
import { MessagetypeType } from '../../../../types/chat';
import { filterXSS } from 'xss';
import { getPublicAssetPath } from 'helpers/RoutesHelper';

interface ITypeBar {
isGroup: boolean;
Expand Down Expand Up @@ -178,7 +179,7 @@ const Typebar = ({
filter={theme.snackbarBorderIcon}
>
<img
src="/svg/chats/smiley.svg"
src={getPublicAssetPath('svg/chats/smiley.svg')}
height="24px"
width="24px"
alt=""
Expand Down Expand Up @@ -228,7 +229,7 @@ const Typebar = ({
filter={theme.snackbarBorderIcon}
>
<img
src="/svg/chats/gif.svg"
src={getPublicAssetPath('svg/chats/gif.svg')}
height="18px"
width="22px"
alt=""
Expand All @@ -239,7 +240,7 @@ const Typebar = ({
<label>
<Icon filter={theme.snackbarBorderIcon}>
<img
src="/svg/chats/attachment.svg"
src={getPublicAssetPath('svg/chats/attachment.svg')}
height="24px"
width="20px"
alt=""
Expand Down Expand Up @@ -268,7 +269,7 @@ const Typebar = ({
<>
<Icon onClick={handleSubmit}>
<img
src={`/svg/chats/send${isDarkMode ? '_dark' : ''}.svg`}
src={getPublicAssetPath(`svg/chats/send${isDarkMode ? '_dark' : ''}.svg`)}
height="27px"
width="27px"
alt=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ImageV2, ItemHV2, ItemVV2, SpanV2 } from 'components/reusables/SharedSt
import { shortenText } from 'helpers/UtilityHelper';
import { Context } from 'modules/chat/ChatModule';
import { AppContext } from 'types/chat';
import { getPublicAssetPath } from 'helpers/RoutesHelper';

export const PendingMembers = ({ setshowPendingRequests, showPendingRequests }) => {
const { currentChat }: AppContext = useContext<AppContext>(Context);
Expand Down Expand Up @@ -49,7 +50,7 @@ export const PendingMembers = ({ setshowPendingRequests, showPendingRequests })
<img
alt="arrow"
className={`${showPendingRequests ? 'down' : 'up'}`}
src="/svg/arrow.svg"
src={getPublicAssetPath('svg/arrow.svg')}
/>
</ToggleArrowImg>
</ItemHV2>
Expand Down
4 changes: 3 additions & 1 deletion src/components/chat/w2wChat/messageFeed/MessageFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { checkIfGroup, getChatsnapMessage, getGroupImage, getName } from '../../
import { getDefaultFeed } from '../../../../helpers/w2w/user';
import { useAccount } from 'hooks';
import { AppContext } from 'contexts/AppContext';
import { getPublicAssetPath } from 'helpers/RoutesHelper';

// Internal Configs

Expand Down Expand Up @@ -260,7 +261,8 @@ const MessageFeed = (props: MessageFeedPropsI): JSX.Element => {
<>
{!feeds?.length && !messagesLoading && activeTab !== 3 && activeTab !== 4 ? (
<EmptyConnection>
Start a new chat by using the + button <ArrowBend src="/svg/chats/arrowbendup.svg" />
Start a new chat by using the + button{' '}
<ArrowBend src={getPublicAssetPath('svg/chats/arrowbendup.svg')} />
</EmptyConnection>
) : (
feeds.map((feed: Feeds, i) => (
Expand Down
7 changes: 4 additions & 3 deletions src/modules/claimGalxe/ClaimGalxeModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'react-toastify/dist/ReactToastify.min.css';
// Internal Configs
import { abis, addresses, appConfig, CHAIN_DETAILS } from 'config/index.js';
import GLOBALS, { device, globalsMargin } from 'config/Globals';
import { getPublicAssetPath } from 'helpers/RoutesHelper';

const ClaimGalxeModule = () => {
const theme = useTheme();
Expand Down Expand Up @@ -149,7 +150,7 @@ const ClaimGalxeModule = () => {
<ClaimInnerContainer>
<ClaimLeftContainer>
<GalxeImg
src={`./svg/${theme.scheme === 'light' ? 'GalxeLight.svg' : 'GalxeDark.svg'}`}
src={getPublicAssetPath(`svg/${theme.scheme === 'light' ? 'GalxeLight.svg' : 'GalxeDark.svg'}`)}
height="1.5rem"
width="9rem"
padding="0 0 1.5rem 0"
Expand Down Expand Up @@ -193,8 +194,8 @@ const ClaimGalxeModule = () => {
</ClaimLeftContainer>
<AlphaImageContainer>
<AlphaImageInnerContainer>
<AlphaAccessTextImg src={'./svg/AccessNFTText.svg'} />
<AlphaAccessImg src={'./svg/AccessNFT.svg'} />
<AlphaAccessTextImg src={getPublicAssetPath('svg/AccessNFTText.svg')} />
<AlphaAccessImg src={getPublicAssetPath('svg/AccessNFT.svg')} />
</AlphaImageInnerContainer>
</AlphaImageContainer>
</ClaimInnerContainer>
Expand Down
3 changes: 2 additions & 1 deletion src/primaries/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { AppContext } from 'contexts/AppContext';
import { ErrorContext } from 'contexts/ErrorContext';
import { GlobalContext, GlobalContextType, ReadOnlyWalletMode } from 'contexts/GlobalContext';
import { AppContextType } from 'types/context';
import { getPublicAssetPath } from 'helpers/RoutesHelper.js';

// Create Header
const Profile = ({ isDarkMode }: { isDarkMode: boolean }) => {
Expand Down Expand Up @@ -131,7 +132,7 @@ const Profile = ({ isDarkMode }: { isDarkMode: boolean }) => {
<img
alt="arrow"
className={`${showDropdown ? 'down' : 'up'}`}
src="/svg/arrow.svg"
src={getPublicAssetPath('svg/arrow.svg')}
/>
</ToggleArrowImg>
</Wallet>
Expand Down
Loading

0 comments on commit cb5f3af

Please sign in to comment.