diff --git a/scripts/generate-manifest.js b/scripts/generate-manifest.js index 877d5ef8b6c..498eac28e6a 100644 --- a/scripts/generate-manifest.js +++ b/scripts/generate-manifest.js @@ -30,10 +30,15 @@ const environmentIcons = { }, }; +const devCsp = + "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; frame-src https://ordinals.com/; frame-ancestors 'none';"; + +const prodCsp = `default-src 'none'; connect-src *; style-src 'unsafe-inline'; img-src 'self' data: https:; script-src 'self' 'wasm-unsafe-eval'; object-src 'none'; frame-src https://ordinals.com/; frame-ancestors 'none';`; + const contentSecurityPolicyEnvironment = { - development: - "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; frame-src 'none'; frame-ancestors 'none';", - production: `default-src 'none'; connect-src *; style-src 'unsafe-inline'; img-src 'self' data: https:; script-src 'self' 'wasm-unsafe-eval'; object-src 'none'; frame-src 'none'; frame-ancestors 'none';`, + testing: prodCsp, + development: devCsp, + production: prodCsp, }; const defaultIconEnvironment = { diff --git a/src/app/features/collectibles/components/_collectible-types/collectible-audio.tsx b/src/app/features/collectibles/components/_collectible-types/collectible-audio.tsx new file mode 100644 index 00000000000..3688d5b3037 --- /dev/null +++ b/src/app/features/collectibles/components/_collectible-types/collectible-audio.tsx @@ -0,0 +1,19 @@ +import { ReactNode } from 'react'; + +import { AudioIcon } from '@app/ui/components/icons/audio-icon'; + +import { CollectibleItemLayout, CollectibleItemLayoutProps } from '../collectible-item.layout'; +import { CollectiblePlaceholderLayout } from './collectible-placeholder.layout'; + +interface CollectibleAudioProps extends Omit { + icon: ReactNode; +} +export function CollectibleAudio({ icon, ...props }: CollectibleAudioProps) { + return ( + + + + + + ); +} diff --git a/src/app/features/collectibles/components/_collectible-types/collectible-iframe.tsx b/src/app/features/collectibles/components/_collectible-types/collectible-iframe.tsx new file mode 100644 index 00000000000..4b413b68dda --- /dev/null +++ b/src/app/features/collectibles/components/_collectible-types/collectible-iframe.tsx @@ -0,0 +1,35 @@ +import { ReactNode, useState } from 'react'; + +import { Iframe } from '@app/ui/components/iframe'; + +import { CollectibleItemLayout, CollectibleItemLayoutProps } from '../collectible-item.layout'; +import { ImageUnavailable } from '../image-unavailable'; + +interface CollectibleIframeProps extends Omit { + icon: ReactNode; + src: string; +} +export function CollectibleIframe({ icon, src, ...props }: CollectibleIframeProps) { + const [isError, setIsError] = useState(false); + + if (isError) + return ( + + + + ); + + return ( + +