Skip to content

Commit

Permalink
refactor: revert exports for hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
panteleymonchuk committed Dec 24, 2024
1 parent 8cf12c3 commit 02952d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/core/src/hooks/useFileExtensionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const extractFileType = async (imgUrl: string) => {
});
};
*/
export function useFileExtensionType(url: string) {
export default function useFileExtensionType(url: string) {
if (!url) return { name: '', type: '' };
const fileType = url.split('.').pop() || '';
return FILE_EXTENSION_TYPE_MAP[fileType] || { name: '', type: '' };
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/hooks/useMediaUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useMemo } from 'react';

const parseIpfsUrl = (ipfsUrl: string) => ipfsUrl.replace(/^ipfs:\/\//, 'https://ipfs.io/ipfs/');

export function useMediaUrl(objData: IotaParsedData | null) {
export default function useMediaUrl(objData: IotaParsedData | null) {
const { fields } =
((objData?.dataType === 'moveObject' && objData) as {
fields: { url?: string; metadata?: { fields: { url: string } } };
Expand Down
4 changes: 2 additions & 2 deletions apps/core/src/hooks/useNFTBasicData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import type { IotaObjectData } from '@iota/iota-sdk/client';

import { useFileExtensionType } from './useFileExtensionType';
import { useMediaUrl } from './useMediaUrl';
import useFileExtensionType from './useFileExtensionType';
import useMediaUrl from './useMediaUrl';

export function useNFTBasicData(nftObj: IotaObjectData | null) {
const nftObjectID = nftObj?.objectId || null;
Expand Down

0 comments on commit 02952d4

Please sign in to comment.