Skip to content

Commit

Permalink
new api
Browse files Browse the repository at this point in the history
  • Loading branch information
YohanTz committed Oct 18, 2023
1 parent 65e49f0 commit 97ba480
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ function TransferAction() {
width="32"
xmlns="http://www.w3.org/2000/svg"
>
<mask id="path-1-inside-1_502_17917" fill="white">
<mask fill="white" id="path-1-inside-1_502_17917">
<path
fillRule="evenodd"
clipRule="evenodd"
d="M28.5 13.3726V11.7351C28.5 10.346 27.7794 9.05644 26.5964 8.32845L24.9915 7.34082C23.8136 7.90428 23 9.1071 23 10.4999C23 12.4329 24.567 13.9999 26.5 13.9999C27.2436 13.9999 27.9331 13.768 28.5 13.3726Z"
fillRule="evenodd"
/>
</mask>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M28.5 13.3726V11.7351C28.5 10.346 27.7794 9.05644 26.5964 8.32845L24.9915 7.34082C23.8136 7.90428 23 9.1071 23 10.4999C23 12.4329 24.567 13.9999 26.5 13.9999C27.2436 13.9999 27.9331 13.768 28.5 13.3726Z"
fill="#B4E1AC"
fillRule="evenodd"
/>
<path
d="M28.5 13.3726L29.0721 14.1928L29.5 13.8943V13.3726H28.5ZM26.5964 8.32845L26.0723 9.18011L26.5964 8.32845ZM24.9915 7.34082L25.5156 6.48916L25.0515 6.20358L24.56 6.43872L24.9915 7.34082ZM27.5 11.7351V13.3726H29.5V11.7351H27.5ZM26.0723 9.18011C26.9595 9.7261 27.5 10.6933 27.5 11.7351H29.5C29.5 9.99878 28.5992 8.38678 27.1205 7.47679L26.0723 9.18011ZM24.4674 8.19248L26.0723 9.18011L27.1205 7.47679L25.5156 6.48916L24.4674 8.19248ZM24 10.4999C24 9.50656 24.5793 8.64651 25.423 8.24292L24.56 6.43872C23.0479 7.16206 22 8.70765 22 10.4999H24ZM26.5 12.9999C25.1193 12.9999 24 11.8807 24 10.4999H22C22 12.9852 24.0147 14.9999 26.5 14.9999V12.9999ZM27.9279 12.5524C27.5234 12.8346 27.0325 12.9999 26.5 12.9999V14.9999C27.4548 14.9999 28.3428 14.7015 29.0721 14.1928L27.9279 12.5524Z"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Image from "next/image";
import { useState } from "react";

import NftsEmptyState from "~/app/_components/NftsEmptyState";
import NftsLoadingState from "~/app/_components/NftsLoadingState";
import useAccountFromChain from "~/app/_hooks/useAccountFromChain";
import useCurrentChain from "~/app/_hooks/useCurrentChain";
import { api } from "~/utils/api";
Expand All @@ -26,7 +27,7 @@ export default function NftTransferList() {
);

if (bridgeRequestData === undefined) {
return null;
return <NftsLoadingState className="mt-9 sm:mt-23" />;
}

return bridgeRequestData.length === 0 ? (
Expand Down
31 changes: 16 additions & 15 deletions apps/web/src/app/_components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ import Image from "next/image";

export default function Footer() {
return (
<footer className="sticky bottom-0 left-0 top-[100vh] mt-14 flex w-full flex-col bg-night-blue-source px-6 py-9 text-night-blue-200 sm:h-[7.125rem] sm:flex-row sm:items-center sm:justify-between">
<Image
alt="TheArkProject logo"
className="mb-6 sm:mb-0"
height={30}
src="/logos/arkproject.svg"
width={230}
/>
<div className="flex flex-col gap-6 sm:flex-row sm:items-center sm:gap-8">
{/* <Typography variant="button_text_l">Terms of use</Typography>
<Typography variant="button_text_l">FAQ</Typography>
<Typography variant="button_text_l">Documentation</Typography> */}
<Typography variant="button_text_l">© 2023 Screenshot Labs</Typography>
</div>
</footer>
// <footer className="sticky bottom-0 left-0 top-[100vh] mt-14 flex w-full flex-col bg-night-blue-source px-6 py-9 text-night-blue-200 sm:h-[7.125rem] sm:flex-row sm:items-center sm:justify-between">
// <Image
// alt="TheArkProject logo"
// className="mb-6 sm:mb-0"
// height={30}
// src="/logos/arkproject.svg"
// width={230}
// />
// <div className="flex flex-col gap-6 sm:flex-row sm:items-center sm:gap-8">
// {/* <Typography variant="button_text_l">Terms of use</Typography>
// <Typography variant="button_text_l">FAQ</Typography>
// <Typography variant="button_text_l">Documentation</Typography> */}
// <Typography variant="button_text_l">© 2023 Screenshot Labs</Typography>
// </div>
// </footer>
<></>
);
}
17 changes: 7 additions & 10 deletions apps/web/src/app/_components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"use client";

import { useAccount as useStarknetAccount } from "@starknet-react/core";
import {
useConnectors,
useAccount as useStarknetAccount,
} from "@starknet-react/core";
import { Typography } from "design-system";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
Expand All @@ -26,21 +29,15 @@ export default function Header() {
isConnected: isEthereumConnected,
isConnecting: isEthereumConnecting,
} = useEthereumAccount();
const {
// isConnected: isStarknetConnected,
// isConnecting: isStarknetConnecting,
} = useStarknetAccount();
const { isConnected: isStarknetConnected } = useStarknetAccount();
const { isLoading: isStarknetLoading } = useConnectors();

const router = useRouter();
const pathname = usePathname();

const isFullyConnected = isEthereumConnected;
// && isStarknetConnected;
// TODO @YohanTz: fix isConnecting in starknet-react
const isConnecting = isEthereumConnecting;
// ||
// isStarknetConnecting ||
// isStarknetConnecting === undefined;
const isConnecting = isEthereumConnecting || isStarknetLoading;

useEffect(() => {
if (pathname === "/" && isFullyConnected) {
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/server/api/routers/bridgeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export const bridgeRequestRouter = createTRPCRouter({
const { address } = input;

const bridgeRequestsResponse = await fetch(
`https://idx-testnet.starklane.io/requests/${address}`,
`${
process.env.NEXT_PUBLIC_STARKLANE_API_DOMAIN ?? ""
}/requests/${address}`,
{
headers: {
"Content-Type": "application/json",
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/server/api/routers/nfts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const nftsRouter = createTRPCRouter({
const ownedNftsResponse = await fetch(
`${
process.env.NEXT_PUBLIC_ARK_API_DOMAIN ?? ""
}/v1/owners/${validateAndParseAddress(address)}/nfts`,
}/v1/owners/${validateAndParseAddress(address)}/tokens`,
{
headers: {
"Content-Type": "application/json",
Expand All @@ -87,6 +87,7 @@ export const nftsRouter = createTRPCRouter({
);

if (ownedNftsResponse.status !== 200) {
console.log(ownedNftsResponse.status);
return { byCollection: {}, raw: [] };
}

Expand Down
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"HOSTNAME_L2",
"L2_DEPLOYER_PRIVATE_KEY",
"L2_DEPLOYER_ADDRESS",
"NEXT_PUBLIC_STARKLANE_API_DOMAIN",
"GOERLI_ALCHEMY_KEY",
"MAINNET_ALCHEMY_KEY",
"L2_DEPLOYER_SALT",
Expand Down

0 comments on commit 97ba480

Please sign in to comment.