Skip to content

Commit

Permalink
move defaultInsets outside
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt committed Sep 20, 2024
1 parent 170fb4e commit 94b36f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/SafeAreaConsumer/index.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import useStyleUtils from '@hooks/useStyleUtils';
import StatusBar from '@libs/StatusBar';
import type SafeAreaConsumerProps from './types';

const defaultInsets = {top: 0, bottom: 0, left: 0, right: 0};

/**
* This component is a light wrapper around the SafeAreaInsetsContext.Consumer. There are several places where we
* may need not just the insets, but the computed styles so we save a few lines of code with this.
Expand All @@ -15,7 +17,6 @@ function SafeAreaConsumer({children}: SafeAreaConsumerProps) {
return (
<SafeAreaInsetsContext.Consumer>
{(insets) => {
const defaultInsets = {top: 0, bottom: 0, left: 0, right: 0};
const safeInsets = insets ?? defaultInsets;

const androidInsets = {
Expand Down

0 comments on commit 94b36f0

Please sign in to comment.