Skip to content

Commit

Permalink
fix: prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Mar 14, 2024
1 parent 4ecbdd7 commit 8441f35
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { AddNetwork } from './pages/settings/add-network';
import { Network } from './pages/settings/network/network';
import { SignIn } from './pages/sign-in/sign-in';
import { DirectStackingInfo } from './pages/stacking/direct-stacking-info/direct-stacking-info';
import { GenerateSignerKeySignature } from './pages/stacking/generate-signature/signer-key-signature';
import { DelegateStackExtend } from './pages/stacking/pool-admin/delegate-stack-extend/delegate-stack-extend';
import { DelegateStackIncrease } from './pages/stacking/pool-admin/delegate-stack-increase/delegate-stack-increase';
import { DelegateStackStx } from './pages/stacking/pool-admin/delegate-stack-stx/delegate-stack-stx';
Expand All @@ -32,7 +33,6 @@ import { StackExtend } from './pages/stacking/stack-extend/stack-extend';
import { StackIncrease } from './pages/stacking/stack-increase/stack-increase';
import { StartDirectStacking } from './pages/stacking/start-direct-stacking/start-direct-stacking';
import { StartPooledStacking } from './pages/stacking/start-pooled-stacking/start-pooled-stacking';
import { GenerateSignerKeySignature } from './pages/stacking/generate-signature/signer-key-signature';

const queryClient = new QueryClient();
function Root() {
Expand Down
9 changes: 6 additions & 3 deletions src/hooks/use-generate-signature.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { openStructuredDataSignatureRequestPopup, SignatureData } from '@stacks/connect';
import { useCallback, useState } from 'react';
import { useStacksNetwork } from './use-stacks-network';
import { useStackingClient } from '@components/stacking-client-provider/stacking-client-provider';

import { SignatureData, openStructuredDataSignatureRequestPopup } from '@stacks/connect';
import {
Pox4SignatureTopic,
pox4SignatureMessage,
verifyPox4SignatureHash,
} from '@stacks/stacking';

import { useStackingClient } from '@components/stacking-client-provider/stacking-client-provider';

import { useStacksNetwork } from './use-stacks-network';

export interface GenerateSignatureOptions {
rewardCycle: number;
poxAddress: string;
Expand Down
9 changes: 6 additions & 3 deletions src/pages/stacking/generate-signature/components/auth-id.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { useField } from 'formik';
import { Description, Step } from '../../components/stacking-form-step';
import { Box, Button, Input, Text } from '@stacks/ui';
import React from 'react';

import { Box, Button, Input, Text } from '@stacks/ui';
import { useField } from 'formik';

import { ErrorLabel } from '@components/error-label';
import { ErrorText } from '@components/error-text';

import { Description, Step } from '../../components/stacking-form-step';

export function AuthId() {
const [field, meta, helpers] = useField('authId');
// const form = useFormikContext<{ topic: string }>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from 'react';

import { SignatureData } from '@stacks/connect';
import { Box, Flex, Text, useClipboard } from '@stacks/ui';
import { IconCopy } from '@tabler/icons-react';
import { useFormikContext } from 'formik';

import { Hr } from '@components/hr';
import {
InfoCardGroup as Group,
Expand All @@ -9,22 +14,20 @@ import {
InfoCardSection as Section,
InfoCardValue as Value,
} from '@components/info-card';
import { PoxAddress } from '../../start-direct-stacking/components/pox-address/pox-address';
import { Screen } from '@components/screen';
import { StackingFormContainer } from '../../components/stacking-form-container';
import { RewardCycle } from '../../pool-admin/components/choose-reward-cycle';
import { useGetPoxInfoQuery } from '@components/stacking-client-provider/stacking-client-provider';
import { truncateMiddle } from '@utils/tx-utils';

import { ConfirmAndSubmit } from '../../components/confirm-and-submit';
import { Topic } from './topic';
import { Duration } from '../../pool-admin/components/choose-duration';
import { SignatureData } from '@stacks/connect';
import { StackingFormContainer } from '../../components/stacking-form-container';
import { StackingFormInfoPanel } from '../../components/stacking-form-info-panel';
import { Duration } from '../../pool-admin/components/choose-duration';
import { RewardCycle } from '../../pool-admin/components/choose-reward-cycle';
import { PoxAddress } from '../../start-direct-stacking/components/pox-address/pox-address';
import { GenerateSignatureFields, MAX_U128 } from '../types';
import { truncateMiddle } from '@utils/tx-utils';
import { useGetPoxInfoQuery } from '@components/stacking-client-provider/stacking-client-provider';
import { IconCopy } from '@tabler/icons-react';
import { MaxAmount } from './max-amount';
import { AuthId } from './auth-id';
import { useFormikContext } from 'formik';
import { MaxAmount } from './max-amount';
import { Topic } from './topic';

export function GenerateSignatureLayout({
signatureData,
Expand Down
11 changes: 7 additions & 4 deletions src/pages/stacking/generate-signature/components/max-amount.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { useField } from 'formik';
import { Description, Step } from '../../components/stacking-form-step';
import { Box, Button, Input, Text } from '@stacks/ui';
import React from 'react';
import { MAX_U128 } from '../types';

import { Box, Button, Input, Text } from '@stacks/ui';
import { useField } from 'formik';

import { ErrorLabel } from '@components/error-label';
import { ErrorText } from '@components/error-text';

import { Description, Step } from '../../components/stacking-form-step';
import { MAX_U128 } from '../types';

export function MaxAmount() {
const [field, meta, helpers] = useField('maxAmount');
// const form = useFormikContext<{ topic: string }>();
Expand Down
3 changes: 2 additions & 1 deletion src/pages/stacking/generate-signature/components/topic.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Box, Text } from '@stacks/ui';
import { useField } from 'formik';

import { Description, Step } from '../../components/stacking-form-step';
import { Box, Text } from '@stacks/ui';

export function Topic() {
const [field, _meta] = useField('topic');
Expand Down
19 changes: 11 additions & 8 deletions src/pages/stacking/generate-signature/signer-key-signature.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import React, { createContext, useMemo } from 'react';
import { Form, Formik } from 'formik';
import { useParams } from 'react-router-dom';

import { SignatureData } from '@stacks/connect';
import { Pox4SignatureTopic } from '@stacks/stacking';
import { Form, Formik } from 'formik';

import { useAuth } from '@components/auth-provider/auth-provider';
import { GenerateSignatureLayout } from './components/generate-signature-layout';
import { useGenerateStackingSignature } from '../../../hooks/use-generate-signature';
import { useParams } from 'react-router-dom';
import { GenerateSignatureFields, MAX_U128 } from './types';
import { CenteredErrorAlert } from '@components/centered-error-alert';
import { CenteredSpinner } from '@components/centered-spinner';
import { useGetPoxInfoQuery } from '@components/stacking-client-provider/stacking-client-provider';
import { CenteredErrorAlert } from '@components/centered-error-alert';
import { SignatureData } from '@stacks/connect';
import { createValidationSchema } from './utils';
import { useStacksNetwork } from '@hooks/use-stacks-network';

import { useGenerateStackingSignature } from '../../../hooks/use-generate-signature';
import { GenerateSignatureLayout } from './components/generate-signature-layout';
import { GenerateSignatureFields, MAX_U128 } from './types';
import { createValidationSchema } from './utils';

const initialFormValues: GenerateSignatureFields = {
topic: Pox4SignatureTopic.StackStx,
period: 1,
Expand Down
6 changes: 4 additions & 2 deletions src/pages/stacking/generate-signature/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { createBtcAddressSchema } from '@utils/validators/btc-address-validator';
import * as yup from 'yup';
import { MAX_U128 } from './types';

import { validateDecimalPrecision } from '@utils/form/validate-decimals';
import { createBtcAddressSchema } from '@utils/validators/btc-address-validator';

import { MAX_U128 } from './types';

export function createValidationSchema({ network }: { network: string }) {
return yup.object().shape({
Expand Down

0 comments on commit 8441f35

Please sign in to comment.