chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -17,10 +17,10 @@
|
||||
import { type RefObject, useEffect } from 'react';
|
||||
|
||||
/**
|
||||
* 点击赞、踩按钮,可以关闭打开原因填写面板
|
||||
* 填写面板关闭的时候, 会造成一次 Reflow。此时赞、踩按钮的位置会发生变化, 鼠标已经不在按钮上,但是对应按钮元素不会处罚 mouseleave 事件
|
||||
* 由于不触发 mouseleave 造成按钮上的 tooltip 不消失、错位等问题
|
||||
* 所以需要在面板 visible 变化时 patch 一个 mouseleave 事件
|
||||
* Click the like and step on the button to close the reason for opening and fill in the panel.
|
||||
* When the fill panel is closed, a Reflow will be caused. At this time, the position of the like and step buttons will change, and the mouse is no longer on the button, but the corresponding button element will not penalize the mouseleave event.
|
||||
* Because the mouseleave is not triggered, the tooltip on the button does not disappear, misplaced, etc.
|
||||
* So you need to patch a mouseleave event when the panel changes visible
|
||||
*/
|
||||
export const useDispatchMouseLeave = (
|
||||
ref: RefObject<HTMLDivElement>,
|
||||
|
||||
@@ -30,7 +30,7 @@ import { ReportEventNames } from '../report-events';
|
||||
import { useReportMessageFeedbackFn } from '../context/report-message-feedback';
|
||||
|
||||
/**
|
||||
* @description 消息点赞/点踩
|
||||
* @description Message Like/Click
|
||||
*/
|
||||
export const useReportMessageFeedback = () => {
|
||||
const { reporter } = useChatArea();
|
||||
@@ -64,19 +64,19 @@ export const useReportMessageFeedback = () => {
|
||||
};
|
||||
|
||||
/**
|
||||
* @description 获取 点赞按钮组件/点踩按钮组件/点踩原因填写面板组件 props
|
||||
* @description Get, like button component/click button component/click button reason Fill in the panel component props
|
||||
*/
|
||||
|
||||
export const useReportMessageFeedbackHelpers = () => {
|
||||
// 点赞成功标识
|
||||
// Like success logo
|
||||
const [isThumbsUpSuccessful, { toggle: toogleIsThumbsUpSuccessful }] =
|
||||
useToggle<boolean>(false);
|
||||
|
||||
// 点踩成功标识
|
||||
// Click on the success sign
|
||||
const [isFrownUponSuccessful, { toggle: toogleIsFrownUponSuccessful }] =
|
||||
useToggle<boolean>(false);
|
||||
|
||||
// 点踩原因填写面板展示
|
||||
// Click on the reason to fill in the panel display
|
||||
const [
|
||||
isFrownUponPanelVisible,
|
||||
{
|
||||
@@ -85,20 +85,20 @@ export const useReportMessageFeedbackHelpers = () => {
|
||||
},
|
||||
] = useToggle<boolean>(false);
|
||||
|
||||
// 点赞按钮组件onClick事件
|
||||
// Like button component onClick event
|
||||
const thumbsUpOnClick = () => {
|
||||
toogleIsThumbsUpSuccessful();
|
||||
// 点赞/点踩互斥
|
||||
// Like/click on mutual exclusion
|
||||
if (!isThumbsUpSuccessful && isFrownUponSuccessful) {
|
||||
toogleIsFrownUponSuccessful();
|
||||
setIsFrownUponPanelVisibleFalse();
|
||||
}
|
||||
};
|
||||
|
||||
// 点踩按钮组件onClick事件
|
||||
// Click button component onClick event
|
||||
const frownUponOnClick = () => {
|
||||
toogleIsFrownUponSuccessful();
|
||||
// 点赞/点踩互斥
|
||||
// Like/click on mutual exclusion
|
||||
if (!isFrownUponSuccessful && isThumbsUpSuccessful) {
|
||||
toogleIsThumbsUpSuccessful();
|
||||
}
|
||||
@@ -110,15 +110,15 @@ export const useReportMessageFeedbackHelpers = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 点踩原因填写面板组件onCancel事件
|
||||
// Click on the reason to fill in the panel component onCancel event
|
||||
const frownUponPanelonCancel = () => {
|
||||
setIsFrownUponPanelVisibleFalse();
|
||||
};
|
||||
|
||||
// 点踩原因填写面板组件onSubmit事件
|
||||
// Click on the reason to fill in the panel component onSubmit event
|
||||
const frownUponPanelonSubmit = () => {
|
||||
setIsFrownUponPanelVisibleFalse();
|
||||
// 点赞/点踩互斥
|
||||
// Like/click on mutual exclusion
|
||||
if (isThumbsUpSuccessful) {
|
||||
toogleIsThumbsUpSuccessful();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user