-
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.
feat: make selet network dropdown functional
- Loading branch information
Showing
12 changed files
with
182 additions
and
11 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import NavBars from "@/components/NavBars"; | ||
import { Outlet } from "react-router-dom"; | ||
import { useState } from "react"; | ||
import { Outlet, useOutletContext } from "react-router-dom"; | ||
import { AVAILABLE_NETWORKS } from "@/constants"; | ||
import type { AppContextType, NetworkType } from "@/types/index"; | ||
|
||
export default function App() { | ||
const [selectedNetwork, setSelectedNetwork] = useState<NetworkType>(Object.values(AVAILABLE_NETWORKS)[0]); | ||
|
||
const outletContext = { selectedNetwork, setSelectedNetwork } | ||
return ( | ||
<> | ||
<NavBars /> | ||
<Outlet /> | ||
<NavBars selectedNetwork={selectedNetwork} setSelectedNetwork={setSelectedNetwork} /> | ||
<Outlet context={outletContext satisfies AppContextType} /> | ||
</> | ||
) | ||
} | ||
|
||
export function useApp() { | ||
return useOutletContext<AppContextType>(); | ||
} |
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,14 @@ | ||
export const AVAILABLE_NETWORKS = { | ||
zkSync: { | ||
name: "zkSync", | ||
logoUrl: "/images/zksync_black.png", | ||
}, | ||
Linea: { | ||
name: "Linea", | ||
logoUrl: "/images/linea.png", | ||
}, | ||
Scroll: { | ||
name: "Scroll", | ||
logoUrl: "/images/scroll.svg", | ||
}, | ||
}; |
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,6 @@ | ||
export default function Explore() { | ||
return ( | ||
<div>Explore</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
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,22 @@ | ||
import { Link } from "react-router-dom"; | ||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardTitle, | ||
} from "@/components/ui/card" | ||
|
||
export default function ClaimZkTokenAirdropCard() { | ||
return ( | ||
<Link to="https://claim.zknation.io/"> | ||
<Card className="mt-5 shadow-md rounded-3xl border-0 cursor-pointer hover:opacity-75 bg-white/70 relative overflow-clip"> | ||
<CardContent className="p-5 px-5 text-center"> | ||
<CardTitle className="font-semibold text-lg">ZKsync Token Launch</CardTitle> | ||
<CardDescription>Check and claim your ZK airdrop today</CardDescription> | ||
</CardContent> | ||
<img className="absolute z-[-1] border-[50%] w-28 -right-2 -top-2 opacity-45" src="data:image/png;base64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3alUJSbdWLsLIiE/F+f8IVN4h8MkR8Hh+lT6votUcm+wN2V9P+VXmceDkNwhKwchlSUlsx6/cjp9VUiFshCE+HcC8yYFNRsl91gNeGpnDA/p5Ojg0GkZ6nQth/YE2FkMUxrVgtGPwB2xsqiDU+PPP01MK2NK0c0TMgavQeeCZyJQXoFieMkYDX8vrqZoeD15KKZUyT4MIVpe0rQnOIW6RJcBTNIf0Bu5xWRZCWqZXTyvd6g5PTqji1mg/2m21KKxb9aZXTqnCwt338prQKrO6uMNBd5bQtffw2nhCXgD4HigAvpETthFhfojiiqx0OntXJI6a0Ui5ZX6LUF40P74j6/eiB7TUpbUFd0VhfxudOUAb2X94PAZaUEAqkvIyvb6ycS53gcXiwsqi0vyMlihur+lY3O9IkqEYP7K5LHbnVbbn44FLJLl67Dk/vBPXFh5bLQY4eAC9qhIKnlbIc1GqB7glB35M4oKtJq7xA13jJVN/VZQaWxbcjL5m2X8TWIVxQsiuL2M22FXQICwPdTUVtlbcVGm/06BBfUFspGz3ttt50CPuI/W3BTK5svbXZDNUh7CvTKm+GNtue1iHZ8UxVjrw93fbAgA4Z8H5L08MpBwZaH+HQIYftgsojH+Fof6hGh4yyfu0mxu73rXKopvkxJx3CghPi6etjTnbw7KKOAtrhzEs7LmsHmC/oSLkd8r+01y7sRZhLejXJXha7tNf37IXKi3rF1V46vrTXwO3FfPtUQoOPV9jnROwDL7N/cse+5mSQNh8Ks0+3GcQgBjGIQQxiEIMYxCAGMYhBDGIQgxjEIAYxiEEMYhCDGMQgBjGIQQxiEIMYxCAGMYhBDPKPQ/4DyIHLQ1NXxEgAAAAASUVORK5CYII=" /> | ||
</Card> | ||
</Link> | ||
) | ||
} | ||
|
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,11 @@ | ||
import { SetStateAction } from "react"; | ||
|
||
export interface AppContextType { | ||
selectedNetwork: NetworkType; | ||
setSelectedNetwork: React.Dispatch<SetStateAction<NetworkType>>; | ||
} | ||
|
||
export interface NetworkType { | ||
name: string; | ||
logoUrl: string; | ||
} |