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

* feat: limit the linenum of  filename

* change the implement of line-clamp
This commit is contained in:
CorrectRoadH 2023-03-29 20:27:54 +08:00 committed by GitHub
parent 526fbbba45
commit 3c2578f666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -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",

View File

@ -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>

View File

@ -34,4 +34,7 @@ module.exports = {
},
},
},
plugins: [
require('@tailwindcss/line-clamp'),
],
};