Skip to content
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
17 changes: 5 additions & 12 deletions app/components/UI/Perps/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ import { CONFIRMATION_HEADER_CONFIG } from '../constants/perpsConfig';
const Stack = createStackNavigator<PerpsNavigationParamList>();
const ModalStack = createStackNavigator();

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ScreenComponent = React.ComponentType<any>;

const styles = StyleSheet.create({
container: {
flex: 1,
Expand All @@ -65,18 +62,14 @@ function getRedesignedConfirmationsHeaderOptions({
: { header: () => null };
}

const PerpsConfirmScreen = (
props: React.ComponentProps<typeof Confirm> & {
route: RouteProp<PerpsNavigationParamList, 'RedesignedConfirmations'>;
},
) => {
const params =
const PerpsConfirmScreen = () => {
const { params } =
useRoute<RouteProp<PerpsNavigationParamList, 'RedesignedConfirmations'>>();
const showPerpsHeader =
params?.params?.showPerpsHeader ??
params?.showPerpsHeader ??
CONFIRMATION_HEADER_CONFIG.DefaultShowPerpsHeader;

return <Confirm {...props} disableSafeArea={!showPerpsHeader} />;
return <Confirm disableSafeArea={!showPerpsHeader} />;
};

const PerpsModalStack = () => {
Expand Down Expand Up @@ -421,7 +414,7 @@ const PerpsScreenStack = () => {

<Stack.Screen
name={Routes.FULL_SCREEN_CONFIRMATIONS.REDESIGNED_CONFIRMATIONS}
component={PerpsConfirmScreen as ScreenComponent}
component={PerpsConfirmScreen}
options={({ route }) =>
getRedesignedConfirmationsHeaderOptions(route.params)
}
Expand Down
Loading