Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

feat: limit the num of lines for filename (#1424)

CorrectRoadH3c2578f666b8
diff --git a/web/package.json b/web/package.json
index 1c0029d9d..ea757f5c1 100644
--- a/web/package.json
+++ b/web/package.json
@@ -33,6 +33,7 @@
"zustand": "^4.3.6"
},
"devDependencies": {
+ "@tailwindcss/line-clamp": "^0.4.2",
"@types/lodash-es": "^4.17.5",
"@types/node": "^18.0.3",
"@types/qs": "^6.9.7",
diff --git a/web/src/components/ResourceCard.tsx b/web/src/components/ResourceCard.tsx
index 9ff41b06c..68b064769 100644
--- a/web/src/components/ResourceCard.tsx
+++ b/web/src/components/ResourceCard.tsx
@@ -45,7 +45,7 @@ const ResourceCard = ({
<ResourceCover resource={resource} />
</div>
<div className="w-full flex flex-col justify-start items-center px-1 select-none">
- <div className="w-full text-base text-center text-ellipsis overflow-hidden">{resource.filename}</div>
+ <div className="w-full text-base text-center text-ellipsis overflow-hidden line-clamp-3">{resource.filename}</div>
<div className="text-xs text-gray-400 text-center">{dayjs(resource.createdTs).locale("en").format("YYYY/MM/DD HH:mm:ss")}</div>
</div>
</div>
diff --git a/web/tailwind.config.js b/web/tailwind.config.js
index f52061c6d..fb113ac95 100644
--- a/web/tailwind.config.js
+++ b/web/tailwind.config.js
@@ -34,4 +34,7 @@ module.exports = {
},
},
},
+ plugins: [
+ require('@tailwindcss/line-clamp'),
+ ],
};