Skip to content

Commit

Permalink
feat(frontend): add sol to modal stores (#4126)
Browse files Browse the repository at this point in the history
# Motivation

Prepare transaction modal for SOL by adding it to the modal store.

# Changes

Add SOL transaction modal to store
  • Loading branch information
loki344 authored Jan 8, 2025
1 parent e2c7a73 commit c360dc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/frontend/src/lib/derived/modal.derived.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export const modalBtcTransaction: Readable<boolean> = derived(
modalStore,
($modalStore) => $modalStore?.type === 'btc-transaction'
);
export const modalSolTransaction: Readable<boolean> = derived(
modalStore,
($modalStore) => $modalStore?.type === 'sol-transaction'
);
export const modalEthToken: Readable<boolean> = derived(
modalStore,
($modalStore) => $modalStore?.type === 'eth-token'
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/src/lib/stores/modal.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ export interface Modal<T> {
| 'wallet-connect-send'
| 'eth-transaction'
| 'ic-transaction'
| 'btc-transaction'
| 'sol-transaction'
| 'manage-tokens'
| 'hide-token'
| 'ic-hide-token'
| 'eth-token'
| 'ic-token'
| 'receive-bitcoin'
| 'about-why-oisy'
| 'btc-transaction'
| 'dapp-details'
| 'successful-reward'
| 'failed-reward';
Expand Down Expand Up @@ -62,6 +63,7 @@ export interface ModalStore<T> extends Readable<ModalData<T>> {
openEthTransaction: <D extends T>(data: D) => void;
openIcTransaction: <D extends T>(data: D) => void;
openBtcTransaction: <D extends T>(data: D) => void;
openSolTransaction: <D extends T>(data: D) => void;
openManageTokens: () => void;
openHideToken: () => void;
openIcHideToken: () => void;
Expand Down Expand Up @@ -109,6 +111,7 @@ const initModalStore = <T>(): ModalStore<T> => {
openEthTransaction: setTypeWithData('eth-transaction'),
openIcTransaction: setTypeWithData('ic-transaction'),
openBtcTransaction: setTypeWithData('btc-transaction'),
openSolTransaction: setTypeWithData('sol-transaction'),
openManageTokens: setType('manage-tokens'),
openHideToken: setType('hide-token'),
openIcHideToken: setType('ic-hide-token'),
Expand Down

0 comments on commit c360dc2

Please sign in to comment.