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 10433d0
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/debug-build.yml
Expand Up @@ -58,6 +58,10 @@ jobs:
uses: ./.github/actions/linux-deps
if: matrix.os == 'ubuntu-20.04'

- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Import GPG key
id: import_gpg_key
uses: crazy-max/ghaction-import-gpg@v5
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/integration-tests.yml
Expand Up @@ -41,6 +41,10 @@ jobs:
uses: ./.github/actions/linux-deps
if: matrix.os == 'ubuntu-20.04'

- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install packages
uses: nick-invision/retry@v2
if: steps.cache-node-modules.outputs.cache-hit != 'true'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish-version.yml
Expand Up @@ -46,6 +46,10 @@ jobs:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}-${{ secrets.CACHE_BUSTER }}

- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Add required Linux dependencies
uses: ./.github/actions/linux-deps
if: matrix.os == 'ubuntu-20.04'
Expand Down
7 changes: 6 additions & 1 deletion app/components/home/stacking-promo-card.tsx
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
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 10433d0

Please sign in to comment.