Skip to content

Commit

Permalink
fix(provider): dashboard ui issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-arc10 committed Dec 6, 2024
1 parent 1fd37c4 commit 7539d14
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const PercentChange: React.FC<PercentChangeProps> = ({ currentPrice, previousPri
export const FinanceCard: React.FC<FinanceCardProps> = ({ title, subtitle, currentPrice, previousPrice, message }) => {
return (
<Card>
<CardContent className="rounded-lg p-6 shadow-md">
<CardContent className="p-6">
<div className="grid grid-cols-2 gap-4">
<div className="">
<div className="text-sm font-medium">{subtitle}</div>
Expand Down
6 changes: 2 additions & 4 deletions apps/provider-console/src/components/home/HomeContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ import React, { useEffect, useState } from "react";
import { useRouter } from "next/router";

import { useWallet } from "@src/context/WalletProvider";
import { useProviderActions } from "@src/queries/useProviderQuery";
import { Layout } from "../layout/Layout";
import { WelcomePanel } from "./WelcomePanel";

export const HomeContainer: React.FC = () => {
const router = useRouter();
const { isWalletConnected, isProvider, isOnline, isProviderStatusFetched } = useWallet();
const { isWalletConnected, isProvider, isProviderStatusFetched } = useWallet();
const [isLoading] = useState(false);
const { data: providerActions } = useProviderActions();

useEffect(() => {
if (isWalletConnected && isProviderStatusFetched && isProvider) {
router.push("/dashboard");
}
}, [isWalletConnected, isProvider, isOnline, providerActions, router]);
}, [isWalletConnected, isProvider, router, isProviderStatusFetched]);

return (
<Layout containerClassName="flex h-full flex-col justify-between" isLoading={isWalletConnected && (!isProviderStatusFetched || isLoading)}>
Expand Down
4 changes: 3 additions & 1 deletion apps/provider-console/src/components/home/WelcomePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const WelcomePanel: React.FC = () => {
</Avatar>

<div className="flex flex-col">
<Link href={UrlService.getStarted()}>Know more about Providers on Akash.</Link>
<Link href="https://console.akash.network/providers" target="_blank">
Know more about Providers on Akash.
</Link>
<span className="text-muted-foreground text-sm">Find out all about Akash Providers.</span>
</div>
</li>
Expand Down
10 changes: 5 additions & 5 deletions apps/provider-console/src/pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Dashboard: React.FC = () => {

const summaryCards = useMemo(
() => (
<>
<div className="grid grid-cols-3 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
<FinanceCard
title={formatUUsd(providerDashboard?.current.dailyUUsdEarned)}
subtitle="Earned (last 24H)"
Expand Down Expand Up @@ -70,7 +70,7 @@ const Dashboard: React.FC = () => {
previousPrice={providerDashboard?.previous.totalLeaseCount}
message="Change in total leases compared to 24 hours ago"
/>
</>
</div>
),
[providerDashboard]
);
Expand All @@ -90,14 +90,14 @@ const Dashboard: React.FC = () => {
{isLoadingProviderDashboard && <Spinner className="mb-2 ml-2 h-5 w-5" />}
</div>
</div>
<div className="mt-2 grid grid-cols-4 gap-4">
<div className="mt-2">
{isLoadingProviderDashboard ? (
<>
<div className="grid grid-cols-3 gap-4">
<DashboardCardSkeleton />
<DashboardCardSkeleton />
<DashboardCardSkeleton />
<DashboardCardSkeleton />
</>
</div>
) : (
summaryCards
)}
Expand Down

0 comments on commit 7539d14

Please sign in to comment.