This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
187 additions
and
295 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
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,59 @@ | ||
"use client"; | ||
import React, { useState } from "react"; | ||
import { brandLightText } from "../../_utils/colors"; | ||
import { getInbox } from "@betteridea/codecell"; | ||
import Image from "next/image"; | ||
import { useMessagesArrayStore } from "../../_store/store"; | ||
|
||
const MessagesDD = () => { | ||
// const [mesArr, setMesArr] = useState<any[]>([]); | ||
const [mesToggle, setMesToggle] = useState(false); | ||
const messArr = useMessagesArrayStore((state) => state.messArr); | ||
|
||
const stripAnsiCodes = (str: string) => { | ||
str.replace( | ||
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, | ||
"" | ||
); | ||
}; | ||
return ( | ||
<div | ||
className={`bg-[#000000] w-full py-[12px] px-[13.5px] rounded-md | ||
text-[12px] ${brandLightText} mt-[-12px] | ||
`} | ||
> | ||
<div | ||
onClick={() => { | ||
getInbox("1", true); | ||
setMesToggle(!mesToggle); | ||
}} | ||
className="flex flex-row justify-start gap-3 items-center" | ||
> | ||
<button className="uppercase text-[15px] text-[#98e870]"> | ||
{mesToggle ? "Messages" : "Check Inbox"} | ||
</button> | ||
<Image | ||
src="/ddMes.png" | ||
width={15} | ||
height={21} | ||
alt="dd" | ||
className={`${mesToggle ? "rotate-180" : "rotate-0"}`} | ||
/> | ||
</div> | ||
<div className={`max-h-[60px] ${mesToggle ? "overflow-y-scroll" : ""}`}> | ||
{mesToggle && | ||
messArr?.map((item, id) => { | ||
stripAnsiCodes(item.Data); | ||
return ( | ||
<div className=" tracking-[1.5px]"> | ||
{`Inbox[${id + 1}].Data: `} | ||
{item.Data ? item.Data : "No Data"} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MessagesDD; |
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,64 @@ | ||
"use client"; | ||
import Image from "next/image"; | ||
import React, { useState } from "react"; | ||
import { usePidStore } from "../../_store/store"; | ||
|
||
const PidDisplay = () => { | ||
const [copied, setCopied] = useState(false); | ||
const curPid = usePidStore((state) => state.curPid); | ||
const handleCopy = () => { | ||
if (curPid) { | ||
navigator.clipboard | ||
.writeText(curPid) | ||
.then(() => { | ||
setCopied(true); | ||
console.log("Copied to clipboard:", curPid); | ||
}) | ||
.catch((err) => { | ||
setCopied(false); | ||
console.error("Failed to copy:", err); | ||
}); | ||
} | ||
}; | ||
return ( | ||
<div className="relative h-[33px] w-full justify-start px-20 lg:flex hidden max-w-[1800px]"> | ||
<div className="absolute left-0 z-10"> | ||
<div className="bg-[#EB8F44] bg-opacity-30 text-[#EB8F44] font-semibold border-2 border-[#EB8F44] text-sm rounded py-2 px-4 shadow-lg relative"> | ||
<div className="flex items-center"> | ||
<h3> | ||
{curPid | ||
? `Process ID: ${curPid}` | ||
: `Please Connect Your Wallet First !!`} | ||
</h3> | ||
{curPid ? ( | ||
copied ? ( | ||
<Image | ||
alt="copy" | ||
src="/clip1.png" | ||
height={18} | ||
width={18} | ||
onClick={handleCopy} | ||
className="hover:cursor-pointer w-[18px] h-[18px] hover:bg-[#7f512a] rounded-md" | ||
/> | ||
) : ( | ||
<Image | ||
alt="copy" | ||
src="/clip0.svg" | ||
height={18} | ||
width={18} | ||
onClick={handleCopy} | ||
className="hover:cursor-pointer w-[18px] h-[18px] hover:bg-[#7f512a] rounded-md" | ||
/> | ||
) | ||
) : ( | ||
"" | ||
)} | ||
</div> | ||
<div className="w-0 h-0 border-t-8 border-t-[#EB8F44] border-r-8 border-r-transparent border-l-8 border-l-transparent absolute left-1 -bottom-2"></div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PidDisplay; |
File renamed without changes.
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
Oops, something went wrong.