From db15c21617f693b6a83785a1a5fa72c034ed91ee Mon Sep 17 00:00:00 2001 From: Izan Gil <66965250+SrIzan10@users.noreply.github.com> Date: Sat, 27 Apr 2024 20:40:01 +0200 Subject: [PATCH] limit description characters to 100 --- .idea/workspace.xml | 18 +++++++++++++----- src/components/PluginCard/index.js | 2 +- src/pages/plugins.js | 3 +++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7252804c6..6bfc8ace4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,7 @@ - @@ -384,7 +391,8 @@ - diff --git a/src/components/PluginCard/index.js b/src/components/PluginCard/index.js index 9301f7eb3..12f4d7767 100644 --- a/src/components/PluginCard/index.js +++ b/src/components/PluginCard/index.js @@ -8,7 +8,7 @@ export default function PluginCard({ plugin }) {

{plugin.name}

-

{plugin.description}

+

{plugin.trimmedDescription}

diff --git a/src/pages/plugins.js b/src/pages/plugins.js index 845053476..3afc98e39 100644 --- a/src/pages/plugins.js +++ b/src/pages/plugins.js @@ -10,6 +10,9 @@ export default function Plugins() { const asyncFetch = async () => { const response = await fetch('https://raw.githubusercontent.com/sern-handler/awesome-plugins/main/pluginlist.json') const data = await response.json() + data.forEach(pl => { + pl.trimmedDescription = pl.description.length > 100 ? pl.description.slice(0, 100) + "..." : pl.description + }) setPluginList(data) } asyncFetch()