-
-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web): pagination ts error (#560)
* fix: pagination ts error * fix: ignore files
- Loading branch information
Showing
9 changed files
with
52 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
import React, { useEffect } from "react"; | ||
import { CopyIcon } from "@chakra-ui/icons"; | ||
import { useClipboard } from "@chakra-ui/react"; | ||
import { Tooltip, useClipboard } from "@chakra-ui/react"; | ||
import { t } from "i18next"; | ||
|
||
import useGlobalStore from "@/pages/globalStore"; | ||
|
||
export default function CopyText(props: { text: string; tip?: string }) { | ||
export default function CopyText(props: { | ||
text: string; | ||
tip?: string; | ||
children?: React.ReactElement; | ||
}) { | ||
const { onCopy, setValue } = useClipboard(""); | ||
const { showSuccess } = useGlobalStore(); | ||
|
||
const text = props.text; | ||
const { children = <CopyIcon />, text, tip } = props; | ||
|
||
useEffect(() => { | ||
setValue(text); | ||
}, [setValue, text]); | ||
|
||
return ( | ||
<CopyIcon | ||
className="ml-1" | ||
fontSize={12} | ||
onClick={() => { | ||
onCopy(); | ||
showSuccess(props.tip || "复制成功"); | ||
}} | ||
/> | ||
<Tooltip label={t("ToolTip.Copy")} placement="top"> | ||
{React.cloneElement(children, { | ||
className: "ml-2", | ||
onClick: () => { | ||
onCopy(); | ||
showSuccess(tip || t("ToolTip.Copied")); | ||
}, | ||
})} | ||
</Tooltip> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const queryKeys = { | ||
useLogsQuery: ["useLogsQuery"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters