Skip to content

Commit

Permalink
remove selectedOrdinal for raresat screen
Browse files Browse the repository at this point in the history
  • Loading branch information
terencehh committed Feb 6, 2024
1 parent 16df580 commit 0210fc6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 35 deletions.
10 changes: 4 additions & 6 deletions src/app/screens/rareSatsBundle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function RareSatsBundle() {
const location = useLocation();
const { source } = location.state || {};
const { network, selectedAccount, ordinalsAddress } = useWalletSelector();
const { selectedSatBundle: bundle, selectedOrdinal } = useNftDataSelector();
const { selectedSatBundle: bundle } = useNftDataSelector();
const { isPending, pendingTxHash } = usePendingOrdinalTxs(bundle?.txid);
const [showSendOrdinalsAlert, setShowSendOrdinalsAlert] = useState<boolean>(false);
const { setSelectedSatBundleDetails } = useSatBundleDataReducer();
Expand Down Expand Up @@ -221,10 +221,6 @@ function RareSatsBundle() {

const isEmpty = !bundle?.satRanges?.length;

const goBackText = selectedOrdinal?.id
? t('SEND.MOVE_TO_ASSET_DETAIL')
: t('NFT_DETAIL_SCREEN.MOVE_TO_ASSET_DETAIL');

return (
<>
{isGalleryOpen ? (
Expand All @@ -239,7 +235,9 @@ function RareSatsBundle() {
<Button onClick={handleBackButtonClick}>
<>
<ButtonImage src={ArrowLeft} />
<AssetDetailButtonText>{goBackText}</AssetDetailButtonText>
<AssetDetailButtonText>
{t('NFT_DETAIL_SCREEN.MOVE_TO_ASSET_DETAIL')}
</AssetDetailButtonText>
</>
</Button>
</BackButtonContainer>
Expand Down
10 changes: 0 additions & 10 deletions src/app/stores/nftData/actions/actionCreator.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { Inscription } from '@secretkeylabs/xverse-core';
import * as actions from './types';

export function setSelectedOrdinalAction(
selectedOrdinal: Inscription | null,
): actions.SetSelectedOrdinal {
return {
type: actions.SetSelectedOrdinalKey,
selectedOrdinal,
};
}

export function setSelectedSatBundleAction(
selectedSatBundle: actions.NftDataState['selectedSatBundle'],
): actions.SetSelectedSatBundle {
Expand Down
14 changes: 2 additions & 12 deletions src/app/stores/nftData/actions/types.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import { Bundle, Inscription } from '@secretkeylabs/xverse-core';
import { Bundle } from '@secretkeylabs/xverse-core';

export interface NftDataState {
selectedOrdinal: Inscription | null;
selectedSatBundle: Bundle | null;
selectedSatBundleItemIndex: number | null;
}

export const SetSelectedOrdinalKey = 'SetSelectedOrdinal';
export const SetSelectedSatBundleKey = 'SetSelectedSatBundle';
export const SetSelectedSatBundleItemIndexKey = 'SetSelectedSatBundleItemIndex';

export interface SetSelectedOrdinal {
type: typeof SetSelectedOrdinalKey;
selectedOrdinal: Inscription | null;
}

export interface SetSelectedSatBundle {
type: typeof SetSelectedSatBundleKey;
selectedSatBundle: NftDataState['selectedSatBundle'];
Expand All @@ -24,7 +17,4 @@ export interface SetSelectedSatBundleItemIndex {
selectedSatBundleItemIndex: NftDataState['selectedSatBundleItemIndex'];
}

export type NftDataAction =
| SetSelectedOrdinal
| SetSelectedSatBundle
| SetSelectedSatBundleItemIndex;
export type NftDataAction = SetSelectedSatBundle | SetSelectedSatBundleItemIndex;
7 changes: 0 additions & 7 deletions src/app/stores/nftData/reducer.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {
NftDataAction,
NftDataState,
SetSelectedOrdinalKey,
SetSelectedSatBundleItemIndexKey,
SetSelectedSatBundleKey,
} from './actions/types';

const initialNftDataState: NftDataState = {
selectedOrdinal: null,
selectedSatBundle: null,
selectedSatBundleItemIndex: null,
};
Expand All @@ -18,11 +16,6 @@ const NftDataStateReducer = (
action: NftDataAction,
): NftDataState => {
switch (action.type) {
case SetSelectedOrdinalKey:
return {
...state,
selectedOrdinal: action.selectedOrdinal,
};
case SetSelectedSatBundleKey:
return {
...state,
Expand Down

0 comments on commit 0210fc6

Please sign in to comment.