-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #268 from yours-org/feat/refresh-spends
Feat/refresh spends
- Loading branch information
Showing
25 changed files
with
227 additions
and
162 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { createContext } from 'react'; | ||
|
||
type QueueContextType = { | ||
percentCompleted: number; | ||
showSyncPage: boolean; | ||
}; | ||
|
||
export const BlockHeightContext = createContext<QueueContextType | null>(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { createContext } from 'react'; | ||
|
||
export type MenuItems = 'bsv' | 'ords' | 'tools' | 'settings'; | ||
|
||
type BottomMenuContextType = { | ||
selected: MenuItems | null; | ||
query: string; | ||
handleSelect: (item: MenuItems, query?: string) => void; | ||
showMenu: () => void; | ||
hideMenu: () => void; | ||
isVisible: boolean; | ||
}; | ||
|
||
export const BottomMenuContext = createContext<BottomMenuContextType | null>(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { createContext } from 'react'; | ||
import { Theme } from '../theme.types'; | ||
|
||
export interface ThemeContextProps { | ||
theme: Theme; | ||
} | ||
|
||
export const ThemeContext = createContext<ThemeContextProps | undefined>(undefined); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { createContext } from 'react'; | ||
import { Theme } from '../theme.types'; | ||
|
||
type QueueContextType = { | ||
queueLength: number; | ||
showQueueBanner: boolean; | ||
updateBalance: boolean; | ||
theme: Theme; | ||
isSyncing: boolean; | ||
}; | ||
|
||
export const QueueContext = createContext<QueueContextType | null>(null); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { createContext } from 'react'; | ||
import { ChromeStorageService } from '../services/ChromeStorage.service'; | ||
import { WhatsOnChainService } from '../services/WhatsOnChain.service'; | ||
import { KeysService } from '../services/Keys.service'; | ||
import { ContractService } from '../services/Contract.service'; | ||
import { BsvService } from '../services/Bsv.service'; | ||
import { OrdinalService } from '../services/Ordinal.service'; | ||
import { SPVStore } from 'spv-store'; | ||
import { GorillaPoolService } from '../services/GorillaPool.service'; | ||
|
||
export interface ServiceContextProps { | ||
chromeStorageService: ChromeStorageService; | ||
keysService: KeysService; | ||
bsvService: BsvService; | ||
ordinalService: OrdinalService; | ||
wocService: WhatsOnChainService; | ||
gorillaPoolService: GorillaPoolService; | ||
contractService: ContractService; | ||
isLocked: boolean; | ||
isReady: boolean; | ||
setIsLocked: (isLocked: boolean) => void; | ||
lockWallet: () => Promise<void>; | ||
oneSatSPV: SPVStore; | ||
} | ||
|
||
export const ServiceContext = createContext<ServiceContextProps | undefined>(undefined); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createContext } from 'react'; | ||
|
||
export type SnackbarType = 'error' | 'info' | 'success'; | ||
|
||
type SnackbarContextType = { | ||
message: string | null; | ||
snackBarType: SnackbarType | null; | ||
addSnackbar: (message: string, type: SnackbarType, duration?: number) => void; | ||
}; | ||
|
||
export const SnackbarContext = createContext<SnackbarContextType | null>(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { createContext } from 'react'; | ||
import { | ||
Broadcast, | ||
DecryptRequest, | ||
EncryptRequest, | ||
GetSignatures, | ||
PurchaseOrdinal, | ||
SendBsv, | ||
SendBsv20, | ||
SignMessage, | ||
TaggedDerivationRequest, | ||
TransferOrdinal, | ||
} from 'yours-wallet-provider'; | ||
import { RequestParams } from '../inject'; | ||
import { ChromeStorageService } from '../services/ChromeStorage.service'; | ||
|
||
export type Web3RequestContextProps = { | ||
connectRequest: RequestParams | undefined; | ||
sendBsvRequest: SendBsv[] | undefined; | ||
sendBsv20Request: SendBsv20 | undefined; | ||
transferOrdinalRequest: TransferOrdinal | undefined; | ||
purchaseOrdinalRequest: PurchaseOrdinal | undefined; | ||
signMessageRequest: SignMessage | undefined; | ||
broadcastRequest: Broadcast | undefined; | ||
getSignaturesRequest: GetSignatures | undefined; | ||
generateTaggedKeysRequest: TaggedDerivationRequest | undefined; | ||
encryptRequest: EncryptRequest | undefined; | ||
decryptRequest: DecryptRequest | undefined; | ||
popupId: number | undefined; | ||
getStorageAndSetRequestState: (chromeStorageService: ChromeStorageService) => void; | ||
clearRequest: (type: keyof Omit<Web3RequestContextProps, 'clearRequest'>) => void; | ||
}; | ||
|
||
export const Web3RequestContext = createContext<Web3RequestContextProps | undefined>(undefined); |
12 changes: 3 additions & 9 deletions
12
src/contexts/BlockHeightContext.tsx → ...ontexts/providers/BlockHeightProvider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 4 additions & 16 deletions
20
src/contexts/BottomMenuContext.tsx → ...contexts/providers/BottomMenuProvider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ReactNode } from 'react'; | ||
import { useQueueTracker } from '../../hooks/useQueueTracker'; | ||
import { QueueContext } from '../QueueContext'; | ||
|
||
export const QueueProvider = ({ children }: { children: ReactNode }) => { | ||
const { queueLength, showQueueBanner, theme, updateBalance, isSyncing } = useQueueTracker(); | ||
|
||
return ( | ||
<QueueContext.Provider value={{ queueLength, showQueueBanner, theme, updateBalance, isSyncing }}> | ||
{children} | ||
</QueueContext.Provider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 5 additions & 14 deletions
19
src/contexts/SnackbarContext.tsx → src/contexts/providers/SnackbarProvider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ReactNode } from 'react'; | ||
import { ThemeContext } from '../ColorThemeContext'; | ||
import { theme } from '../../theme'; | ||
|
||
interface ThemeProviderProps { | ||
children: ReactNode; | ||
} | ||
|
||
export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => { | ||
return <ThemeContext.Provider value={{ theme }}>{children}</ThemeContext.Provider>; | ||
}; |
Oops, something went wrong.