Skip to content

Commit

Permalink
fix: stacking card copy
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Apr 23, 2024
1 parent 31c291f commit 557941e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
7 changes: 6 additions & 1 deletion app/components/home/stacking-promo-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,19 @@ export const StackingPromoCard: FC = () => {
<Text textStyle="display.large" mt="tight">
Have a chance to earn BTC by locking your STX temporarily
</Text>

<Text textStyle="caption" color={color('text-caption')} lineHeight={1.6} mt="tight">
Stacking already? Stacking info is now found on lockstacks.com
</Text>

<Button
mt="base"
alignSelf="flex-start"
mode="tertiary"
isDisabled={hasPendingDelegateStxCall}
onClick={() => history.push(routes.CHOOSE_STACKING_METHOD)}
>
{hasPendingDelegateStxCall ? 'Delegation pending' : 'Get started →'}
{'Get stacking on Lockstacks →'}
</Button>
</Flex>
</Box>
Expand Down
44 changes: 20 additions & 24 deletions app/pages/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ import {
TransactionListItem,
BalanceCard,
} from '@components/home';
import { DelegationCard } from '@components/home/delegation-card';
import { StackingBeginsSoonCard } from '@components/home/stacking-begins-soon-card';
import { StackingCard } from '@components/home/stacking-card';
import { StackingError } from '@components/home/stacking-error-card';
import { StackingLoading } from '@components/home/stacking-loading';
import { TransactionListItemMempool } from '@components/home/transaction-list/transaction-list-item-mempool';
import routes from '@constants/routes.json';
import { useAnalytics } from '@hooks/use-analytics';
import { useApi } from '@hooks/use-api';
import { useBalance } from '@hooks/use-balance';
import { useDelegationStatus } from '@hooks/use-delegation-status';
import { usePromptUserToSetDiagnosticPermissions } from '@hooks/use-diagnostic-permission-prompt';
import { useLatestNonce } from '@hooks/use-latest-nonce';
import { useTransactionList } from '@hooks/use-transaction-list';
Expand All @@ -30,7 +24,6 @@ import {
selectTxModalOpen,
selectReceiveModalOpen,
selectHomeCardState,
HomeCardState,
} from '@store/home';
import { selectRevokeDelegationModalOpen } from '@store/home/home.reducer';
import { RootState } from '@store/index';
Expand All @@ -39,7 +32,8 @@ import { selectLoadingStacking, selectNextCycleInfo, selectStackerInfo } from '@
import { selectActiveNodeApi } from '@store/stacks-node';
import { selectTransactionsLoading, selectTransactionListFetchError } from '@store/transaction';
import { openTxInExplorer } from '@utils/external-links';
import React, { FC } from 'react';
import React from 'react';
import { FC } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Route, Switch } from 'react-router-dom';

Expand All @@ -49,7 +43,6 @@ export const Home: FC = () => {
useLatestNonce();
usePromptUserToSetDiagnosticPermissions();

const { delegated: isDelegated } = useDelegationStatus();
const { availableBalance } = useBalance();

const {
Expand All @@ -60,8 +53,6 @@ export const Home: FC = () => {
receiveModalOpen,
revokeDelegationModalOpen,
activeNode,
stackerInfo,
stackingCardState,
} = useSelector((state: RootState) => ({
address: selectAddress(state),
txModalOpen: selectTxModalOpen(state),
Expand Down Expand Up @@ -126,18 +117,23 @@ export const Home: FC = () => {
/>
);

const stackingCardMap: Record<HomeCardState, JSX.Element> = {
[HomeCardState.LoadingResources]: <StackingLoading />,
[HomeCardState.NotEnoughStx]: <StackingPromoCard />,
[HomeCardState.EligibleToParticipate]: <StackingPromoCard />,
[HomeCardState.StackingPendingContactCall]: <StackingLoading />,
[HomeCardState.StackingPreCycle]: (
<StackingBeginsSoonCard blocksTillNextCycle={stackerInfo?.blocksUntilStackingCycleBegins} />
),
[HomeCardState.StackingActive]: <StackingCard />,
[HomeCardState.StackingError]: <StackingError />,
[HomeCardState.PostStacking]: <></>,
};
// const stackingCardMap: Record<HomeCardState, JSX.Element> = {
// [HomeCardState.LoadingResources]: (
// <>
// <StackingPromoCard />
// <StackingLoading />
// </>
// ),
// [HomeCardState.NotEnoughStx]: <StackingPromoCard />,
// [HomeCardState.EligibleToParticipate]: <StackingPromoCard />,
// [HomeCardState.StackingPendingContactCall]: <StackingLoading />,
// [HomeCardState.StackingPreCycle]: (
// <StackingBeginsSoonCard blocksTillNextCycle={stackerInfo?.blocksUntilStackingCycleBegins} />
// ),
// [HomeCardState.StackingActive]: <StackingCard />,
// [HomeCardState.StackingError]: <StackingError />,
// [HomeCardState.PostStacking]: <></>,
// };

const stackingRewardCard = (
<StackingRewardCard lifetime="0.0281 Bitcoin (sample)" lastCycle="0.000383 Bitcoin (sample)" />
Expand All @@ -151,7 +147,7 @@ export const Home: FC = () => {
<HomeLayout
transactionList={transactionList}
balanceCard={balanceCard}
stackingCard={isDelegated ? <DelegationCard /> : stackingCardMap[stackingCardState]}
stackingCard={<StackingPromoCard />}
stackingRewardCard={stackingRewardCard}
/>
<Switch>
Expand Down

0 comments on commit 557941e

Please sign in to comment.