diff --git a/README.md b/README.md index eb77f2b1..ce7c1a23 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Snort +## Snort Snort is a nostr UI built with React, Snort intends to be fast and effecient @@ -13,7 +13,7 @@ Snort supports the following NIP's - [x] NIP-08: Handling Mentions - [x] NIP-09: Event Deletion - [x] NIP-10: Conventions for clients' use of `e` and `p` tags in text events -- [x] NIP-11: Relay Information Document +- [ ] NIP-11: Relay Information Document - [x] NIP-12: Generic Tag Queries - [ ] NIP-13: Proof of Work - [ ] NIP-14: Subject tag in text events diff --git a/public/index.html b/public/index.html index 69769402..37d8c801 100644 --- a/public/index.html +++ b/public/index.html @@ -8,7 +8,7 @@ + content="default-src 'self'; child-src 'none'; worker-src 'self'; frame-src youtube.com www.youtube.com https://platform.twitter.com https://embed.tidal.com https://w.soundcloud.com https://www.mixcloud.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; connect-src wss://* 'self' https://*; img-src * data:; font-src https://fonts.gstatic.com; media-src *; script-src 'self' https://static.cloudflareinsights.com https://platform.twitter.com https://embed.tidal.com;" /> diff --git a/src/Const.ts b/src/Const.ts index 3a1d20d3..d8f0827e 100644 --- a/src/Const.ts +++ b/src/Const.ts @@ -1,10 +1,5 @@ import { RelaySettings } from "Nostr/Connection"; -/** - * Add-on api for snort features - */ -export const ApiHost = "https://api.snort.social"; - /** * Websocket re-connect timeout */ @@ -98,4 +93,11 @@ export const TidalRegex = /tidal\.com\/(?:browse\/)?(\w+)\/([a-z0-9-]+)/i; /** * SoundCloud regex */ + export const SoundCloudRegex = /soundcloud\.com\/(?!live)([a-zA-Z0-9]+)\/([a-zA-Z0-9-]+)/ + +/** + * Mixcloud regex + */ + +export const MixCloudRegex = /mixcloud\.com\/(?!live)([a-zA-Z0-9]+)\/([a-zA-Z0-9-]+)/ \ No newline at end of file diff --git a/src/Element/MixCloudEmbed.tsx b/src/Element/MixCloudEmbed.tsx new file mode 100644 index 00000000..8812b65e --- /dev/null +++ b/src/Element/MixCloudEmbed.tsx @@ -0,0 +1,27 @@ +import { MixCloudRegex } from "Const"; +import { useSelector } from "react-redux"; +import { RootState } from "State/Store"; + +const MixCloudEmbed = ({link}: {link: string}) => { + + const feedPath = (MixCloudRegex.test(link) && RegExp.$1) + "%2F" + ( MixCloudRegex.test(link) && RegExp.$2) + + const lightTheme = useSelector(s => s.login.preferences.theme === "light"); + + const lightParams = lightTheme ? "light=1" : "light=0"; + + return( + <> +
+