about summary refs log tree commit diff
path: root/src/view/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/lib')
-rw-r--r--src/view/lib/strings.ts9
-rw-r--r--src/view/lib/styles.ts37
2 files changed, 46 insertions, 0 deletions
diff --git a/src/view/lib/strings.ts b/src/view/lib/strings.ts
new file mode 100644
index 000000000..1be1112b1
--- /dev/null
+++ b/src/view/lib/strings.ts
@@ -0,0 +1,9 @@
+export function pluralize(n: number, base: string, plural?: string): string {
+  if (n === 1) {
+    return base
+  }
+  if (plural) {
+    return plural
+  }
+  return base + 's'
+}
diff --git a/src/view/lib/styles.ts b/src/view/lib/styles.ts
new file mode 100644
index 000000000..44ee2dba7
--- /dev/null
+++ b/src/view/lib/styles.ts
@@ -0,0 +1,37 @@
+import {StyleSheet} from 'react-native'
+
+export const s = StyleSheet.create({
+  // font weights
+  fw600: {fontWeight: '600'},
+  bold: {fontWeight: '600'},
+  fw500: {fontWeight: '500'},
+  semiBold: {fontWeight: '500'},
+  fw400: {fontWeight: '400'},
+  normal: {fontWeight: '400'},
+  fw300: {fontWeight: '300'},
+  light: {fontWeight: '300'},
+  fw200: {fontWeight: '200'},
+
+  // font sizes
+  f13: {fontSize: 13},
+  f14: {fontSize: 14},
+  f15: {fontSize: 15},
+  f16: {fontSize: 16},
+  f18: {fontSize: 18},
+
+  // line heights
+  ['lh13-1']: {lineHeight: 13},
+  ['lh13-1.3']: {lineHeight: 16.9}, // 1.3 of 13px
+  ['lh14-1']: {lineHeight: 14},
+  ['lh14-1.3']: {lineHeight: 18.2}, // 1.3 of 14px
+  ['lh15-1']: {lineHeight: 15},
+  ['lh15-1.3']: {lineHeight: 19.5}, // 1.3 of 15px
+  ['lh16-1']: {lineHeight: 16},
+  ['lh16-1.3']: {lineHeight: 20.8}, // 1.3 of 16px
+  ['lh18-1']: {lineHeight: 18},
+  ['lh18-1.3']: {lineHeight: 23.4}, // 1.3 of 18px
+
+  // colors
+  black: {color: 'black'},
+  gray: {color: 'gray'},
+})