Skip to content

Commit

Permalink
chore(staking): add select network option in staking overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Hemanthghs committed May 16, 2024
1 parent 6962674 commit b43bba5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
28 changes: 18 additions & 10 deletions frontend/src/app/(routes)/staking/components/StakingOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { getBalances } from '@/store/features/bank/bankSlice';
import useGetChainInfo from '@/custom-hooks/useGetChainInfo';
import Image from 'next/image';
import {
NO_DELEGATIONS_MSG,
NO_MESSAGES_ILLUSTRATION,
OVERVIEW_NO_DELEGATIONS,
} from '@/utils/constants';
import { CircularProgress } from '@mui/material';
import MainTopNav from '@/components/MainTopNav';
Expand Down Expand Up @@ -161,15 +161,23 @@ const StakingOverview = () => {
{(!isAuthzMode && delegationsLoading === 0 && !hasDelegations) ||
(isAuthzMode && authzDelegationsLoading && !hasAuthzDelegations) ? (
<div className="no-data">
<Image
src={NO_MESSAGES_ILLUSTRATION}
width={200}
height={177}
alt={'No Transactions'}
draggable={false}
/>
<div className="text-[16px] opacity-50 mt-2 mb-6 leading-normal italic font-extralight text-center">
{NO_DELEGATIONS_MSG}
<div className="flex-1 flex flex-col justify-center items-center gap-4">
<Image
src={NO_MESSAGES_ILLUSTRATION}
width={400}
height={235}
alt={'No Transactions'}
draggable={false}
/>
<p>{OVERVIEW_NO_DELEGATIONS}</p>
<button
className="primary-custom-btn"
onClick={() => {
document.getElementById('select-network')!.click();
}}
>
Select Network
</button>
</div>
</div>
) : null}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export const LOGOUT_ICON = '/logout-icon.svg';
export const TRANSFERS_CARDS_COUNT = 5;
export const NO_MESSAGES_ILLUSTRATION = '/no-messages-illustration.png';
export const NO_DELEGATIONS_MSG = `Looks like you haven't staked anything yet, go ahead and explore !`;
export const OVERVIEW_NO_DELEGATIONS = "Looks like you haven't staked anything yet, Select a network to delegate your tokens!"
export const VOTE_OPTIONS = ['Yes', 'Abstain', 'No', 'No With Veto'];
export const MAP_TXN_TYPES: Record<string, string[]> = {
'/cosmos.staking.v1beta1.MsgDelegate': ['delegated', 'delegating'],
Expand Down

0 comments on commit b43bba5

Please sign in to comment.