Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace MakerX's Use-Wallet fork with TxnLab's ENG-350 #167

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/xgov-dapp/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { withThemeFromJSXProvider } from '@storybook/addon-themes'
import { lightTheme, darkTheme } from '../src/themes'
import type { Preview } from '@storybook/react'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { WalletProvider} from '@makerx/use-wallet'
import { WalletProvider} from '@txnlab/use-wallet'
import { LocalizationProvider } from '@mui/x-date-pickers'
import { useAlgoWallet } from '../src/utils/useAlgoWalletProvider'
import { RecoilRoot } from 'recoil'
Expand Down
84 changes: 48 additions & 36 deletions src/xgov-dapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/xgov-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@headlessui/react": "^1.7.13",
"@heroicons/react": "^2.0.16",
"@makerx/forms-mui": "^1.1.0",
"@makerx/use-wallet": "^3.0.0",
"@txnlab/use-wallet": "^2.8.2",
"@mui/icons-material": "^5.11.11",
"@mui/material": "^5.11.13",
"@mui/x-date-pickers": "^6.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/components/siteHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Disclosure, Popover } from '@headlessui/react'
import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import { Typography } from '@mui/material'
import clsx from 'clsx'
import { Link } from 'react-router-dom'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/rounds/VotingRoundTile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import { Box, Button, Skeleton, Typography } from '@mui/material'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/rounds/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import LaunchIcon from '@mui/icons-material/Launch'
import { Alert, Box, Button, Skeleton, Typography, Link as MuiLink } from '@mui/material'
import sortBy from 'lodash.sortby'
Expand Down Expand Up @@ -69,7 +69,7 @@
<div className="container">
<div className="flex flex-col items-end">
<Box className="bg-white flex rounded-xl px-4 py-2 items-center">
<MuiLink className="no-underline hover:underline" href="https://forum.algorand.org/t/xgov-guide-post-alpha-pilot/12153" target="_blank">

Check warning on line 72 in src/xgov-dapp/src/features/rounds/index.tsx

View workflow job for this annotation

GitHub Actions / xGov Dapp / node-ci

Replace `·className="no-underline·hover:underline"·href="https://forum.algorand.org/t/xgov-guide-post-alpha-pilot/12153"·target="_blank"` with `⏎············className="no-underline·hover:underline"⏎············href="https://forum.algorand.org/t/xgov-guide-post-alpha-pilot/12153"⏎············target="_blank"⏎··········`
xGov Guide
<LaunchIcon className="ml-2 text-grey-light align-bottom" />
</MuiLink>
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/status/VotingSessionsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import { Alert, Button, Skeleton, Typography } from '@mui/material'
import clsx from 'clsx'
import dayjs from 'dayjs'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Link } from 'react-router-dom'
import { VotingRoundGlobalState } from '../../../../dapp/src/shared/VotingRoundContract'

import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import { useEffect, useState } from 'react'
import { fetchVotingRoundGlobalStatesByCreators } from '../../../../dapp/src/shared/VotingRoundContract'
import { GovenorTermPoolData, TermPool, fetchGovenorData, fetchTermPools } from '../../shared/xGovApi'
Expand Down Expand Up @@ -145,7 +145,7 @@
</div>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
<Box className="bg-white flex rounded-xl px-4 py-2 items-center">
<MuiLink className="no-underline hover:underline" href="https://forum.algorand.org/t/xgov-guide-post-alpha-pilot/12153" target="_blank">

Check warning on line 148 in src/xgov-dapp/src/features/status/index.tsx

View workflow job for this annotation

GitHub Actions / xGov Dapp / node-ci

Replace `·className="no-underline·hover:underline"·href="https://forum.algorand.org/t/xgov-guide-post-alpha-pilot/12153"·target="_blank"` with `⏎··············className="no-underline·hover:underline"⏎··············href="https://forum.algorand.org/t/xgov-guide-post-alpha-pilot/12153"⏎··············target="_blank"⏎············`
xGov Guide
<LaunchIcon className="ml-2 text-grey-light align-bottom" />
</MuiLink>
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/vote-creation/review/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '../state'
import { ConfirmationDialog } from './ConfirmationDialog'

import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import Papa from 'papaparse'
import { VotingRoundGlobalState } from '../../../../../dapp/src/shared/VotingRoundContract'
import { VoteType } from '../../../../../dapp/src/shared/types'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/vote/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HandThumbUpIcon } from '@heroicons/react/24/solid'
import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward'
import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward'
import CancelIcon from '@mui/icons-material/Cancel'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/wallet/ConnectWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CheckCircleIcon } from '@heroicons/react/24/outline'
import { PROVIDER_ID, useWallet } from '@makerx/use-wallet'
import { PROVIDER_ID, useWallet } from '@txnlab/use-wallet'
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography } from '@mui/material'
import { useEffect, useMemo, useState } from 'react'
import api from '../../shared/api'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/wallet/ManualWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ValidatedForm, zfd } from '@makerx/forms-mui'
import { custom } from '@makerx/use-wallet'
import { custom } from '@txnlab/use-wallet'
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography } from '@mui/material'
import { useRef } from 'react'
import { UseFormReturn } from 'react-hook-form'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/features/wallet/manualSigningProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Buffer } from 'buffer'
import { CustomProvider, Metadata, PROVIDER_ID } from '@makerx/use-wallet'
import { CustomProvider, Metadata, PROVIDER_ID } from '@txnlab/use-wallet'
import type _algosdk from 'algosdk'
import { atom, DefaultValue, selector, SetterOrUpdater, useRecoilValue, useSetRecoilState } from 'recoil'

Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/hooks/use-voter-votes-query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import { useQuery, UseQueryOptions } from '@tanstack/react-query'
import { UseXGovQueryOptions } from './index'
import { fetchVoterVotes } from '../../../dapp/src/shared/VotingRoundContract'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/hooks/use-x-gov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { QueryObserverResult, RefetchOptions, RefetchQueryFilters, UseQueryResul
import type { TallyCounts, VotingRoundGlobalState } from '../../../dapp/src/shared/VotingRoundContract'
import type { VoteGatingSnapshot, VotingRoundMetadata } from '../../../dapp/src/shared/IPFSGateway'
import api from '../shared/api'
import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import { getHasVoteEnded, getHasVoteStarted } from '../shared/vote'
import useGlobalStateQuery from './use-global-state-query'
import useMetadataQuery from './use-metadata-query'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WalletProvider, custom } from '@makerx/use-wallet'
import { WalletProvider, custom } from '@txnlab/use-wallet'
import { LocalizationProvider } from '@mui/x-date-pickers'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { PropsWithChildren } from 'react'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/stories/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SiteHeader from '../components/siteHeader'
import ConnectWallet from '../features/wallet/ConnectWallet'
import ManualWallet from '../features/wallet/ManualWallet'
import { custom } from '@makerx/use-wallet'
import { custom } from '@txnlab/use-wallet'
import SiteFooter from '../components/siteFooter'
import ScrollToTop from '../shared/router/ScrollToTop'
import { PropsWithChildren } from 'react'
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/stories/withRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentType, useEffect } from 'react'
import { MemoryRouter, Route, Routes } from 'react-router-dom'
import { useWallet } from '@makerx/use-wallet'
import { useWallet } from '@txnlab/use-wallet'
import Root from './Root'

export type WithRouterOptions = {
Expand Down
2 changes: 1 addition & 1 deletion src/xgov-dapp/src/utils/useAlgoWalletProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
PROVIDER_ID,
ProvidersArray,
useInitializeProviders,
} from '@makerx/use-wallet'
} from '@txnlab/use-wallet'
import { PeraWalletConnect } from '@perawallet/connect'
import { WalletConnectModalSign } from '@walletconnect/modal-sign-html'
import type _algosdk from 'algosdk'
Expand Down
Loading