Skip to content

Commit

Permalink
fix(web): update below ui changes
Browse files Browse the repository at this point in the history
- make domain as href in router listing
- add rewrite switch case in route ui
- change path with "/" while updating route path
  • Loading branch information
nxtCoder19 committed Feb 20, 2024
1 parent 53d4754 commit 6b6081c
Show file tree
Hide file tree
Showing 3 changed files with 518 additions and 475 deletions.
31 changes: 7 additions & 24 deletions src/apps/console/components/console-list-components.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import {ReactNode, useState} from 'react';
import Tooltip from '~/components/atoms/tooltip';
import {cn, titleCase} from '~/components/utils';
import {CopyrightFill, CopySimple} from "@jengaicons/react";
import useClipboard from "~/lib/client/hooks/use-clipboard";
import {toast} from "~/components/molecule/toast";
import {cn} from '~/components/utils';

interface IBase {
className?: string;
Expand Down Expand Up @@ -134,41 +131,27 @@ const ListTitle = ({
};

const ListDomainItem = ({
data,
value,
}: {
data,
value,
}: {
data: ReactNode;
value: string;
}) => {
const [_, setCopyIcon] = useState(<CopySimple/>);
const {copy} = useClipboard({
onSuccess: () => {
setTimeout(() => {
setCopyIcon(<CopyrightFill/>);
toast.success(`${titleCase("domain name")} copied successfully`);
}, 1000);
// toast.success('Copied to clipboard');
},
});

return (
<div
onClick={(event) => {
event.preventDefault()
copy(value);
window.open(`https://${value}`, "_blank")
}}
className="flex flex-row gap-md items-center select-none group cursor-pointer"
className="flex flex-row gap-md items-center"
>
<div className="flex flex-col flex-1">
{data && (
<div className="bodyMd-medium text-text-soft truncate pulsable">
<div className="bodyMd-medium text-border-focus underline underline-offset-2 truncate pulsable">
{data}
</div>
)}
</div>
<span className="invisible group-hover:visible">
<CopySimple size={10}/>
</span>
</div>
);
};
Expand Down
Loading

0 comments on commit 6b6081c

Please sign in to comment.