Skip to content

Commit

Permalink
refactor: Replace SheetBottom with BottomSheet in AccountConnect (#8440)
Browse files Browse the repository at this point in the history
## **Description**
Replace SheetBottom with BottomSheet in AccountConnect

## **Related issues**

Fixes: #8423

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [ ] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [x] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [ ] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
brianacnguyen authored Jan 30, 2024
1 parent 58ec3ee commit d8b8d38
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions app/components/Views/AccountConnect/AccountConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import React, {
import { useSelector } from 'react-redux';
import { isEqual } from 'lodash';
import { useNavigation } from '@react-navigation/native';

// External dependencies.
import SheetBottom, {
SheetBottomRef,
} from '../../../component-library/components/Sheet/SheetBottom';
import BottomSheet, {
BottomSheetRef,
} from '../../../component-library/components/BottomSheets/BottomSheet';
import UntypedEngine from '../../../core/Engine';
import { isDefaultAccountName } from '../../../util/ENSUtils';
import Logger from '../../../util/Logger';
Expand Down Expand Up @@ -63,7 +64,7 @@ const AccountConnect = (props: AccountConnectProps) => {
const [selectedAddresses, setSelectedAddresses] = useState<string[]>([
selectedWalletAddress,
]);
const sheetRef = useRef<SheetBottomRef>(null);
const sheetRef = useRef<BottomSheetRef>(null);
const [screen, setScreen] = useState<AccountConnectScreens>(
AccountConnectScreens.SingleConnect,
);
Expand Down Expand Up @@ -217,7 +218,7 @@ const AccountConnect = (props: AccountConnectProps) => {
);

const hideSheet = (callback?: () => void) =>
sheetRef?.current?.hide?.(callback);
sheetRef?.current?.onCloseBottomSheet?.(callback);

/**
* User intent is set on AccountConnectSingle,
Expand Down Expand Up @@ -398,13 +399,9 @@ const AccountConnect = (props: AccountConnectProps) => {
]);

return (
<SheetBottom
onDismissed={handleSheetDismiss}
reservedMinOverlayHeight={0}
ref={sheetRef}
>
<BottomSheet onClose={handleSheetDismiss} isFullscreen ref={sheetRef}>
{renderConnectScreens()}
</SheetBottom>
</BottomSheet>
);
};

Expand Down

0 comments on commit d8b8d38

Please sign in to comment.