From 0803631708fc1aa85b90217dfc3cc7d0f772604b Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Tue, 11 Oct 2022 16:18:47 +0800 Subject: [PATCH] fix: #1000, optimize tag list layout --- ui/src/common/variable.scss | 1 + ui/src/components/FollowingTags/index.tsx | 7 ++----- ui/src/components/Questions/index.tsx | 8 +++++--- ui/src/components/TagSelector/index.tsx | 7 +++---- .../pages/Questions/Detail/components/Question/index.tsx | 6 +++--- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ui/src/common/variable.scss b/ui/src/common/variable.scss index 99766954..5687c2e4 100644 --- a/ui/src/common/variable.scss +++ b/ui/src/common/variable.scss @@ -1,2 +1,3 @@ $link-hover-decoration: none; +$enable-negative-margins: true; $blue: #0033FF !default; diff --git a/ui/src/components/FollowingTags/index.tsx b/ui/src/components/FollowingTags/index.tsx index 99d1109d..993efaf7 100644 --- a/ui/src/components/FollowingTags/index.tsx +++ b/ui/src/components/FollowingTags/index.tsx @@ -68,16 +68,13 @@ const Index: FC = () => { {t('edit')} - + {followingTags?.length ? ( <> {followingTags.map((item) => { const slugName = item?.slug_name; return ( - + {slugName} ); diff --git a/ui/src/components/Questions/index.tsx b/ui/src/components/Questions/index.tsx index 987727bc..6e7f8b49 100644 --- a/ui/src/components/Questions/index.tsx +++ b/ui/src/components/Questions/index.tsx @@ -122,7 +122,9 @@ const QuestionList: FC = ({ source }) => { {listData?.list?.map((li) => { return ( - +
{li.title} @@ -153,13 +155,13 @@ const QuestionList: FC = ({ source }) => { {li.view_count} -
+
{Array.isArray(li.tags) ? li.tags.map((tag) => { return ( diff --git a/ui/src/components/TagSelector/index.tsx b/ui/src/components/TagSelector/index.tsx index 06ffdb6e..790b8242 100644 --- a/ui/src/components/TagSelector/index.tsx +++ b/ui/src/components/TagSelector/index.tsx @@ -177,19 +177,18 @@ const TagSelector: FC = ({ onFocus={onFocus} onBlur={onBlur} onKeyDown={handleKeyDown}> -
+
{initialValue?.map((item, index) => { return (
-
+
= ({ data, initPage, hasAnswer }) => { {followed ? 'Following' : 'Follow'}
-
+
{data?.tags?.map((item: any) => { return ( {item.slug_name}