This commit is contained in:
parent
0f9f8ecb95
commit
b62519db31
@ -35,7 +35,6 @@
|
|||||||
"react-router-dom": "^6.5.0",
|
"react-router-dom": "^6.5.0",
|
||||||
"react-tag-input-component": "^2.0.2",
|
"react-tag-input-component": "^2.0.2",
|
||||||
"react-textarea-autosize": "^8.4.0",
|
"react-textarea-autosize": "^8.4.0",
|
||||||
"react-twitter-embed": "^4.0.4",
|
|
||||||
"recharts": "^2.8.0",
|
"recharts": "^2.8.0",
|
||||||
"three": "^0.157.0",
|
"three": "^0.157.0",
|
||||||
"use-long-press": "^3.2.0",
|
"use-long-press": "^3.2.0",
|
||||||
|
@ -93,11 +93,6 @@ export const InvoiceRegex = /(lnbc\w+)/i;
|
|||||||
export const YoutubeUrlRegex =
|
export const YoutubeUrlRegex =
|
||||||
/(?:https?:\/\/)?(?:www|m\.)?(?:youtu\.be\/|youtube\.com\/(?:live\/|shorts\/|embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/;
|
/(?:https?:\/\/)?(?:www|m\.)?(?:youtu\.be\/|youtube\.com\/(?:live\/|shorts\/|embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tweet Regex
|
|
||||||
*/
|
|
||||||
export const TweetUrlRegex = /https?:\/\/twitter\.com\/(?:#!\/)?(\w+)\/status(?:es)?\/(\d+)/;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hashtag regex
|
* Hashtag regex
|
||||||
*/
|
*/
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import { TwitterTweetEmbed } from "react-twitter-embed";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
YoutubeUrlRegex,
|
YoutubeUrlRegex,
|
||||||
TweetUrlRegex,
|
|
||||||
TidalRegex,
|
TidalRegex,
|
||||||
SoundCloudRegex,
|
SoundCloudRegex,
|
||||||
MixCloudRegex,
|
MixCloudRegex,
|
||||||
@ -37,7 +34,6 @@ export default function HyperText({ link, depth, showLinkPreview, children }: Hy
|
|||||||
try {
|
try {
|
||||||
const url = new URL(a);
|
const url = new URL(a);
|
||||||
const youtubeId = YoutubeUrlRegex.test(a) && RegExp.$1;
|
const youtubeId = YoutubeUrlRegex.test(a) && RegExp.$1;
|
||||||
const tweetId = TweetUrlRegex.test(a) && RegExp.$2;
|
|
||||||
const tidalId = TidalRegex.test(a) && RegExp.$1;
|
const tidalId = TidalRegex.test(a) && RegExp.$1;
|
||||||
const soundcloundId = SoundCloudRegex.test(a) && RegExp.$1;
|
const soundcloundId = SoundCloudRegex.test(a) && RegExp.$1;
|
||||||
const mixcloudId = MixCloudRegex.test(a) && RegExp.$1;
|
const mixcloudId = MixCloudRegex.test(a) && RegExp.$1;
|
||||||
@ -46,13 +42,8 @@ export default function HyperText({ link, depth, showLinkPreview, children }: Hy
|
|||||||
const isAppleMusicLink = AppleMusicRegex.test(a);
|
const isAppleMusicLink = AppleMusicRegex.test(a);
|
||||||
const isNostrNestsLink = NostrNestsRegex.test(a);
|
const isNostrNestsLink = NostrNestsRegex.test(a);
|
||||||
const isWavlakeLink = WavlakeRegex.test(a);
|
const isWavlakeLink = WavlakeRegex.test(a);
|
||||||
if (tweetId) {
|
|
||||||
return (
|
if (youtubeId) {
|
||||||
<div className="tweet" key={tweetId}>
|
|
||||||
<TwitterTweetEmbed tweetId={tweetId} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else if (youtubeId) {
|
|
||||||
return (
|
return (
|
||||||
<iframe
|
<iframe
|
||||||
className="w-max"
|
className="w-max"
|
||||||
|
@ -732,24 +732,6 @@ div.form-col {
|
|||||||
color: var(--gray-light);
|
color: var(--gray-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tweet {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tweet div {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tweet div .twitter-tweet {
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tweet div .twitter-tweet > iframe {
|
|
||||||
max-height: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 720px) {
|
@media (max-width: 720px) {
|
||||||
div.form {
|
div.form {
|
||||||
grid-auto-flow: dense;
|
grid-auto-flow: dense;
|
||||||
|
20
yarn.lock
20
yarn.lock
@ -2943,7 +2943,6 @@ __metadata:
|
|||||||
react-router-dom: ^6.5.0
|
react-router-dom: ^6.5.0
|
||||||
react-tag-input-component: ^2.0.2
|
react-tag-input-component: ^2.0.2
|
||||||
react-textarea-autosize: ^8.4.0
|
react-textarea-autosize: ^8.4.0
|
||||||
react-twitter-embed: ^4.0.4
|
|
||||||
recharts: ^2.8.0
|
recharts: ^2.8.0
|
||||||
rollup-plugin-visualizer: ^5.9.2
|
rollup-plugin-visualizer: ^5.9.2
|
||||||
tailwindcss: ^3.3.3
|
tailwindcss: ^3.3.3
|
||||||
@ -9188,18 +9187,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"react-twitter-embed@npm:^4.0.4":
|
|
||||||
version: 4.0.4
|
|
||||||
resolution: "react-twitter-embed@npm:4.0.4"
|
|
||||||
dependencies:
|
|
||||||
scriptjs: ^2.5.9
|
|
||||||
peerDependencies:
|
|
||||||
react: ^16.0.0 || ^17.0.0 || ^18.0.0
|
|
||||||
react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0
|
|
||||||
checksum: cdb3c5bd04c4da0efa767476be47c0a3865fb6335f2a1b9e242170167b51615c38164223278cef60c77143c4bac27ba582cbea054d0af3f138104fa5ec537c4c
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"react@npm:^18.2.0":
|
"react@npm:^18.2.0":
|
||||||
version: 18.2.0
|
version: 18.2.0
|
||||||
resolution: "react@npm:18.2.0"
|
resolution: "react@npm:18.2.0"
|
||||||
@ -9607,13 +9594,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"scriptjs@npm:^2.5.9":
|
|
||||||
version: 2.5.9
|
|
||||||
resolution: "scriptjs@npm:2.5.9"
|
|
||||||
checksum: fc84cb6b60b6fb9aa6f1b3bc59fc94b233bd5241ed3a04233579014382b5eb60640269c87d8657902acc09f9b785ee33230c218627cea00e653564bda8f5acb6
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"semver@npm:^6.3.0, semver@npm:^6.3.1":
|
"semver@npm:^6.3.0, semver@npm:^6.3.1":
|
||||||
version: 6.3.1
|
version: 6.3.1
|
||||||
resolution: "semver@npm:6.3.1"
|
resolution: "semver@npm:6.3.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user