Skip to content

Commit

Permalink
feat: stacking card copy + notarize tool fix
Browse files Browse the repository at this point in the history
Co-authored-by: kyranjamie <kyran.burraston@gmail.com>
  • Loading branch information
edgarkhanzadian and kyranjamie committed May 13, 2024
1 parent 31c291f commit 688fd3a
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 32 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/debug-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ jobs:
uses: ./.github/actions/linux-deps
if: matrix.os == 'ubuntu-20.04'

- uses: actions/setup-python@v5
if: matrix.os == 'macos-11'
with:
python-version: '3.10'

- name: Import GPG key
id: import_gpg_key
uses: crazy-max/ghaction-import-gpg@v5
Expand Down Expand Up @@ -128,6 +133,7 @@ jobs:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

- name: Build releases
if: matrix.os != 'macos-11'
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ jobs:
uses: ./.github/actions/linux-deps
if: matrix.os == 'ubuntu-20.04'

- uses: actions/setup-python@v5
if: matrix.os == 'macos-11'
with:
python-version: '3.10'

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

- uses: actions/setup-python@v5
if: matrix.os == 'macos-11'
with:
python-version: '3.10'

- name: Add required Linux dependencies
uses: ./.github/actions/linux-deps
if: matrix.os == 'ubuntu-20.04'
Expand Down Expand Up @@ -96,6 +101,7 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets[matrix.CSC_KEY_PASSWORD_SECRET_NAME] }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

- name: Build releases
if: matrix.os != 'macos-11'
Expand Down
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"electron": "22.3.24",
"electron-builder": "22.10.5",
"electron-devtools-installer": "3.2.0",
"electron-notarize": "1.0.0",
"electron-notarize": "1.2.2",
"electron-rebuild": "3.2.9",
"enzyme": "3.11.0",
"eslint-plugin-jsx-a11y": "6.7.1",
Expand Down
4 changes: 2 additions & 2 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { notarize } = require('electron-notarize');
const { appId } = require('../electron-builder.js');

exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
Expand All @@ -10,9 +9,10 @@ exports.default = async function notarizing(context) {
const appName = context.packager.appInfo.productFilename;

return await notarize({
appBundleId: `${String(appId)}`,
tool: 'notarytool',
appPath: `${String(appOutDir)}/${String(appName)}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASS,
teamId: process.env.APPLE_TEAM_ID,
});
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8122,10 +8122,10 @@ electron-localshortcut@^3.1.0:
keyboardevent-from-electron-accelerator "^2.0.0"
keyboardevents-areequal "^0.2.1"

electron-notarize@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/electron-notarize/-/electron-notarize-1.0.0.tgz#bc925b1ccc3f79e58e029e8c4706572b01a9fd8f"
integrity sha512-dsib1IAquMn0onCrNMJ6gtEIZn/azG8hZMCYOuZIMVMUeRMgBYHK1s5TK9P8xAcrAjh/2aN5WYHzgVSWX314og==
electron-notarize@1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/electron-notarize/-/electron-notarize-1.2.2.tgz#ebf2b258e8e08c1c9f8ff61dc53d5b16b439daf4"
integrity sha512-ZStVWYcWI7g87/PgjPJSIIhwQXOaw4/XeXU+pWqMMktSLHaGMLHdyPPN7Cmao7+Cr7fYufA16npdtMndYciHNw==
dependencies:
debug "^4.1.1"
fs-extra "^9.0.1"
Expand Down

0 comments on commit 688fd3a

Please sign in to comment.