Skip to content

Commit

Permalink
feat(web): add the cursor pointer style for CopyText (labring#1404)
Browse files Browse the repository at this point in the history
* feat: add color for the delete IconText

* fix: fix the error color in light and dark mode

* feat: add the pointer style for CopyText

* fix: lint fix

* fix(web): merge classname

* fix(web): removes the pointer from the CopyText classname
  • Loading branch information
imyuanx authored Jul 19, 2023
1 parent 3d72820 commit d261113
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
3 changes: 2 additions & 1 deletion web/src/components/CopyText/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect } from "react";
import { CopyIcon } from "@chakra-ui/icons";
import { Tooltip, useClipboard } from "@chakra-ui/react";
import clsx from "clsx";
import { t } from "i18next";

import useGlobalStore from "@/pages/globalStore";
Expand Down Expand Up @@ -30,7 +31,7 @@ export default function CopyText(props: {
return (
<Tooltip label={hideToolTip ? "" : t("Copy")} placement="top">
{React.cloneElement(children, {
className: className || "",
className: clsx("cursor-pointer", className),
onClick: () => {
onCopy();
showSuccess(tip || t("Copied"));
Expand Down
5 changes: 1 addition & 4 deletions web/src/pages/app/functions/mods/EditorPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ function EditorPanel() {
<HStack spacing={1}>
<div className={clsx("flex items-center", !darkMode && "bg-[#F6F8F9]")}>
<Input w={"200px"} size="xs" readOnly value={getFunctionUrl()} />
<CopyText
text={getFunctionUrl()}
className="mr-3 cursor-pointer !text-grayModern-300"
>
<CopyText text={getFunctionUrl()} className="mr-3 !text-grayModern-300">
<CopyIcon />
</CopyText>
</div>
Expand Down
4 changes: 1 addition & 3 deletions web/src/pages/app/setting/CustomDomain/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export default function CustomDomain() {
<FormLabel>CNAME</FormLabel>
<InputGroup>
<Input variant="filled" value={currentApp?.domain?.domain} readOnly />
<InputRightAddon
children={<CopyText text={currentApp?.domain?.domain} className="cursor-pointer" />}
/>
<InputRightAddon children={<CopyText text={currentApp?.domain?.domain} />} />
</InputGroup>
</FormControl>
<FormControl className="py-4">
Expand Down
4 changes: 1 addition & 3 deletions web/src/pages/app/storages/mods/CreateWebsiteModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ function CreateWebsiteModal() {
<FormLabel>CNAME</FormLabel>
<InputGroup size="sm">
<Input variant="filled" value={cnameDomain} readOnly />
<InputRightAddon
children={<CopyText text={cnameDomain} className="cursor-pointer" />}
/>
<InputRightAddon children={<CopyText text={cnameDomain} />} />
</InputGroup>
</FormControl>
<FormControl>
Expand Down

0 comments on commit d261113

Please sign in to comment.