-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: setup owned account * feat: parent view * feat: remove parent from child * feat[WIP]: hc manager * feat[WIP]: redeem account & show childAccounts * feat: setup childAccount display * feat: update ParentView and ChildView UI * feat: remove child * feat: transfer ownership / accept ownership / show owner of ownedAccount * feat: transfer ownership from manager * refactor: owned account page name * feat: OwnedAccount Display * feat: OwnedAccounts Display * fix: Display style * chore: clean logs
- Loading branch information
1 parent
b9a64ed
commit ec7d5f3
Showing
34 changed files
with
2,309 additions
and
12 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
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,71 @@ | ||
import { useRouter } from "next/router"; | ||
import publicConfig from "../../publicConfig"; | ||
import { useRecoilState } from "recoil"; | ||
import { showSetupDisplayState, transactionInProgressState, transactionStatusState } from "../../lib/atoms"; | ||
import { removeChildAccount, removeChildFromChild, setupChildAccountDisplay } from "../../flow/hc_transactions"; | ||
import { useSWRConfig } from "swr"; | ||
import OwnedDisplayView from "./OwnedDisplayView"; | ||
|
||
export default function ChildView(props) { | ||
const [transactionInProgress, setTransactionInProgress] = useRecoilState(transactionInProgressState) | ||
const [, setTransactionStatus] = useRecoilState(transactionStatusState) | ||
const [showSetupDisplay, setShowSetupDisplay] = useRecoilState(showSetupDisplayState) | ||
const { mutate } = useSWRConfig() | ||
|
||
const router = useRouter() | ||
const { child, account, user } = props | ||
|
||
return ( | ||
<div className="min-w-[1076px] flex flex-col gap-y-3 p-4 shadow-md rounded-2xl bg-white"> | ||
<div className="flex flex-col gap-y-2"> | ||
<div className="flex gap-x-2 justify-between items-center"> | ||
<div className="cursor-pointer px-2 text-xl font-bold text-black decoration-drizzle decoration-2 underline"> | ||
<a href={`${publicConfig.appURL}//account/${child.address}`} | ||
target="_blank" | ||
rel="noopener noreferrer"> | ||
{child.address} | ||
</a> | ||
</div> | ||
<div className="flex gap-x-2 justify-between"> | ||
{/* <button | ||
type="button" | ||
disabled={transactionInProgress} | ||
className={`text-black disabled:bg-drizzle-light disabled:text-gray-500 bg-drizzle hover:bg-drizzle-dark px-3 py-2 text-sm rounded-2xl font-semibold shrink-0`} | ||
onClick={async () => { | ||
// TODO: REMOVE CHILD | ||
mutate(["hcManagerInfoFetcher", account]) | ||
}} | ||
> | ||
{"Set Manager Cap Filter"} | ||
</button> */} | ||
<button | ||
type="button" | ||
disabled={transactionInProgress || !(user && user.loggedIn && user.addr == account)} | ||
className={`text-black disabled:bg-drizzle-light disabled:text-gray-500 bg-drizzle hover:bg-drizzle-dark px-3 py-2 text-sm rounded-2xl font-semibold shrink-0`} | ||
onClick={async () => { | ||
setShowSetupDisplay({ show: true, mode: "ChildAccount", childAddress: child.address }) | ||
}} | ||
> | ||
{"Set Display"} | ||
</button> | ||
<button | ||
type="button" | ||
disabled={transactionInProgress || !(user && user.loggedIn && user.addr == account)} | ||
className={`text-white disabled:bg-red-400 disabled:text-white bg-red-600 hover:bg-red-800 px-3 py-2 text-sm rounded-2xl font-semibold shrink-0`} | ||
onClick={async () => { | ||
await removeChildAccount(child.address, setTransactionInProgress, setTransactionStatus) | ||
mutate(["hcManagerInfoFetcher", account]) | ||
}} | ||
> | ||
{"Remove"} | ||
</button> | ||
</div> | ||
</div> | ||
{ | ||
child.display ? | ||
<OwnedDisplayView display={child.display} style={"Small"} type="Child" /> : null | ||
} | ||
</div> | ||
</div> | ||
) | ||
} |
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,45 @@ | ||
import Image from "next/image" | ||
import publicConfig from "../../publicConfig" | ||
import { getImageSrcFromMetadataViewsFile } from "../../lib/utils" | ||
|
||
export default function OwnedDisplayView(props) { | ||
const { display, style } = props | ||
|
||
if (style == "Small") { | ||
return ( | ||
<div className="flex gap-x-3 justify-between"> | ||
<div className="flex items-center gap-x-3"> | ||
<div className="w-10 rounded-full overflow-hidden aspect-square relative shrink-0"> | ||
<Image src={getImageSrcFromMetadataViewsFile(display.thumbnail)} alt="" fill sizes="5vw" /> | ||
</div> | ||
<div className="flex flex-col"> | ||
<label className="text-medium font-semibold"> | ||
{`${display.name}`} | ||
</label> | ||
<label className="text-sm font-medium text-gray-600"> | ||
{`${display.description}`} | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<div className="flex gap-x-3 justify-between"> | ||
<div className="flex items-center gap-x-3"> | ||
<div className="w-20 rounded-full overflow-hidden aspect-square relative"> | ||
<Image src={getImageSrcFromMetadataViewsFile(display.thumbnail)} alt="" fill sizes="5vw" /> | ||
</div> | ||
<div className="flex flex-col w-full"> | ||
<label className="text-lg font-bold"> | ||
{`${display.name}`} | ||
</label> | ||
<label className="text-sm font-medium text-gray-600"> | ||
{`${display.description}`} | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
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 @@ | ||
import { useRouter } from "next/router"; | ||
import publicConfig from "../../publicConfig"; | ||
import { useRecoilState } from "recoil"; | ||
import { showSetupDisplayState, showTransferOwnershipState, transactionInProgressState, transactionStatusState } from "../../lib/atoms"; | ||
import { removeChildAccount, removeChildFromChild, setupChildAccountDisplay } from "../../flow/hc_transactions"; | ||
import { useSWRConfig } from "swr"; | ||
import OwnedDisplayView from "./OwnedDisplayView"; | ||
|
||
export default function OwnedView(props) { | ||
const [transactionInProgress, setTransactionInProgress] = useRecoilState(transactionInProgressState) | ||
const [, setTransactionStatus] = useRecoilState(transactionStatusState) | ||
const [showSetupDisplay, setShowSetupDisplay] = useRecoilState(showSetupDisplayState) | ||
const [showTransferOwnership, setShowTransferOwnership] = useRecoilState(showTransferOwnershipState) | ||
const { mutate } = useSWRConfig() | ||
|
||
const router = useRouter() | ||
const { child, account, user } = props | ||
|
||
return ( | ||
<div className="min-w-[1076px] flex flex-col gap-y-3 p-4 shadow-md rounded-2xl bg-white"> | ||
<div className="flex flex-col gap-y-2"> | ||
<div className="flex gap-x-2 justify-between items-center"> | ||
<div className="cursor-pointer px-2 text-xl font-bold text-black decoration-drizzle decoration-2 underline"> | ||
<a href={`${publicConfig.appURL}//account/${child.address}`} | ||
target="_blank" | ||
rel="noopener noreferrer"> | ||
{child.address} | ||
</a> | ||
</div> | ||
<div className="flex gap-x-2 justify-between"> | ||
<button | ||
className={`text-white disabled:bg-red-400 bg-red-600 hover:bg-red-800 px-3 py-2 text-sm rounded-2xl font-semibold shrink-0`} | ||
disabled={transactionInProgress || !(user && user.loggedIn && user.addr == account)} | ||
onClick={async () => { | ||
setShowTransferOwnership({ show: true, mode: "FromManager", ownedAddress: child.address }) | ||
}} | ||
> | ||
Transfer Ownership | ||
</button> | ||
|
||
{/* <button | ||
type="button" | ||
disabled={transactionInProgress || !(user && user.loggedIn && user.addr == account)} | ||
className={`text-white disabled:bg-red-400 disabled:text-white bg-red-600 hover:bg-red-800 px-3 py-2 text-sm rounded-2xl font-semibold shrink-0`} | ||
onClick={async () => { | ||
}} | ||
> | ||
{"Remove"} | ||
</button> */} | ||
</div> | ||
</div> | ||
{ | ||
child.display ? | ||
<OwnedDisplayView display={child.display} style={"Small"} type="Owned" /> : null | ||
} | ||
</div> | ||
</div> | ||
) | ||
} |
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,78 @@ | ||
import { useRouter } from "next/router"; | ||
import publicConfig from "../../publicConfig"; | ||
import { useRecoilState } from "recoil"; | ||
import { transactionInProgressState, transactionStatusState } from "../../lib/atoms"; | ||
import { removeParentFromChild } from "../../flow/hc_transactions"; | ||
import { useSWRConfig } from "swr"; | ||
|
||
export default function ParentView(props) { | ||
const [transactionInProgress, setTransactionInProgress] = useRecoilState(transactionInProgressState) | ||
const [, setTransactionStatus] = useRecoilState(transactionStatusState) | ||
const { mutate } = useSWRConfig() | ||
|
||
const router = useRouter() | ||
const { parent, account, user } = props | ||
|
||
return ( | ||
<div className="min-w-[1076px] flex flex-col gap-y-3 p-4 shadow-md rounded-2xl bg-white"> | ||
<div className="flex flex-col gap-y-2"> | ||
{ | ||
!parent.isClaimed ? | ||
<div> | ||
<label className={`font-bold text-xs px-2 py-1 leading-5 rounded-full bg-yellow-100 text-yellow-800`}>{"UNCLAIMED"}</label> | ||
</div> | ||
: <div> | ||
<label className={`font-bold text-xs px-2 py-1 leading-5 rounded-full bg-green-100 text-green-800`}>{"CLAIMED"}</label> | ||
</div> | ||
} | ||
<div className="flex gap-x-2 justify-between items-center"> | ||
<div className="cursor-pointer px-2 text-xl font-bold text-black decoration-drizzle decoration-2 underline"> | ||
<a href={`${publicConfig.appURL}//account/${parent.address}`} | ||
target="_blank" | ||
rel="noopener noreferrer"> | ||
{parent.address} | ||
</a> | ||
</div> | ||
<div> | ||
<button | ||
type="button" | ||
disabled={transactionInProgress || !(user && user.loggedIn && user.addr == account) || !parent.isClaimed} | ||
className={`text-white disabled:bg-red-400 disabled:text-white bg-red-600 hover:bg-red-800 px-3 py-2 text-sm rounded-2xl font-semibold shrink-0`} | ||
onClick={async () => { | ||
await removeParentFromChild(parent.address, setTransactionInProgress, setTransactionStatus) | ||
mutate(["ownedAccountInfoFetcher", account]) | ||
}} | ||
> | ||
{"Remove"} | ||
</button> | ||
</div> | ||
</div> | ||
<div className="flex gap-x-2 px-2 text-base text-black"> | ||
<div className="text-sm font-semibold text-black">Factory | ||
<a | ||
href={`${publicConfig.appURL}/account/${parent.childAccount.factory.address}`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="text-gray-600 text-sm font-medium cursor-pointer decoration-drizzle decoration-2 underline"> | ||
{`${parent.childAccount.factory.address}`} | ||
</a> | ||
</div> | ||
</div> | ||
<div className="flex gap-x-2 px-2 text-base font-semibold text-black"> | ||
<div className="text-sm font-semibold text-black">Filter | ||
<a | ||
href={`${publicConfig.appURL}/account/${parent.childAccount.filter.address}`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="text-gray-600 text-sm font-medium cursor-pointer decoration-drizzle decoration-2 underline"> | ||
{`${parent.childAccount.filter.address}`} | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
</div> | ||
|
||
) | ||
} |
Oops, something went wrong.
ec7d5f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
flowview – ./
flowview-git-main-33lab.vercel.app
flowview.vercel.app
flowview-33lab.vercel.app
flowview.app
www.flowview.app