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

refactor: Replace SheetBottom with BottomSheet in AccountsPermission #8441

Merged
merged 3 commits into from
Jan 30, 2024
Merged
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
15 changes: 8 additions & 7 deletions app/components/Views/AccountPermissions/AccountPermissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ 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 {
addPermittedAccounts,
Expand Down Expand Up @@ -95,7 +95,7 @@ const AccountPermissions = (props: AccountPermissionsProps) => {
hostname,
);
const [selectedAddresses, setSelectedAddresses] = useState<string[]>([]);
const sheetRef = useRef<SheetBottomRef>(null);
const sheetRef = useRef<BottomSheetRef>(null);
const [permissionsScreen, setPermissionsScreen] =
useState<AccountPermissionsScreens>(AccountPermissionsScreens.Connected);
const { accounts, ensByAccountAddress } = useAccounts({
Expand All @@ -109,7 +109,8 @@ const AccountPermissions = (props: AccountPermissionsProps) => {
const [userIntent, setUserIntent] = useState(USER_INTENT.None);

const hideSheet = useCallback(
(callback?: () => void) => sheetRef?.current?.hide?.(callback),
(callback?: () => void) =>
sheetRef?.current?.onCloseBottomSheet?.(callback),
[sheetRef],
);
const metricsSource = 'Browser Tab/Permission UI';
Expand Down Expand Up @@ -411,9 +412,9 @@ const AccountPermissions = (props: AccountPermissionsProps) => {
]);

return (
<SheetBottom reservedMinOverlayHeight={0} ref={sheetRef}>
<BottomSheet isFullscreen ref={sheetRef}>
{renderPermissionsScreens()}
</SheetBottom>
</BottomSheet>
);
};

Expand Down
Loading