Skip to content

Commit

Permalink
style: misc removal of FIXMEs and type improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
finnmerlett committed Jan 16, 2025
1 parent c5b0415 commit f0ab138
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/hooks/use-push-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ async function getToken() {
let token = ''

try {
// FIXME: check push notifications work
const notification = await Notifications.getExpoPushTokenAsync({
projectId: Constants.expoConfig.extra.eas.projectId,
})
Expand Down
2 changes: 1 addition & 1 deletion src/lib/importExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import CryptoJS from 'react-native-crypto-js'

import { Secret } from '../types'

// FIXME: do we want to switch to the beta expo-file-system?
// TODO: do we want to switch to the new beta expo-file-system?

const mimeType = 'application/octet-stream'

Expand Down
19 changes: 17 additions & 2 deletions src/lib/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { TextStyle } from 'react-native'
import { MD2LightTheme as PaperDefaultTheme } from 'react-native-paper'
import { DefaultTheme as NavigationDefaultTheme } from '@react-navigation/native'
import {
DefaultTheme as NavigationDefaultTheme,
type Theme as NativeTheme,
} from '@react-navigation/native'
import type { ThemeProp } from 'react-native-paper/lib/typescript/types'

export type TypographyVariant =
| 'h1'
Expand Down Expand Up @@ -94,6 +98,17 @@ const typography: Record<TypographyVariant, TextStyle> = {
},
}

interface CustomTheme {
colors: {
textSecondary: string
}
typography: Record<TypographyVariant, TextStyle>
spacing: (mul: number) => number
alpha: (color: string, op: number) => string
}

export type AppTheme = ThemeProp & NativeTheme & CustomTheme

const theme = {
...PaperDefaultTheme,
...NavigationDefaultTheme,
Expand All @@ -109,6 +124,6 @@ const theme = {
spacing: (mul: number) => mul * 8,
alpha: (color: string, op: number) =>
`${color}${Math.round(0xff * op).toString(16)}`,
}
} as const satisfies AppTheme

export default theme
10 changes: 4 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-native",
"lib": [
"es2017"
],
"lib": ["es2017"],
"moduleResolution": "node",
"noEmit": true,
"strict": false, // FIXME: set to true and fix all ts errors 😢
"strict": false, // TODO: set to true and fix all ts errors 😢
"target": "esnext",
"resolveJsonModule": true,
"skipLibCheck": true,
"skipLibCheck": true
},
"exclude": [
"node_modules",
Expand All @@ -22,5 +20,5 @@
"jest.config.js"
],
"extends": "expo/tsconfig.base",
"typeRoots": ["node_modules/@types", "src/types"],
"typeRoots": ["node_modules/@types", "src/types"]
}

0 comments on commit f0ab138

Please sign in to comment.