From 80024bc3914df1f2af8dfaf7a4b592443b9683d8 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Fri, 13 Jan 2023 23:48:24 +0100 Subject: [PATCH 1/8] feat: display banner in profile --- src/pages/ProfilePage.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pages/ProfilePage.css b/src/pages/ProfilePage.css index 514f34b2..fc503da3 100644 --- a/src/pages/ProfilePage.css +++ b/src/pages/ProfilePage.css @@ -27,6 +27,17 @@ .profile .name h2 { margin: 0; +======= +} + +@media (min-width: 720px) { + .profile .banner { + width: 100%; + max-width: 720px; + height: 300px; + margin-bottom: -120px; + } +>>>>>>> c68c73a (feat: display banner in profile) } -- 2.45.2 From e0957deca83e666e22d46bfb1c0c65c0b42dd402 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Sat, 14 Jan 2023 02:39:20 +0100 Subject: [PATCH 2/8] feat: render markdown --- package.json | 1 + src/Text.js | 149 ++++++----- src/element/LazyImage.js | 2 +- src/element/Note.css | 30 +++ src/element/Note.js | 2 +- src/pages/ProfilePage.css | 3 - src/pages/ProfilePage.js | 4 +- yarn.lock | 509 +++++++++++++++++++++++++++++++++++++- 8 files changed, 624 insertions(+), 76 deletions(-) diff --git a/package.json b/package.json index 22079ccc..7e7f8e97 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-intersection-observer": "^9.4.1", + "react-markdown": "^8.0.4", "react-redux": "^8.0.5", "react-router-dom": "^6.5.0", "react-scripts": "5.0.1", diff --git a/src/Text.js b/src/Text.js index 3cd71e3a..4950affb 100644 --- a/src/Text.js +++ b/src/Text.js @@ -1,4 +1,7 @@ +import { useMemo } from "react"; + import { Link } from "react-router-dom"; +import ReactMarkdown from "react-markdown"; import { TwitterTweetEmbed } from "react-twitter-embed"; import Invoice from "./element/Invoice"; @@ -6,64 +9,59 @@ import { UrlRegex, FileExtensionRegex, MentionRegex, InvoiceRegex, YoutubeUrlReg import { eventLink, hexToBech32, profileLink } from "./Util"; import LazyImage from "./element/LazyImage"; import Hashtag from "./element/Hashtag"; -import { useMemo } from "react"; function transformHttpLink(a) { - try { - const url = new URL(a); - const youtubeId = YoutubeUrlRegex.test(a) && RegExp.$1; - const tweetId = TweetUrlRegex.test(a) && RegExp.$2; - const extension = FileExtensionRegex.test(url.pathname.toLowerCase()) && RegExp.$1; - if (extension) { - switch (extension) { - case "gif": - case "jpg": - case "jpeg": - case "png": - case "bmp": - case "webp": { - return ; - } - case "mp4": - case "mov": - case "mkv": - case "avi": - case "m4v": { - return