Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
808 changes: 691 additions & 117 deletions example/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
},
"dependencies": {
"@xmartlabs/react-native-line": "file:../",
"expo": "^55.0.13",
"expo": "^55.0.15",
"expo-blur": "~55.0.9",
"expo-build-properties": "~55.0.9",
"expo-constants": "~55.0.7",
"expo-font": "~55.0.4",
"expo-haptics": "~55.0.8",
"expo-linking": "~55.0.7",
"expo-router": "~55.0.5",
"expo-splash-screen": "~55.0.10",
"expo-linking": "~55.0.13",
"expo-router": "~55.0.12",
"expo-splash-screen": "~55.0.18",
"expo-status-bar": "~55.0.4",
"expo-symbols": "~55.0.5",
"expo-system-ui": "~55.0.9",
Expand Down
16 changes: 12 additions & 4 deletions example/src/common/localStorage.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
import { createMMKV, useMMKVString } from 'react-native-mmkv'

import { isWebPlatform } from './platform'
import { isWebPlatform } from '@/constants/platform'

// ⚠️ WARNING: Never use a hardcoded encryption key in production.
const storage = isWebPlatform
? createMMKV({ id: 'default' })
: createMMKV({ encryptionKey: 'your-encryption-key', id: 'default' })

export function getLocalStorageItem(key: string) {
/* *************************** */
/* * Helper Functions * */
/* *************************** */

export function getLocalStorageItem(key: string): string | undefined {
return storage.getString(key)
}

export function setLocalStorageItem(key: string, value: string) {
export function setLocalStorageItem(key: string, value: string): void {
return storage.set(key, value)
}

export function removeLocalStorageItem(key: string) {
export function removeLocalStorageItem(key: string): boolean {
return storage.remove(key)
}

/* *************************** */
/* * Hooks * */
/* *************************** */

export const useSession = () => useMMKVString('accessToken', storage)
3 changes: 0 additions & 3 deletions example/src/common/platform.ts

This file was deleted.

7 changes: 7 additions & 0 deletions example/src/constants/platform.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Platform } from 'react-native'

export const isAndroidPlatform = Platform.OS === 'android'

export const isiOSPlatform = Platform.OS === 'ios'

export const isWebPlatform = Platform.OS === 'web'
2 changes: 1 addition & 1 deletion example/src/hooks/useReactNativeLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Line from '@xmartlabs/react-native-line'
import { useLayoutEffect, useState } from 'react'
import { Alert } from 'react-native'

import { isWebPlatform } from '@/common/platform'
import { isWebPlatform } from '@/constants/platform'

export const useReactNativeLine = () => {
const [ready, setReady] = useState<boolean>(false)
Expand Down
Loading
Loading