mirror of https://gitee.com/answerdev/answer.git
fix: follow btton add tootips
This commit is contained in:
parent
0aa98fb2af
commit
118dc29ae9
|
@ -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) => {
|
||||
|
|
|
@ -152,7 +152,7 @@ const Index = () => {
|
|||
const initPage = (type: string) => {
|
||||
if (type === 'delete_question') {
|
||||
setTimeout(() => {
|
||||
navigate(-1);
|
||||
navigate('/', { replace: true });
|
||||
}, 1000);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue