A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix: follow btton add tootips
shuai118dc29ae932
diff --git a/ui/src/pages/Questions/Detail/components/Question/index.tsx b/ui/src/pages/Questions/Detail/components/Question/index.tsxindex 40fc0a25..527a5ef9 100644--- a/ui/src/pages/Questions/Detail/components/Question/index.tsx+++ b/ui/src/pages/Questions/Detail/components/Question/index.tsx@@ -1,7 +1,7 @@import { memo, FC, useState, useEffect, useRef } from 'react';import { Link, useSearchParams } from 'react-router-dom';import { useTranslation } from 'react-i18next';-import { Button } from 'react-bootstrap';+import { Button, OverlayTrigger, Tooltip } from 'react-bootstrap';import {Tag,@@ -102,13 +102,17 @@ const Index: FC<Props> = ({ data, initPage, hasAnswer, isLogged }) => {{t('Views')} {formatCount(data.view_count)}</div>)}- <Button- variant="link"- size="sm"- className="p-0 btn-no-border"- onClick={(e) => handleFollow(e)}>- {t(followed ? 'Following' : 'Follow')}- </Button>+ <OverlayTrigger+ placement="bottom"+ overlay={<Tooltip id="followTooltip">{t('follow_tip')}</Tooltip>}>+ <Button+ variant="link"+ size="sm"+ className="p-0 btn-no-border"+ onClick={(e) => handleFollow(e)}>+ {t(followed ? 'Following' : 'Follow')}+ </Button>+ </OverlayTrigger></div><div className="m-n1">{data?.tags?.map((item: any) => {diff --git a/ui/src/pages/Questions/Detail/index.tsx b/ui/src/pages/Questions/Detail/index.tsxindex 23925ba9..84871357 100644--- a/ui/src/pages/Questions/Detail/index.tsx+++ b/ui/src/pages/Questions/Detail/index.tsx@@ -152,7 +152,7 @@ const Index = () => {const initPage = (type: string) => {if (type === 'delete_question') {setTimeout(() => {- navigate(-1);+ navigate('/', { replace: true });}, 1000);return;}