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

Develop #77

Closed
wants to merge 14 commits into from
Closed
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
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_VERCEL_ENV=
AIRTABLE_API_KEY=
FUN_DATABASE_URL=
OPTIMISM_VOTE_ENDPOINT=
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.17.1
2 changes: 1 addition & 1 deletion app/(embeds)/embed/EmbedContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const EmbedContainer = ({
<div className="relative w-[calc(115.7px/4*3)] h-[22px] md:w-[115.7px] md:h-[32px] pl-[8px] pr-[2.5px] pb-[4px] md:pl-[4px] md:pr-[5px] md:pb-[8px]">
<div className="relative w-full h-full">
<Image
src="/logo_full.png"
src="/logo-restake.svg"
alt="Forest"
className="hidden dark:block"
fill={true}
Expand Down
27 changes: 11 additions & 16 deletions app/(embeds)/embed/fundamentals/[metric]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
"use client";
import { use, useEffect, useLayoutEffect, useMemo, useState } from "react";
import { useLayoutEffect, useMemo, useState } from "react";
import Error from "next/error";
import { MetricsResponse } from "@/types/api/MetricsResponse";
import { useLocalStorage, useSessionStorage } from "usehooks-ts";
import useSWR from "swr";
import { MetricsURLs } from "@/lib/urls";
import { AllChains, AllChainsByKeys } from "@/lib/chains";
import { AllChains } from "@/lib/chains";
import { navigationItems } from "@/lib/navigation";
import { format } from "date-fns";
import ComparisonChart from "@/components/layout/ComparisonChart";
import MetricsTable from "@/components/layout/MetricsTable";
import { intersection } from "lodash";
import { Icon } from "@iconify/react";
import Link from "next/link";
import { useTheme } from "next-themes";
import { useSearchParams, useRouter, usePathname } from "next/navigation";
import { useSearchParams } from "next/navigation";
import { MasterResponse } from "@/types/api/MasterResponse";
import { MasterURL } from "@/lib/urls";

Expand All @@ -37,7 +33,7 @@ const Chain = ({ params }: { params: any }) => {
// chains query is an array of chains to display
const queryChains = searchParams ? searchParams.get("chains") : null;

const { theme, setTheme } = useTheme();
const { setTheme } = useTheme();
useLayoutEffect(() => {
setTimeout(() => {
if (queryTheme == "light") {
Expand All @@ -48,20 +44,19 @@ const Chain = ({ params }: { params: any }) => {
}, 1000);
}, []);

const [showUsd, setShowUsd] = useState(true);
const [errorCode, setErrorCode] = useState<number | null>(null);
const [errorCode] = useState<number | null>(null);
const {
data: master,
error: masterError,
isLoading: masterLoading,
isValidating: masterValidating,
// error: masterError,
// isLoading: masterLoading,
// isValidating: masterValidating,
} = useSWR<MasterResponse>(MasterURL);

const {
data: metricData,
error: metricError,
isLoading: metricLoading,
isValidating: metricValidating,
// error: metricError,
// isLoading: metricLoading,
// isValidating: metricValidating,
} = useSWR<MetricsResponse>(MetricsURLs[params.metric]);

const chainKeys = useMemo(() => {
Expand Down
43 changes: 18 additions & 25 deletions app/(embeds)/embed/user-base/page.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
"use client";
import Home from "@/components/home/Home";
import LandingUserBaseChart from "@/components/home/LandingUserBaseChart";
import Container from "@/components/layout/Container";
import Heading from "@/components/layout/Heading";
import LandingTopContracts from "@/components/layout/LandingTopContracts";
import Icon from "@/components/layout/ServerIcon";
// import ShowLoading from "@/components/layout/ShowLoading";
import Subheading from "@/components/layout/Subheading";
import { Metadata } from "next";
import { useEffect, useMemo, useState, useRef, useLayoutEffect } from "react";
import { useMediaQuery } from "@react-hook/media-query";
import useSWR from "swr";
import { MasterResponse } from "@/types/api/MasterResponse";
import { AllChains, AllChainsByKeys } from "@/lib/chains";
import { LandingPageMetricsResponse } from "@/types/api/LandingPageMetricsResponse";
import { LandingURL, MasterURL } from "@/lib/urls";
import LandingChart from "@/components/layout/LandingChart";
import EmbedContainer from "../EmbedContainer";
import { useSearchParams } from "next/navigation";
import { useTheme } from "next-themes";

// export async function generateMetadata(): Promise<Metadata> {
// return {
// title: "Growing Ethereum’s Ecosystem Together - Layer 2 User Base",
// description:
// "At growthepie, our mission is to provide comprehensive and accurate analytics of layer 2 solutions for the Ethereum ecosystem, acting as a trusted data aggregator from reliable sources such as L2Beat and DefiLlama, while also developing our own metrics.",
// };
// }

export default function Page() {
const searchParams = useSearchParams();
const queryTheme = searchParams ? searchParams.get("theme") : null;
const queryTimespan = searchParams ? searchParams.get("timespan") : null;
const queryMetric = searchParams ? searchParams.get("metric") : null;
const queryShowMainnet = searchParams ? searchParams.get("showMainnet") : null;
const queryShowMainnet = searchParams
? searchParams.get("showMainnet")
: null;
const queryZoomed = searchParams ? searchParams.get("zoomed") : null;
const queryStartTimestamp = searchParams ? searchParams.get("startTimestamp") : null;
const queryEndTimestamp = searchParams ? searchParams.get("endTimestamp") : null;
const queryStartTimestamp = searchParams
? searchParams.get("startTimestamp")
: null;
const queryEndTimestamp = searchParams
? searchParams.get("endTimestamp")
: null;

const { theme, setTheme } = useTheme();
useLayoutEffect(() => {
Expand Down Expand Up @@ -76,7 +63,9 @@ export default function Page() {

const [selectedTimeInterval, setSelectedTimeInterval] = useState("weekly");

const [selectedMetric, setSelectedMetric] = useState(queryMetric ?? "Total Users");
const [selectedMetric, setSelectedMetric] = useState(
queryMetric ?? "Total Users",
);

useEffect(() => {
if (landing) {
Expand Down Expand Up @@ -135,8 +124,12 @@ export default function Page() {
embed_timespan={queryTimespan ?? "365d"}
embed_show_mainnet={queryShowMainnet === "true"}
embed_zoomed={queryZoomed === "true"}
embed_start_timestamp={queryStartTimestamp ? parseInt(queryStartTimestamp) : undefined}
embed_end_timestamp={queryEndTimestamp ? parseInt(queryEndTimestamp) : undefined}
embed_start_timestamp={
queryStartTimestamp ? parseInt(queryStartTimestamp) : undefined
}
embed_end_timestamp={
queryEndTimestamp ? parseInt(queryEndTimestamp) : undefined
}
/>
) : null}
</>
Expand Down
16 changes: 4 additions & 12 deletions app/(fees)/fees/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import Image from "next/image";
import Link from "next/link";
import Sidebar from "@/components/layout/Sidebar";
import Icon from "@/components/layout/Icon";

import EthUsdSwitch from "@/components/layout/EthUsdSwitch";

import Banner from "@/components/Banner";
import Notification from "@/components/Notification";
import HeaderLinks from "@/components/layout/HeaderLinks";
import { track } from "@vercel/analytics";
// import HeaderLinks from "@/components/layout/HeaderLinks";

export default function Header() {
return (
Expand All @@ -16,10 +12,6 @@ export default function Header() {
<div className="flex space-x-0 xl:space-x-6 w-full h-full ">
{/*Banner/Notification Area */}

{/* <div className={`hidden md:flex `}>
<Notification />
</div> */}

<div className="flex justify-between items-start h-full relative w-full left-1 ">
<Link href="/" className="flex gap-x-1">
{/* <div className="h-[45px] w-[206px]"> */}
Expand Down Expand Up @@ -91,9 +83,9 @@ export default function Header() {
<div className="items-center z-10 hidden md:flex md:space-x-[34px] h-full mt-[7px]">
<EthUsdSwitch />

<div className="flex space-x-[22px] pr-2.5 items-center">
{/* <div className="flex space-x-[22px] pr-2.5 items-center">
<HeaderLinks />
</div>
</div> */}
</div>
{process.env.NEXT_PUBLIC_VERCEL_ENV !== undefined &&
["development", "preview"].includes(
Expand Down
Loading