Skip to content

Commit

Permalink
merge dev changes, remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
manishiwa committed Jan 25, 2024
1 parent ebb5fb6 commit cbeae04
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 85 deletions.
48 changes: 23 additions & 25 deletions app/(layout)/chains/[chain]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,30 +64,29 @@ const Chain = ({ params }: { params: any }) => {
return flattenedData;
});

console.log(chainData);
const {
data: usageData,
error: usageError,
isLoading: usageLoading,
isValidating: usageValidating,
} = useSWR<ChainOverviewResponse>(BlockspaceURLs["chain-overview"]);
// const {
// data: usageData,
// error: usageError,
// isLoading: usageLoading,
// isValidating: usageValidating,
// } = useSWR<ChainOverviewResponse>(BlockspaceURLs["chain-overview"]);

const chainFilter = useMemo(() => {
const filteredChains: Chains = Object.keys(AllChainsByKeys)
.filter((key) => key === chainKey[0] || key === "all_l2s")
.reduce((result, chain) => {
const filterKey = AllChainsByKeys[chain].key;
const chainData = usageData?.data.chains[filterKey];
// const chainFilter = useMemo(() => {
// const filteredChains: Chains = Object.keys(AllChainsByKeys)
// .filter((key) => key === chainKey[0] || key === "all_l2s")
// .reduce((result, chain) => {
// const filterKey = AllChainsByKeys[chain].key;
// const chainData = usageData?.data.chains[filterKey];

if (chainData) {
result[filterKey] = chainData;
}
// if (chainData) {
// result[filterKey] = chainData;
// }

return result;
}, {});
// return result;
// }, {});

return filteredChains;
}, [chainKey, usageData?.data.chains]);
// return filteredChains;
// }, [chainKey, usageData?.data.chains]);

const [selectedTimespan, setSelectedTimespan] = useSessionStorage(
"blockspaceTimespan",
Expand All @@ -99,8 +98,8 @@ const Chain = ({ params }: { params: any }) => {
return (
<>
<ShowLoading
dataLoading={[masterLoading, chainLoading, usageLoading]}
dataValidating={[masterValidating, chainValidating, usageValidating]}
dataLoading={[masterLoading, chainLoading]}
dataValidating={[masterValidating, chainValidating]}
/>
<Container className="flex w-full mt-[65px] md:mt-[45px]">
{master && (
Expand Down Expand Up @@ -277,7 +276,7 @@ const Chain = ({ params }: { params: any }) => {
</div>
)}
</Container>
{usageData && chainKey[0] !== "ethereum" && (
{/* {usageData && chainKey[0] !== "ethereum" && (
<>
<Container className="flex flex-col w-full mt-[65px] md:mt-[60px]">
<div className="flex items-center w-[99.8%] justify-between md:text-[36px] mb-[15px] relative">
Expand Down Expand Up @@ -311,10 +310,9 @@ const Chain = ({ params }: { params: any }) => {
setSelectedTimespan={setSelectedTimespan}
data={chainFilter}
forceSelectedChain={chainKey[0]}
// data={!chainEcosystemFilter || chainEcosystemFilter=== "all-chains" ? usageData.data.chains : )}
/>
</>
)}
)} */}
</>
);
};
Expand Down
1 change: 0 additions & 1 deletion app/(layout)/optimism-retropgf-3/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,6 @@ export default function Page() {
}, [contentWidth, tableWidth]);

const compileCSV = () => {
console.log(projects.length, listAmountsByProjectId);
if (!projects || !listAmountsByProjectId) return "";

const data = projects.map((d) => {
Expand Down
1 change: 0 additions & 1 deletion components/charts/Treemap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ export default function Treemap({ d }: { d?: any }) {

const tooltipFormatter = useCallback(
function (this: Highcharts.TooltipFormatterContextObject) {
console.log("this", this);
// return;
const { point, color, series, key } = this;

Expand Down
111 changes: 56 additions & 55 deletions components/layout/MetricsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,19 +344,19 @@ const MetricsTable = ({

return (
<div className="flex flex-col mt-3 md:mt-0 ml-0 lg:-ml-2 font-semibold space-y-[5px] overflow-x-scroll md:overflow-x-visible z-100 w-full py-5 scrollbar-thin scrollbar-thumb-forest-900 scrollbar-track-forest-500/5 scrollbar-thumb-rounded-full scrollbar-track-rounded-full scroller">
<div className="relative min-w-[570px] md:min-w-[600px] lg:min-w-full pr-[20px] md:pr-[50px] lg:pr-2 w-full">
<div className="min-w-[570px] md:min-w-[600px] lg:min-w-full pr-[20px] md:pr-[50px] lg:pr-2 w-full">
<div
className={`flex items-center justify-between py-1 pl-4 pr-7 lg:pl-2 lg:pr-12 rounded-full font-semibold whitespace-nowrap text-xs lg:text-sm lg:mt-4`}
>
<div
className={`${
className={` ${
isSidebarOpen ? "w-1/4 2xl:w-1/3" : "w-1/3"
} pl-[44px] lg:pl-[52px]`}
>
{timeIntervalKey === "monthly" ? "Last 30d" : "Yesterday"}
</div>
<div
className={`${
className={`relative ${
isSidebarOpen ? "w-3/4 2xl:w-2/3" : "w-2/3"
} flex pr-7 lg:pr-4`}
>
Expand All @@ -382,64 +382,65 @@ const MetricsTable = ({
{label}
</div>
))}
</div>
<div
className={`absolute right-[44px] md:right-[33px] cursor-pointer `}
onClick={onChainSelectToggle}
>
<div
className="absolute rounded-full top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
style={{
color: chainSelectToggleState === "all" ? undefined : "#5A6462",
}}
className={`absolute -right-[4px] -top-[4px] lg:top-0 lg:-right-[24px] cursor-pointer `}
onClick={onChainSelectToggle}
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={`w-6 h-6 ${
chainSelectToggleState === "none"
? "opacity-100"
: "opacity-0"
}`}
<div
className="absolute rounded-full top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
style={{
color:
chainSelectToggleState === "all" ? undefined : "#5A6462",
}}
>
<circle
<svg
xmlns="http://www.w3.org/2000/svg"
cx="12"
cy="12"
r="8"
/>
</svg>
</div>
<div
className={`p-1 rounded-full ${
chainSelectToggleState === "none"
? "bg-forest-50 dark:bg-[#1F2726]"
: "bg-white dark:bg-forest-1000"
}`}
>
<Icon
icon="feather:check-circle"
className={`w-[17.65px] h-[17.65px] ${
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={`w-6 h-6 ${
chainSelectToggleState === "none"
? "opacity-100"
: "opacity-0"
}`}
>
<circle
xmlns="http://www.w3.org/2000/svg"
cx="12"
cy="12"
r="8"
/>
</svg>
</div>
<div
className={`p-1 rounded-full ${
chainSelectToggleState === "none"
? "opacity-0"
: "opacity-100"
? "bg-forest-50 dark:bg-[#1F2726]"
: "bg-white dark:bg-forest-1000"
}`}
style={{
color:
chainSelectToggleState === "all"
? undefined
: chainSelectToggleState === "normal"
? "#5A6462"
: "#5A6462",
}}
/>
>
<Icon
icon="feather:check-circle"
className={`w-[17.65px] h-[17.65px] ${
chainSelectToggleState === "none"
? "opacity-0"
: "opacity-100"
}`}
style={{
color:
chainSelectToggleState === "all"
? undefined
: chainSelectToggleState === "normal"
? "#5A6462"
: "#5A6462",
}}
/>
</div>
</div>
</div>
</div>
Expand Down
3 changes: 0 additions & 3 deletions components/layout/OverviewMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,6 @@ export default function OverviewMetrics({
const [selectedChain, setSelectedChain] = useState<string | null>(
forceSelectedChain ?? null,
);
console.log(selectedChain);

console.log(data);

const relativePercentageByChain = useMemo(() => {
return Object.keys(data).reduce((acc, chainKey) => {
Expand Down

1 comment on commit cbeae04

@vercel
Copy link

@vercel vercel bot commented on cbeae04 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.