Skip to content

Commit f2f5122

Browse files
committed
refactor: added constants instead of values as per PR review
1 parent cbc3418 commit f2f5122

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/inbox/components/IterableInbox.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ const RNIterableAPI = NativeModules.RNIterableAPI;
3636
const RNEventEmitter = new NativeEventEmitter(RNIterableAPI);
3737

3838
const DEFAULT_HEADLINE_HEIGHT = 60;
39+
const ANDROID_HEADLINE_HEIGHT = 70;
40+
const HEADLINE_PADDING_LEFT_PORTRAIT = 30;
41+
const HEADLINE_PADDING_LEFT_LANDSCAPE = 70;
3942

4043
// TODO: Comment
4144
export interface IterableInboxProps
@@ -97,10 +100,15 @@ export const IterableInbox = ({
97100
backgroundColor: ITERABLE_INBOX_COLORS.CONTAINER_BACKGROUND,
98101
fontSize: 40,
99102
fontWeight: 'bold',
100-
height: Platform.OS === 'android' ? 70 : DEFAULT_HEADLINE_HEIGHT,
103+
height:
104+
Platform.OS === 'android'
105+
? ANDROID_HEADLINE_HEIGHT
106+
: DEFAULT_HEADLINE_HEIGHT,
101107
marginTop: 0,
102108
paddingBottom: 10,
103-
paddingLeft: isPortrait ? 30 : 70,
109+
paddingLeft: isPortrait
110+
? HEADLINE_PADDING_LEFT_PORTRAIT
111+
: HEADLINE_PADDING_LEFT_LANDSCAPE,
104112
paddingTop: 10,
105113
width: '100%',
106114
},
@@ -118,9 +126,10 @@ export const IterableInbox = ({
118126
},
119127
});
120128

121-
const { headline } = styles;
122129
const navTitleHeight =
123-
DEFAULT_HEADLINE_HEIGHT + headline.paddingTop + headline.paddingBottom;
130+
DEFAULT_HEADLINE_HEIGHT +
131+
styles.headline.paddingTop +
132+
styles.headline.paddingBottom;
124133

125134
//fetches inbox messages and adds listener for inbox changes on mount
126135
useEffect(() => {

0 commit comments

Comments
 (0)