-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
variables.ts
155 lines (151 loc) · 6.04 KB
/
variables.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import {PixelRatio} from 'react-native';
/**
* Calculate the fontSize, lineHeight and padding when the device font size is changed, In most cases users do not change their device font size so PixelRatio.getFontScale() = 1 and this
* method always returns the defaultValue (first param). When the device font size increases/decreases, the PixelRatio.getFontScale() value increases/decreases as well.
* This means that if you have text and its 'fontSize' is 19, the device font size changed to the 5th level on the iOS slider and the actual fontSize is 19 * PixelRatio.getFontScale()
* = 19 * 1.11 = 21.09. Since we are disallowing font scaling we need to calculate it manually. We calculate it with: PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue :
* defaultValue * PixelRatio getFontScale() This means that the fontSize is increased/decreased when the device font size changes up to maxValue (second param)
*/
function getValueUsingPixelRatio(defaultValue: number, maxValue: number): number {
return PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue : defaultValue * PixelRatio.getFontScale();
}
export default {
contentHeaderHeight: getValueUsingPixelRatio(65, 100),
componentSizeSmall: getValueUsingPixelRatio(28, 32),
componentSizeNormal: 40,
componentSizeMedium: 48,
inputComponentSizeNormal: 40,
componentSizeLarge: 52,
componentBorderRadius: 8,
componentBorderRadiusSmall: 4,
componentBorderRadiusMedium: 6,
componentBorderRadiusNormal: 8,
componentBorderRadiusLarge: 16,
componentBorderRadiusCard: 12,
componentBorderRadiusRounded: 24,
downloadAppModalAppIconSize: 48,
buttonBorderRadius: 100,
avatarSizeLargeBordered: 88,
avatarSizeLarge: 80,
avatarSizeMedium: 52,
avatarSizeHeader: 40,
avatarSizeNormal: 40,
avatarSizeSmallNormal: 32,
avatarSizeSmall: 28,
avatarSizeSmaller: 24,
avatarSizeSubscript: 20,
avatarSizeMidSubscript: 18,
avatarSizeMentionIcon: 16,
avatarSizeSmallSubscript: 14,
defaultAvatarPreviewSize: 360,
fontSizeOnlyEmojis: 30,
fontSizeOnlyEmojisHeight: 35,
fontSizeSmall: getValueUsingPixelRatio(11, 17),
fontSizeExtraSmall: 9,
fontSizeLabel: getValueUsingPixelRatio(13, 19),
fontSizeNormal: getValueUsingPixelRatio(15, 21),
fontSizeMedium: getValueUsingPixelRatio(16, 22),
fontSizeLarge: getValueUsingPixelRatio(17, 19),
fontSizeHero: 36,
fontSizeHeroXL: 72,
fontSizeh1: 19,
fontSizeXLarge: 22,
fontSizeXXLarge: 28,
fontSizeXXXLarge: 32,
fontSizeNormalHeight: getValueUsingPixelRatio(20, 28),
fontSizeSignInHeroLarge: 48,
fontSizeSignInHeroMedium: 38,
fontSizeSignInHeroXSmall: 26,
fontSizeSignInHeroSmall: 28,
fontSizeSignInHeroBody: 20,
lineHeightHero: 45,
iconSizeXXXSmall: 4,
iconSizeXXSmall: 8,
iconSizeExtraSmall: 12,
iconSizeSmall: 16,
iconSizeNormal: 20,
iconSizeLarge: 24,
iconSizeXLarge: 28,
iconSizeExtraLarge: 40,
iconSizeSuperLarge: 60,
emojiSize: 20,
emojiLineHeight: 28,
iouAmountTextSize: 40,
extraSmallMobileResponsiveWidthBreakpoint: 320,
extraSmallMobileResponsiveHeightBreakpoint: 550,
mobileResponsiveWidthBreakpoint: 800,
modalFullscreenBackdropOpacity: 0.5,
tabletResponsiveWidthBreakpoint: 1024,
safeInsertPercentage: 0.7,
sideBarWidth: 375,
pdfPageMaxWidth: 992,
tooltipzIndex: 10050,
gutterWidth: 12,
popoverMenuShadow: '0px 4px 12px 0px rgba(0, 0, 0, 0.06)',
optionRowHeight: 64,
optionRowHeightCompact: 52,
optionsListSectionHeaderHeight: getValueUsingPixelRatio(32, 38),
overlayOpacity: 0.6,
lineHeightSmall: getValueUsingPixelRatio(14, 16),
lineHeightNormal: getValueUsingPixelRatio(16, 21),
lineHeightLarge: getValueUsingPixelRatio(18, 24),
lineHeightXLarge: getValueUsingPixelRatio(20, 24),
lineHeightXXLarge: getValueUsingPixelRatio(27, 32),
lineHeightXXXLarge: getValueUsingPixelRatio(32, 37),
lineHeightSizeh1: getValueUsingPixelRatio(23, 28),
lineHeightSignInHeroXSmall: getValueUsingPixelRatio(32, 37),
inputHeight: getValueUsingPixelRatio(52, 72),
inputHeightSmall: 28,
formErrorLineHeight: getValueUsingPixelRatio(18, 23),
communicationsLinkHeight: getValueUsingPixelRatio(20, 30),
alternateTextHeight: getValueUsingPixelRatio(20, 24),
INACTIVE_LABEL_TRANSLATE_Y: getValueUsingPixelRatio(16, 21),
sliderBarHeight: 8,
sliderKnobSize: 26,
checkboxLabelActiveOpacity: 0.7,
checkboxLabelHoverOpacity: 1,
avatarChatSpacing: 12,
chatInputSpacing: 52, // 40 + avatarChatSpacing
borderTopWidth: 1,
modalTopIconWidth: 200,
modalTopIconHeight: 164,
modalTopBigIconHeight: 244,
modalWordmarkWidth: 154,
modalWordmarkHeight: 37,
verticalLogoHeight: 634,
verticalLogoWidth: 111,
badgeMaxWidth: 180,
signInHeroImageMobileHeight: 240.08,
signInHeroImageMobileWidth: 303,
signInHeroImageTabletHeight: 324.01,
signInHeroImageTabletWidth: 346,
signInHeroImageDesktopHeight: 362.4,
signInHeroImageDesktopWidth: 386.99,
signInHeroBackgroundWidth: 2000,
signInHeroBackgroundWidthMobile: 800,
signInContentMaxWidth: 1360,
signInHeroContextMaxWidth: 680,
signInContentMinHeight: 800,
signInLogoHeightSmallScreen: 28,
signInLogoHeight: 34,
signInLogoWidth: 120,
signInLogoWidthLargeScreen: 144,
signInLogoWidthPill: 132,
lhnLogoWidth: 108,
lhnLogoHeight: 28,
signInLogoWidthLargeScreenPill: 162,
modalContentMaxWidth: 360,
listItemHeightNormal: 64,
popoverWidth: 375,
addPaymentPopoverTopSpacing: 8,
addPaymentPopoverRightSpacing: 13,
anonymousReportFooterBreakpoint: 650,
dropDownButtonDividerHeight: 28,
// The height of the empty list is 14px (2px for borders and 12px for vertical padding)
// This is calculated based on the values specified in the 'getGoogleListViewStyle' function of the 'StyleUtils' utility
googleEmptyListViewHeight: 14,
hoverDimValue: 1,
pressDimValue: 0.8,
qrShareHorizontalPadding: 32,
baseMenuItemHeight: 64,
} as const;