Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bridge last feedbacks #194

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export default function BridgingQuestBanner({
</Typography>
<a
className="flex h-[2.625rem] items-center justify-center rounded-full bg-space-blue-source px-6 text-white"
href="/"
href="https://quests.arkproject.dev/"
rel="noreferrer"
target="_blank"
>
<Typography variant="button_text_s">View quests</Typography>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default function SmallBridgingQuestBanner({
className,
"rounded-2xl bg-galaxy-blue pt-4 text-white dark:bg-void-black"
)}
href="/"
href="https://quests.arkproject.dev/"
rel="noreferrer"
target="_blank"
>
<div className="flex flex-col items-start gap-4 px-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ function ArkQuestsBanner({ className }: ArkQuestsBannerProps) {

<a
className="flex h-[2.625rem] items-center justify-center rounded-full bg-sunshine-yellow-source px-6"
href="/"
href="https://quests.arkproject.dev/"
rel="noreferrer"
target="_blank"
>
<Typography className="text-void-black" variant="button_text_s">
Check your progress
Expand Down Expand Up @@ -218,7 +220,7 @@ export default function CongratsModal({ isFromTransfer }: CongratsModalProps) {
</Typography>
<a
className="mt-6 flex h-12 items-center rounded-full bg-space-blue-source px-5 text-white transition-colors hover:bg-space-blue-500 dark:text-galaxy-blue"
href="https://twitter.com/intent/tweet?text=I've just transferred my @Everai(s) on @Starknet using the ArkProject Bridge! Let's come together, holders and hit a new milestone on Ark Quests!"
href="https://twitter.com/intent/tweet?text=I've just transferred my @Everai(s) on @Starknet using the ArkProject Bridge! Let's come together, holders and hit a new milestone on Ark Quests! https://quests.arkproject.dev/"
rel="noreferrer"
target="_blank"
>
Expand Down
54 changes: 47 additions & 7 deletions apps/web/src/app/(routes)/lounge/_components/NftTransferItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface NftTransferItemProps {
| "withdraw_completed_l2";
tokenIds: Array<string>;
totalCount: number;
txHash?: string;
}

function getDisplayedDate(timestamp?: number) {
Expand Down Expand Up @@ -63,6 +64,7 @@ export default function NftTransferItem({
status,
tokenIds,
totalCount,
txHash,
}: NftTransferItemProps) {
const [open, setOpen] = useState(false);
const [withdrawModalOpen, setWithdrawModalOpen] = useState(false);
Expand Down Expand Up @@ -145,19 +147,57 @@ export default function NftTransferItem({
</div>

<div>
{status === "withdraw_available_l1" && (
{status === "withdraw_available_l1" ? (
<WithdrawButton
onSuccess={() => setWithdrawModalOpen(true)}
requestContent={requestContent}
/>
)}
) : status === "withdraw_completed_l1" ||
status === "withdraw_completed_l2" ? (
<div className="text-left text-space-blue-source">
{arrivalChain === "Ethereum" ? (
<a href={`https://etherscan.io/tx/${txHash}`}>
<Typography
className="underline"
component="p"
variant="body_text_14"
>
View on Etherscan
</Typography>
</a>
) : (
<>
<a href={`https://voyager.online/tx/${txHash}`}>
<Typography
className="underline"
component="p"
variant="body_text_14"
>
View on Voyager
</Typography>
</a>
<a href={`https://starkscan.co/tx/${txHash}`}>
<Typography
className="underline"
component="p"
variant="body_text_14"
>
View on Starkscan
</Typography>
</a>
</>
)}
</div>
) : null}
</div>

<Collapsible.Trigger asChild>
<button className="flex h-9 w-9 items-center justify-center justify-self-end rounded-md border-2 border-asteroid-grey-600 text-2xl text-asteroid-grey-600 transition-colors hover:border-asteroid-grey-800 hover:text-asteroid-grey-800 dark:border-space-blue-400 dark:text-space-blue-400 dark:hover:border-space-blue-200 dark:hover:text-space-blue-200">
{open ? <MinusIcon /> : <PlusIcon />}
</button>
</Collapsible.Trigger>
{totalCount > 1 && (
<Collapsible.Trigger asChild>
<button className="flex h-9 w-9 items-center justify-center justify-self-end rounded-md border-2 border-asteroid-grey-600 text-2xl text-asteroid-grey-600 transition-colors hover:border-asteroid-grey-800 hover:text-asteroid-grey-800 dark:border-space-blue-400 dark:text-space-blue-400 dark:hover:border-space-blue-200 dark:hover:text-space-blue-200">
{open ? <MinusIcon /> : <PlusIcon />}
</button>
</Collapsible.Trigger>
)}
</div>

<NftTransferItemContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export default function NftTransferList({
status={bridgeRequest.status}
tokenIds={bridgeRequest.tokenIds}
totalCount={bridgeRequest.totalCount}
txHash={bridgeRequest.txHash}
/>
);
})}
Expand Down Expand Up @@ -183,6 +184,7 @@ export default function NftTransferList({
status={bridgeRequest.status}
tokenIds={bridgeRequest.tokenIds}
totalCount={bridgeRequest.totalCount}
txHash={bridgeRequest.txHash}
/>
);
})}
Expand Down
7 changes: 6 additions & 1 deletion apps/web/src/app/(routes)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ export default function Page() {
<Typography component="p" variant="body_text_14">
Bridging is an ArkProject Quest
</Typography>
<a className="" href="/">
<a
className=""
href="https://quests.arkproject.dev/"
rel="noreferrer"
target="_blank"
>
<Typography
className="text-space-blue-source underline"
variant="body_text_14"
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/_components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function Header() {
className="transition-colors hover:text-space-blue-source"
variant="heading_light_xxs"
>
Collection owner
Submit Collection
</Typography>
</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/server/api/routers/bridgeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type BridgeRequestResponse = {
statusTimestamp: number;
tokenIds: Array<string>;
totalCount: number;
txHash?: string;
};

export const bridgeRequestRouter = createTRPCRouter({
Expand Down Expand Up @@ -184,6 +185,7 @@ export const bridgeRequestRouter = createTRPCRouter({
statusTimestamp: lastBridgeRequestEvent?.block_timestamp ?? 0,
tokenIds: bridgeRequest.token_ids,
totalCount: bridgeRequest.token_ids.length,
txHash: lastBridgeRequestEvent?.tx_hash,
};
}
);
Expand Down
Loading