Compare commits
3 Commits
group-agen
...
fix/code-h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d73896b24c | ||
|
|
1ab581358e | ||
|
|
9fca21a3f8 |
@@ -9,18 +9,18 @@
|
|||||||
"cojson-storage",
|
"cojson-storage",
|
||||||
"cojson-storage-indexeddb",
|
"cojson-storage-indexeddb",
|
||||||
"cojson-storage-sqlite",
|
"cojson-storage-sqlite",
|
||||||
|
"cojson-storage-rn-sqlite",
|
||||||
"cojson-transport-ws",
|
"cojson-transport-ws",
|
||||||
"jazz-browser",
|
"jazz-browser",
|
||||||
"jazz-auth-clerk",
|
"jazz-auth-clerk",
|
||||||
"jazz-browser-media-images",
|
"jazz-browser-media-images",
|
||||||
"jazz-expo",
|
|
||||||
"jazz-inspector",
|
"jazz-inspector",
|
||||||
"jazz-nodejs",
|
"jazz-nodejs",
|
||||||
"jazz-react",
|
"jazz-react",
|
||||||
"jazz-react-core",
|
"jazz-react-core",
|
||||||
"jazz-react-auth-clerk",
|
"jazz-react-auth-clerk",
|
||||||
"jazz-react-native-core",
|
|
||||||
"jazz-react-native",
|
"jazz-react-native",
|
||||||
|
"jazz-react-native-auth-clerk",
|
||||||
"jazz-react-native-media-images",
|
"jazz-react-native-media-images",
|
||||||
"jazz-run",
|
"jazz-run",
|
||||||
"jazz-svelte",
|
"jazz-svelte",
|
||||||
|
|||||||
5
.changeset/good-parrots-rhyme.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"multiauth": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Use the new Resolve API
|
||||||
5
.github/workflows/code-quality.yml
vendored
@@ -15,7 +15,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
- name: Run Biome
|
- name: Run Biome
|
||||||
run: biome ci .
|
run: biome ci .
|
||||||
|
|
||||||
- name: Check Catalog Dependencies
|
|
||||||
run: node scripts/check-catalog-deps.js
|
|
||||||
9
.github/workflows/e2e-rn-test.yml
vendored
@@ -7,7 +7,8 @@ on:
|
|||||||
- ".github/actions/android-emulator/**"
|
- ".github/actions/android-emulator/**"
|
||||||
- ".github/actions/source-code/**"
|
- ".github/actions/source-code/**"
|
||||||
- ".github/workflows/e2e-rn-test.yml"
|
- ".github/workflows/e2e-rn-test.yml"
|
||||||
- "examples/chat-rn-expo/**"
|
- "examples/chat-rn/**"
|
||||||
|
- "examples/chat-rn-clerk/**"
|
||||||
- "packages/**"
|
- "packages/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -35,8 +36,8 @@ jobs:
|
|||||||
- name: Pnpm Build
|
- name: Pnpm Build
|
||||||
run: pnpm turbo build --filter="./packages/*"
|
run: pnpm turbo build --filter="./packages/*"
|
||||||
|
|
||||||
- name: chat-rn-expo App Pre Build
|
- name: chat-rn App Pre Build
|
||||||
working-directory: ./examples/chat-rn-expo
|
working-directory: ./examples/chat-rn
|
||||||
run: |
|
run: |
|
||||||
pnpm build
|
pnpm build
|
||||||
pnpm expo prebuild --clean
|
pnpm expo prebuild --clean
|
||||||
@@ -60,7 +61,7 @@ jobs:
|
|||||||
force-avd-creation: false
|
force-avd-creation: false
|
||||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
|
||||||
disable-animations: true
|
disable-animations: true
|
||||||
working-directory: ./examples/chat-rn-expo/
|
working-directory: ./examples/chat-rn/
|
||||||
script: ./test/e2e/run.sh
|
script: ./test/e2e/run.sh
|
||||||
|
|
||||||
- name: Copy Maestro Output
|
- name: Copy Maestro Output
|
||||||
|
|||||||
2
.github/workflows/playwright.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
project: ["tests/e2e", "examples/chat", "examples/clerk", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
|
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
8
.gitignore
vendored
@@ -22,10 +22,6 @@ test-results
|
|||||||
|
|
||||||
.husky
|
.husky
|
||||||
|
|
||||||
.vscode/*
|
.vscode/settings.json
|
||||||
.idea/*
|
|
||||||
|
|
||||||
.svelte-kit
|
.svelte-kit
|
||||||
|
|
||||||
.cursorrules
|
|
||||||
.windsurfrules
|
|
||||||
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
8
.idea/jazz.iml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/jazz.iml" filepath="$PROJECT_DIR$/.idea/jazz.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
19
.idea/php.xml
generated
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="MessDetectorOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PHPCSFixerOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||||
|
<option name="highlightLevel" value="WARNING" />
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PhpStanOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PsalmOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/prettier.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PrettierConfiguration">
|
||||||
|
<option name="myConfigurationMode" value="AUTOMATIC" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
"**/android/**",
|
"**/android/**",
|
||||||
"packages/jazz-svelte/**",
|
"packages/jazz-svelte/**",
|
||||||
"examples/*svelte*/**",
|
"examples/*svelte*/**",
|
||||||
"examples/jazz-paper-scissors/src/routeTree.gen.ts",
|
|
||||||
"homepage/homepage/**",
|
"homepage/homepage/**",
|
||||||
"**/package.json"
|
"**/package.json"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,99 +1,4 @@
|
|||||||
# chat-rn-expo-clerk
|
# chat-rn-clerk
|
||||||
|
|
||||||
## 1.0.102
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-expo@0.13.10
|
|
||||||
- jazz-tools@0.13.10
|
|
||||||
- jazz-react-native-media-images@0.13.10
|
|
||||||
|
|
||||||
## 1.0.101
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [a6cf01f]
|
|
||||||
- jazz-tools@0.13.9
|
|
||||||
- jazz-expo@0.13.9
|
|
||||||
- jazz-react-native-media-images@0.13.9
|
|
||||||
|
|
||||||
## 1.0.100
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-expo@0.13.8
|
|
||||||
|
|
||||||
## 1.0.99
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [bc3d7bb]
|
|
||||||
- jazz-tools@0.13.7
|
|
||||||
- jazz-expo@0.13.7
|
|
||||||
- jazz-react-native-media-images@0.13.7
|
|
||||||
|
|
||||||
## 1.0.98
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [fe6f561]
|
|
||||||
- jazz-tools@0.13.5
|
|
||||||
- jazz-expo@0.13.5
|
|
||||||
- jazz-react-native-media-images@0.13.5
|
|
||||||
|
|
||||||
## 1.0.97
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [3129982]
|
|
||||||
- Updated dependencies [3129982]
|
|
||||||
- jazz-expo@0.13.4
|
|
||||||
- jazz-tools@0.13.4
|
|
||||||
- jazz-react-native-media-images@0.13.4
|
|
||||||
|
|
||||||
## 1.0.96
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [12f8bfa]
|
|
||||||
- Updated dependencies [bd57177]
|
|
||||||
- jazz-tools@0.13.3
|
|
||||||
- jazz-expo@0.13.3
|
|
||||||
- jazz-react-native-media-images@0.13.3
|
|
||||||
|
|
||||||
## 1.0.95
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-expo@0.13.2
|
|
||||||
- jazz-tools@0.13.2
|
|
||||||
- jazz-react-native-media-images@0.13.2
|
|
||||||
|
|
||||||
## 1.0.94
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [63a7aa0]
|
|
||||||
- jazz-expo@0.13.1
|
|
||||||
|
|
||||||
## 1.0.93
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- Updated dependencies [bce3bcc]
|
|
||||||
- Updated dependencies [afd1374]
|
|
||||||
- jazz-expo@0.13.0
|
|
||||||
- jazz-tools@0.13.0
|
|
||||||
- jazz-react-native-media-images@0.13.0
|
|
||||||
|
|
||||||
## 1.0.92
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- jazz-react-native@0.12.2
|
|
||||||
- jazz-react-native-auth-clerk@0.12.2
|
|
||||||
- jazz-tools@0.12.2
|
|
||||||
- jazz-react-native-media-images@0.12.2
|
|
||||||
|
|
||||||
## 1.0.91
|
## 1.0.91
|
||||||
|
|
||||||
@@ -11,13 +11,13 @@ pnpm i
|
|||||||
pnpm run build
|
pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Inside the `examples/chat-rn-expo-clerk` Directory
|
### 2. Inside the `examples/chat-rn-clerk` Directory
|
||||||
|
|
||||||
Next, navigate to the specific example project and run the following commands:
|
Next, navigate to the specific example project and run the following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm expo prebuild
|
pnpm expo prebuild
|
||||||
pnpx pod-install
|
npx pod-install
|
||||||
pnpm expo run:ios
|
pnpm expo run:ios
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"expo": {
|
"expo": {
|
||||||
"name": "jazz-chat-rn-expo-clerk",
|
"name": "jazz-chat-rn-clerk",
|
||||||
"scheme": "jazz-chat-rn-expo-clerk",
|
"scheme": "jazz-chat-rn-clerk",
|
||||||
"slug": "jazz-chat-rn-expo-clerk",
|
"slug": "jazz-chat-rn-clerk",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
"icon": "./assets/images/icon.png",
|
"icon": "./assets/images/icon.png",
|
||||||
@@ -23,12 +23,21 @@
|
|||||||
},
|
},
|
||||||
"package": "com.jazz.chatrnclerk"
|
"package": "com.jazz.chatrnclerk"
|
||||||
},
|
},
|
||||||
"newArchEnabled": true,
|
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
[
|
||||||
|
"expo-build-properties",
|
||||||
|
{
|
||||||
|
"ios": {
|
||||||
|
"newArchEnabled": true
|
||||||
|
},
|
||||||
|
"android": {
|
||||||
|
"newArchEnabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"expo-secure-store",
|
"expo-secure-store",
|
||||||
"expo-font",
|
"expo-font",
|
||||||
"expo-router",
|
"expo-router",
|
||||||
"expo-sqlite",
|
|
||||||
[
|
[
|
||||||
"expo-image-picker",
|
"expo-image-picker",
|
||||||
{
|
{
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Redirect, Stack } from "expo-router";
|
import { Redirect, Stack } from "expo-router";
|
||||||
import { useIsAuthenticated } from "jazz-expo";
|
import { useIsAuthenticated } from "jazz-react-native";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function HomeLayout() {
|
export default function HomeLayout() {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Redirect, Stack } from "expo-router";
|
import { Redirect, Stack } from "expo-router";
|
||||||
import { useIsAuthenticated } from "jazz-expo";
|
import { useIsAuthenticated } from "jazz-react-native";
|
||||||
|
|
||||||
export default function UnAuthenticatedLayout() {
|
export default function UnAuthenticatedLayout() {
|
||||||
const isAuthenticated = useIsAuthenticated();
|
const isAuthenticated = useIsAuthenticated();
|
||||||
@@ -28,7 +28,7 @@ const SignInWithOAuth = () => {
|
|||||||
const { createdSessionId, signIn, signUp, setActive } =
|
const { createdSessionId, signIn, signUp, setActive } =
|
||||||
await startOAuthFlow({
|
await startOAuthFlow({
|
||||||
redirectUrl: Linking.createURL("/", {
|
redirectUrl: Linking.createURL("/", {
|
||||||
scheme: "jazz-chat-rn-expo-clerk",
|
scheme: "jazz-chat-rn-clerk",
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2,40 +2,29 @@ import "../global.css";
|
|||||||
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
|
import { ClerkLoaded, ClerkProvider } from "@clerk/clerk-expo";
|
||||||
import { secureStore } from "@clerk/clerk-expo/secure-store";
|
import { secureStore } from "@clerk/clerk-expo/secure-store";
|
||||||
import { useFonts } from "expo-font";
|
import { useFonts } from "expo-font";
|
||||||
import { Slot, useRouter, useSegments } from "expo-router";
|
import { Slot } from "expo-router";
|
||||||
import * as SplashScreen from "expo-splash-screen";
|
import * as SplashScreen from "expo-splash-screen";
|
||||||
import { useIsAuthenticated, useJazzContext } from "jazz-expo";
|
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { tokenCache } from "../cache";
|
import { tokenCache } from "../cache";
|
||||||
import { JazzAndAuth } from "../src/auth-context";
|
import { JazzAndAuth } from "../src/auth-context";
|
||||||
|
|
||||||
SplashScreen.preventAutoHideAsync();
|
SplashScreen.preventAutoHideAsync();
|
||||||
|
|
||||||
function InitialLayout() {
|
|
||||||
const isAuthenticated = useIsAuthenticated();
|
|
||||||
const segments = useSegments();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const inAuthGroup = segments[0] === "(auth)";
|
|
||||||
|
|
||||||
if (isAuthenticated && inAuthGroup) {
|
|
||||||
router.replace("/chat");
|
|
||||||
} else if (!isAuthenticated && !inAuthGroup) {
|
|
||||||
router.replace("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
SplashScreen.hideAsync();
|
|
||||||
}, [isAuthenticated, segments, router]);
|
|
||||||
|
|
||||||
return <Slot />;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
const [fontsLoaded] = useFonts({
|
const [loaded] = useFonts({
|
||||||
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
|
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (loaded) {
|
||||||
|
SplashScreen.hideAsync();
|
||||||
|
}
|
||||||
|
}, [loaded]);
|
||||||
|
|
||||||
|
if (!loaded) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY;
|
const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY;
|
||||||
|
|
||||||
if (!publishableKey) {
|
if (!publishableKey) {
|
||||||
@@ -44,17 +33,6 @@ export default function RootLayout() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (fontsLoaded) {
|
|
||||||
} else {
|
|
||||||
SplashScreen.preventAutoHideAsync();
|
|
||||||
}
|
|
||||||
}, [fontsLoaded]);
|
|
||||||
|
|
||||||
if (!fontsLoaded) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ClerkProvider
|
<ClerkProvider
|
||||||
tokenCache={tokenCache}
|
tokenCache={tokenCache}
|
||||||
@@ -63,7 +41,7 @@ export default function RootLayout() {
|
|||||||
>
|
>
|
||||||
<ClerkLoaded>
|
<ClerkLoaded>
|
||||||
<JazzAndAuth>
|
<JazzAndAuth>
|
||||||
<InitialLayout />
|
<Slot />
|
||||||
</JazzAndAuth>
|
</JazzAndAuth>
|
||||||
</ClerkLoaded>
|
</ClerkLoaded>
|
||||||
</ClerkProvider>
|
</ClerkProvider>
|
||||||
@@ -4,8 +4,8 @@ import clsx from "clsx";
|
|||||||
import * as Clipboard from "expo-clipboard";
|
import * as Clipboard from "expo-clipboard";
|
||||||
import * as ImagePicker from "expo-image-picker";
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
import { useLocalSearchParams } from "expo-router";
|
||||||
import { useAccount, useCoState } from "jazz-expo";
|
import { useAccount, useCoState } from "jazz-react-native";
|
||||||
import { ProgressiveImg } from "jazz-expo";
|
import { ProgressiveImg } from "jazz-react-native";
|
||||||
import { createImage } from "jazz-react-native-media-images";
|
import { createImage } from "jazz-react-native-media-images";
|
||||||
import { Group, ID } from "jazz-tools";
|
import { Group, ID } from "jazz-tools";
|
||||||
import { useEffect, useLayoutEffect, useState } from "react";
|
import { useEffect, useLayoutEffect, useState } from "react";
|
||||||
@@ -165,8 +165,8 @@ export default function Conversation() {
|
|||||||
!isMe ? "mt-2 text-gray-500" : "mt-1 text-gray-200",
|
!isMe ? "mt-2 text-gray-500" : "mt-1 text-gray-200",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{item._edits.text.madeAt?.getHours().toString().padStart(2, "0")}:
|
{item._edits.text.madeAt.getHours()}:
|
||||||
{item._edits.text.madeAt?.getMinutes().toString().padStart(2, "0")}
|
{item._edits.text.madeAt.getMinutes()}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -11,7 +11,7 @@ import React, {
|
|||||||
} from "react-native";
|
} from "react-native";
|
||||||
|
|
||||||
import { useUser } from "@clerk/clerk-expo";
|
import { useUser } from "@clerk/clerk-expo";
|
||||||
import { useAccount } from "jazz-expo";
|
import { useAccount } from "jazz-react-native";
|
||||||
import { Chat } from "../../src/schema";
|
import { Chat } from "../../src/schema";
|
||||||
|
|
||||||
export default function ChatScreen() {
|
export default function ChatScreen() {
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 313 KiB After Width: | Height: | Size: 313 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
@@ -1,67 +1,74 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn-expo-clerk",
|
"name": "chat-rn-clerk",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"version": "1.0.102",
|
"version": "1.0.91",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
"start": "expo start",
|
"start": "expo start",
|
||||||
"format-and-lint": "biome check .",
|
"format-and-lint": "biome check .",
|
||||||
"format-and-lint:fix": "biome check . --write",
|
"format-and-lint:fix": "biome check . --write",
|
||||||
"android": "expo run:android",
|
"android": "expo run:android",
|
||||||
"ios": "expo prebuild && pnpx pod-install && expo run:ios",
|
"ios": "expo run:ios",
|
||||||
"web": "expo start --web",
|
"web": "expo start --web"
|
||||||
"run:ios": "pnpm expo prebuild && npx pod-install && pnpm expo run:ios"
|
},
|
||||||
|
"jest": {
|
||||||
|
"preset": "jest-expo"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
||||||
"@bacons/text-decoder": "0.0.0",
|
"@bacons/text-decoder": "0.0.0",
|
||||||
"@bam.tech/react-native-image-resizer": "^3.0.11",
|
"@bam.tech/react-native-image-resizer": "^3.0.11",
|
||||||
"@clerk/clerk-expo": "^2.2.21",
|
|
||||||
"@craftzdog/react-native-buffer": "6.0.5",
|
"@craftzdog/react-native-buffer": "6.0.5",
|
||||||
|
"@clerk/clerk-expo": "^2.2.21",
|
||||||
"@expo/vector-icons": "^14.0.2",
|
"@expo/vector-icons": "^14.0.2",
|
||||||
"@react-native-community/netinfo": "11.4.1",
|
"@op-engineering/op-sqlite": "^11.2.12",
|
||||||
"@react-navigation/native": "7.0.19",
|
"@react-native-community/netinfo": "^11.4.1",
|
||||||
"@react-navigation/native-stack": "7.2.1",
|
"@react-navigation/native": "^7.0.13",
|
||||||
|
"@react-navigation/native-stack": "^7.1.14",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"expo": "^52.0.42",
|
"expo": "^52.0.0",
|
||||||
"expo-build-properties": "~0.13.1",
|
"expo-build-properties": "~0.13.1",
|
||||||
"expo-clipboard": "~7.0.0",
|
"expo-clipboard": "~7.0.0",
|
||||||
"expo-constants": "~17.0.8",
|
"expo-constants": "~17.0.3",
|
||||||
"expo-crypto": "~14.0.2",
|
"expo-crypto": "~14.0.1",
|
||||||
"expo-dev-client": "~5.0.16",
|
"expo-dev-client": "~5.0.5",
|
||||||
"expo-file-system": "^18.0.4",
|
"expo-file-system": "^18.0.4",
|
||||||
"expo-font": "~13.0.1",
|
"expo-font": "~13.0.1",
|
||||||
"expo-image-picker": "~16.0.6",
|
"expo-image-picker": "~16.0.4",
|
||||||
"expo-linking": "~7.0.5",
|
"expo-linking": "~7.0.3",
|
||||||
"expo-router": "~4.0.19",
|
"expo-router": "~4.0.11",
|
||||||
"expo-secure-store": "~14.0.0",
|
"expo-secure-store": "~14.0.0",
|
||||||
"expo-splash-screen": "~0.29.22",
|
"expo-splash-screen": "~0.29.16",
|
||||||
"expo-sqlite": "15.1.3",
|
"expo-status-bar": "~2.0.0",
|
||||||
"expo-status-bar": "~2.0.1",
|
"expo-system-ui": "~4.0.5",
|
||||||
"expo-web-browser": "~14.0.1",
|
"expo-web-browser": "~14.0.1",
|
||||||
"jazz-expo": "workspace:*",
|
"jazz-react-native": "workspace:*",
|
||||||
|
"jazz-react-native-auth-clerk": "workspace:*",
|
||||||
"jazz-react-native-media-images": "workspace:*",
|
"jazz-react-native-media-images": "workspace:*",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:*",
|
||||||
"nativewind": "^4.1.21",
|
"nativewind": "^4.1.21",
|
||||||
"react": "18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-native": "0.76.7",
|
"react-native": "~0.76.3",
|
||||||
"react-native-gesture-handler": "~2.20.2",
|
"react-native-gesture-handler": "~2.20.2",
|
||||||
"react-native-get-random-values": "^1.11.0",
|
"react-native-get-random-values": "^1.11.0",
|
||||||
"react-native-reanimated": "~3.16.3",
|
"react-native-reanimated": "~3.16.3",
|
||||||
"react-native-safe-area-context": "4.12.0",
|
"react-native-safe-area-context": "4.12.0",
|
||||||
"react-native-screens": "4.4.0",
|
"react-native-screens": "4.1.0",
|
||||||
"react-native-url-polyfill": "^2.0.0",
|
"react-native-url-polyfill": "^2.0.0",
|
||||||
"react-native-web": "~0.19.13",
|
"react-native-web": "~0.19.13",
|
||||||
"readable-stream": "4.7.0"
|
"readable-stream": "4.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "^7.20.0",
|
||||||
"@types/react": "~18.3.12",
|
"@types/jest": "^29.5.3",
|
||||||
"@types/react-test-renderer": "^19.0.0",
|
"@types/react": "^18.3.12",
|
||||||
"react-test-renderer": "18.3.1",
|
"@types/react-test-renderer": "^18.0.7",
|
||||||
|
"jest": "^29.2.1",
|
||||||
|
"jest-expo": "~52.0.2",
|
||||||
|
"react-test-renderer": "18.2.0",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "5.6.2"
|
"typescript": "~5.6.2"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
1
examples/chat-rn-clerk/src/apiKey.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const apiKey = "chat-rn-clerk-example-jazz@garden.co";
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useClerk } from "@clerk/clerk-expo";
|
import { useClerk } from "@clerk/clerk-expo";
|
||||||
import { JazzProviderWithClerk } from "jazz-expo/auth/clerk";
|
import { JazzProviderWithClerk } from "jazz-react-native-auth-clerk";
|
||||||
import React, { PropsWithChildren } from "react";
|
import React, { PropsWithChildren } from "react";
|
||||||
import { apiKey } from "./apiKey";
|
import { apiKey } from "./apiKey";
|
||||||
|
|
||||||
@@ -9,6 +9,7 @@ export function JazzAndAuth({ children }: PropsWithChildren) {
|
|||||||
return (
|
return (
|
||||||
<JazzProviderWithClerk
|
<JazzProviderWithClerk
|
||||||
clerk={clerk}
|
clerk={clerk}
|
||||||
|
storage="sqlite"
|
||||||
sync={{
|
sync={{
|
||||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
||||||
}}
|
}}
|
||||||
@@ -1 +0,0 @@
|
|||||||
export const apiKey = "chat-rn-expo-clerk-example-jazz@garden.co";
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
# 🎷 Jazz + Expo + `react-navigation` + Demo Auth
|
|
||||||
|
|
||||||
## 🚀 How to Run
|
|
||||||
|
|
||||||
### 1. Inside the Workspace Root
|
|
||||||
|
|
||||||
First, install dependencies and build the project:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pnpm i
|
|
||||||
pnpm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Inside the `examples/chat-rn-expo` Directory
|
|
||||||
|
|
||||||
Next, navigate to the specific example project and run the following commands:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pnpm expo prebuild
|
|
||||||
pnpx pod-install
|
|
||||||
pnpm expo run:ios
|
|
||||||
```
|
|
||||||
|
|
||||||
This will set up and launch the app on iOS. For Android, you can replace the last command with `pnpm expo run:android`.
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"expo": {
|
|
||||||
"name": "jazz-chat-rn-expo",
|
|
||||||
"scheme": "jazz-chat-rn-expo",
|
|
||||||
"slug": "jazz-chat-rn-expo",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"orientation": "portrait",
|
|
||||||
"icon": "./assets/icon.png",
|
|
||||||
"userInterfaceStyle": "light",
|
|
||||||
"splash": {
|
|
||||||
"image": "./assets/splash.png",
|
|
||||||
"resizeMode": "contain",
|
|
||||||
"backgroundColor": "#ffffff"
|
|
||||||
},
|
|
||||||
"ios": {
|
|
||||||
"supportsTablet": true,
|
|
||||||
"bundleIdentifier": "com.jazz.chatrn"
|
|
||||||
},
|
|
||||||
"android": {
|
|
||||||
"adaptiveIcon": {
|
|
||||||
"foregroundImage": "./assets/adaptive-icon.png",
|
|
||||||
"backgroundColor": "#ffffff"
|
|
||||||
},
|
|
||||||
"package": "com.jazz.chatrn"
|
|
||||||
},
|
|
||||||
"plugins": ["expo-secure-store", "expo-sqlite", "expo-build-properties"],
|
|
||||||
"extra": {
|
|
||||||
"eas": {
|
|
||||||
"projectId": "e0e61872-1906-4c84-b9d8-9be77355cad0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"owner": "paxx"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
module.exports = function (api) {
|
|
||||||
api.cache(true);
|
|
||||||
return {
|
|
||||||
presets: [
|
|
||||||
["babel-preset-expo", { jsxImportSource: "nativewind" }],
|
|
||||||
"nativewind/babel",
|
|
||||||
],
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
// Learn more https://docs.expo.dev/guides/monorepos
|
|
||||||
const { getDefaultConfig } = require("expo/metro-config");
|
|
||||||
const { withNativeWind } = require("nativewind/metro");
|
|
||||||
const { FileStore } = require("metro-cache");
|
|
||||||
const path = require("path");
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
const projectRoot = __dirname;
|
|
||||||
const workspaceRoot = path.resolve(projectRoot, "../..");
|
|
||||||
|
|
||||||
const config = getDefaultConfig(projectRoot, { isCSSEnabled: true });
|
|
||||||
|
|
||||||
// Since we are using pnpm, we have to setup the monorepo manually for Metro
|
|
||||||
// #1 - Watch all files in the monorepo
|
|
||||||
config.watchFolders = [workspaceRoot];
|
|
||||||
// #2 - Try resolving with project modules first, then workspace modules
|
|
||||||
config.resolver.nodeModulesPaths = [
|
|
||||||
path.resolve(projectRoot, "node_modules"),
|
|
||||||
path.resolve(workspaceRoot, "node_modules"),
|
|
||||||
];
|
|
||||||
config.resolver.sourceExts = ["mjs", "js", "json", "ts", "tsx"];
|
|
||||||
config.resolver.requireCycleIgnorePatterns = [
|
|
||||||
/(^|\/|\\)node_modules($|\/|\\)/,
|
|
||||||
/(^|\/|\\)packages($|\/|\\)/,
|
|
||||||
];
|
|
||||||
|
|
||||||
// Use turborepo to restore the cache when possible
|
|
||||||
config.cacheStores = [
|
|
||||||
new FileStore({
|
|
||||||
root: path.join(projectRoot, "node_modules", ".cache", "metro"),
|
|
||||||
}),
|
|
||||||
];
|
|
||||||
|
|
||||||
// module.exports = config;
|
|
||||||
module.exports = withNativeWind(config, { input: "./global.css" });
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "chat-rn-expo",
|
|
||||||
"version": "1.0.89",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"build": "expo export -p ios",
|
|
||||||
"start": "expo start",
|
|
||||||
"format-and-lint": "biome check .",
|
|
||||||
"format-and-lint:fix": "biome check . --write",
|
|
||||||
"android": "expo run:android",
|
|
||||||
"ios": "expo prebuild && pnpx pod-install && expo run:ios",
|
|
||||||
"web": "expo start --web"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
|
||||||
"@bacons/text-decoder": "0.0.0",
|
|
||||||
"@craftzdog/react-native-buffer": "6.0.5",
|
|
||||||
"@react-native-community/netinfo": "11.4.1",
|
|
||||||
"@react-navigation/native": "7.0.19",
|
|
||||||
"@react-navigation/native-stack": "7.2.1",
|
|
||||||
"clsx": "^2.0.0",
|
|
||||||
"expo": "52.0.42",
|
|
||||||
"expo-build-properties": "~0.13.1",
|
|
||||||
"expo-clipboard": "~7.0.0",
|
|
||||||
"expo-constants": "~17.0.8",
|
|
||||||
"expo-dev-client": "~5.0.16",
|
|
||||||
"expo-linking": "~7.0.5",
|
|
||||||
"expo-secure-store": "~14.0.0",
|
|
||||||
"expo-sqlite": "15.1.3",
|
|
||||||
"expo-status-bar": "~2.0.1",
|
|
||||||
"expo-web-browser": "~14.0.1",
|
|
||||||
"jazz-expo": "workspace:*",
|
|
||||||
"jazz-tools": "workspace:*",
|
|
||||||
"nativewind": "^4.1.21",
|
|
||||||
"react": "18.3.1",
|
|
||||||
"react-dom": "18.3.1",
|
|
||||||
"react-native": "0.76.7",
|
|
||||||
"react-native-get-random-values": "^1.11.0",
|
|
||||||
"react-native-safe-area-context": "4.12.0",
|
|
||||||
"react-native-screens": "4.4.0",
|
|
||||||
"react-native-url-polyfill": "^2.0.0",
|
|
||||||
"readable-stream": "4.7.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@babel/core": "^7.25.2",
|
|
||||||
"@types/react": "~18.3.12",
|
|
||||||
"tailwindcss": "^3.4.17",
|
|
||||||
"typescript": "5.6.2"
|
|
||||||
},
|
|
||||||
"private": true
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
import "../global.css";
|
|
||||||
|
|
||||||
import {
|
|
||||||
NavigationContainer,
|
|
||||||
useNavigationContainerRef,
|
|
||||||
} from "@react-navigation/native";
|
|
||||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
|
||||||
import * as Linking from "expo-linking";
|
|
||||||
import React, { StrictMode, useEffect, useState } from "react";
|
|
||||||
import HandleInviteScreen from "./invite";
|
|
||||||
|
|
||||||
import { JazzProvider } from "jazz-expo";
|
|
||||||
import { apiKey } from "./apiKey";
|
|
||||||
import ChatScreen from "./chat";
|
|
||||||
|
|
||||||
const Stack = createNativeStackNavigator();
|
|
||||||
|
|
||||||
const prefix = Linking.createURL("/");
|
|
||||||
|
|
||||||
const linking = {
|
|
||||||
prefixes: [prefix],
|
|
||||||
config: {
|
|
||||||
screens: {
|
|
||||||
HandleInviteScreen: {
|
|
||||||
path: "router/invite/:valueHint?/:valueID/:inviteSecret",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
const [initialRoute, setInitialRoute] = useState<
|
|
||||||
"ChatScreen" | "HandleInviteScreen"
|
|
||||||
>("ChatScreen");
|
|
||||||
const navigationRef = useNavigationContainerRef();
|
|
||||||
useEffect(() => {
|
|
||||||
Linking.getInitialURL().then((url) => {
|
|
||||||
if (url) {
|
|
||||||
if (url && url.includes("invite")) {
|
|
||||||
setInitialRoute("HandleInviteScreen");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<StrictMode>
|
|
||||||
<JazzProvider
|
|
||||||
sync={{
|
|
||||||
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<NavigationContainer linking={linking} ref={navigationRef}>
|
|
||||||
<Stack.Navigator initialRouteName={initialRoute}>
|
|
||||||
<Stack.Screen
|
|
||||||
options={{ title: "Jazz Chat" }}
|
|
||||||
name="ChatScreen"
|
|
||||||
// @ts-ignore
|
|
||||||
component={ChatScreen}
|
|
||||||
/>
|
|
||||||
<Stack.Screen
|
|
||||||
name="HandleInviteScreen"
|
|
||||||
component={HandleInviteScreen}
|
|
||||||
/>
|
|
||||||
</Stack.Navigator>
|
|
||||||
</NavigationContainer>
|
|
||||||
</JazzProvider>
|
|
||||||
</StrictMode>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export const apiKey = "chat-rn-expo-example-jazz@garden.co";
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
import clsx from "clsx";
|
|
||||||
import * as Clipboard from "expo-clipboard";
|
|
||||||
import { Group, ID, Profile } from "jazz-tools";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import React, {
|
|
||||||
Button,
|
|
||||||
FlatList,
|
|
||||||
KeyboardAvoidingView,
|
|
||||||
SafeAreaView,
|
|
||||||
Text,
|
|
||||||
TextInput,
|
|
||||||
TouchableOpacity,
|
|
||||||
View,
|
|
||||||
Alert,
|
|
||||||
} from "react-native";
|
|
||||||
|
|
||||||
import { useAccount, useCoState } from "jazz-expo";
|
|
||||||
import { Chat, Message } from "./schema";
|
|
||||||
|
|
||||||
export default function ChatScreen({ navigation }: { navigation: any }) {
|
|
||||||
const { me, logOut } = useAccount();
|
|
||||||
const [chatId, setChatId] = useState<ID<Chat>>();
|
|
||||||
const loadedChat = useCoState(Chat, chatId, { resolve: { $each: true } });
|
|
||||||
const [message, setMessage] = useState("");
|
|
||||||
const profile = useCoState(Profile, me._refs.profile?.id, {});
|
|
||||||
|
|
||||||
function handleLogOut() {
|
|
||||||
setChatId(undefined);
|
|
||||||
logOut();
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
navigation.setOptions({
|
|
||||||
headerRight: () => <Button onPress={handleLogOut} title="Logout" />,
|
|
||||||
headerLeft: () =>
|
|
||||||
loadedChat ? (
|
|
||||||
<Button
|
|
||||||
onPress={() => {
|
|
||||||
if (loadedChat?.id) {
|
|
||||||
Clipboard.setStringAsync(
|
|
||||||
`https://chat.jazz.tools/#/chat/${loadedChat.id}`,
|
|
||||||
);
|
|
||||||
Alert.alert("Copied to clipboard", `Chat ID: ${loadedChat.id}`);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
title="Share"
|
|
||||||
/>
|
|
||||||
) : null,
|
|
||||||
});
|
|
||||||
}, [navigation, loadedChat]);
|
|
||||||
|
|
||||||
const createChat = () => {
|
|
||||||
const group = Group.create({ owner: me });
|
|
||||||
group.addMember("everyone", "writer");
|
|
||||||
const chat = Chat.create([], { owner: group });
|
|
||||||
setChatId(chat.id);
|
|
||||||
};
|
|
||||||
|
|
||||||
const joinChat = () => {
|
|
||||||
Alert.prompt(
|
|
||||||
"Join Chat",
|
|
||||||
"Enter the Chat ID (example: co_zBGEHYvRfGuT2YSBraY3njGjnde)",
|
|
||||||
[
|
|
||||||
{
|
|
||||||
text: "Cancel",
|
|
||||||
style: "cancel",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "Join",
|
|
||||||
onPress: (chatId) => {
|
|
||||||
if (chatId) {
|
|
||||||
setChatId(chatId as ID<Chat>);
|
|
||||||
} else {
|
|
||||||
Alert.alert("Error", "Chat ID cannot be empty.");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"plain-text",
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const sendMessage = () => {
|
|
||||||
if (!loadedChat) return;
|
|
||||||
if (message.trim()) {
|
|
||||||
loadedChat.push(
|
|
||||||
Message.create({ text: message }, { owner: loadedChat?._owner }),
|
|
||||||
);
|
|
||||||
setMessage("");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const renderMessageItem = ({ item }: { item: Message }) => {
|
|
||||||
const isMe = item._edits?.text?.by?.isMe;
|
|
||||||
return (
|
|
||||||
<View
|
|
||||||
className={clsx(
|
|
||||||
`rounded-lg p-1 px-1.5 max-w-[80%] `,
|
|
||||||
|
|
||||||
isMe ? `bg-gray-200 self-end text-right` : `bg-gray-300 self-start `,
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{!isMe ? (
|
|
||||||
<Text
|
|
||||||
className={clsx(
|
|
||||||
`text-xs text-gray-500`,
|
|
||||||
isMe ? "text-right" : "text-left",
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{item?._edits?.text?.by?.profile?.name}
|
|
||||||
</Text>
|
|
||||||
) : null}
|
|
||||||
<View
|
|
||||||
className={clsx(
|
|
||||||
"flex relative items-end justify-between",
|
|
||||||
isMe ? "flex-row" : "flex-row",
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<Text className={clsx(`text-black text-md max-w-[85%]`)}>
|
|
||||||
{item.text}
|
|
||||||
</Text>
|
|
||||||
<Text
|
|
||||||
className={clsx(
|
|
||||||
"text-[10px] text-gray-500 text-right ml-2",
|
|
||||||
!isMe ? "mt-2" : "mt-1",
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{item?._edits?.text?.madeAt?.getHours().toString().padStart(2, "0")}
|
|
||||||
:
|
|
||||||
{item?._edits?.text?.madeAt
|
|
||||||
?.getMinutes()
|
|
||||||
.toString()
|
|
||||||
.padStart(2, "0")}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View className="flex flex-col h-full">
|
|
||||||
{!loadedChat ? (
|
|
||||||
<View className="flex flex-col h-full items-center justify-center">
|
|
||||||
<Text className="text-m font-bold mb-6">Username</Text>
|
|
||||||
<TextInput
|
|
||||||
className="rounded h-12 p-2 mb-12 w-40 border border-gray-200 block"
|
|
||||||
value={profile?.name ?? ""}
|
|
||||||
onChangeText={(value) => {
|
|
||||||
if (profile) {
|
|
||||||
profile.name = value;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
textAlignVertical="center"
|
|
||||||
onSubmitEditing={sendMessage}
|
|
||||||
testID="username-input"
|
|
||||||
/>
|
|
||||||
<TouchableOpacity
|
|
||||||
onPress={createChat}
|
|
||||||
className="bg-blue-500 p-4 rounded-md"
|
|
||||||
>
|
|
||||||
<Text className="text-white font-semibold">Start new chat</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
<TouchableOpacity
|
|
||||||
onPress={joinChat}
|
|
||||||
className="bg-green-500 p-4 rounded-md mt-4"
|
|
||||||
>
|
|
||||||
<Text className="text-white font-semibold">Join chat</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<FlatList
|
|
||||||
contentContainerStyle={{
|
|
||||||
flexGrow: 1,
|
|
||||||
flex: 1,
|
|
||||||
gap: 6,
|
|
||||||
padding: 8,
|
|
||||||
}}
|
|
||||||
className="flex"
|
|
||||||
data={loadedChat}
|
|
||||||
keyExtractor={(item) => item.id}
|
|
||||||
renderItem={renderMessageItem}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<KeyboardAvoidingView
|
|
||||||
keyboardVerticalOffset={110}
|
|
||||||
behavior="padding"
|
|
||||||
className="p-3 bg-white border-t border-gray-300"
|
|
||||||
>
|
|
||||||
<SafeAreaView className="flex flex-row items-center gap-2">
|
|
||||||
<TextInput
|
|
||||||
className="rounded-full h-8 py-0 px-2 border border-gray-200 block flex-1"
|
|
||||||
value={message}
|
|
||||||
onChangeText={setMessage}
|
|
||||||
placeholder="Type a message..."
|
|
||||||
textAlignVertical="center"
|
|
||||||
onSubmitEditing={sendMessage}
|
|
||||||
testID="message-input"
|
|
||||||
/>
|
|
||||||
<TouchableOpacity
|
|
||||||
onPress={sendMessage}
|
|
||||||
className="bg-gray-300 text-white rounded-full h-8 w-8 items-center justify-center"
|
|
||||||
testID="send-button"
|
|
||||||
>
|
|
||||||
<Text>↑</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
</SafeAreaView>
|
|
||||||
</KeyboardAvoidingView>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { useAcceptInvite } from "jazz-expo";
|
|
||||||
import React, { Text } from "react-native";
|
|
||||||
import { Chat } from "./schema";
|
|
||||||
|
|
||||||
export default function HandleInviteScreen({
|
|
||||||
navigation,
|
|
||||||
}: {
|
|
||||||
navigation: any;
|
|
||||||
}) {
|
|
||||||
useAcceptInvite({
|
|
||||||
invitedObjectSchema: Chat,
|
|
||||||
onAccept: async (chatId) => {
|
|
||||||
navigation.navigate("ChatScreen", { chatId });
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return <Text>Accepting invite...</Text>;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import { CoList, CoMap, co } from "jazz-tools";
|
|
||||||
|
|
||||||
export class Message extends CoMap {
|
|
||||||
text = co.string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Chat extends CoList.Of(co.ref(Message)) {}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
BUNDLE_PATH: "vendor/bundle"
|
|
||||||
BUNDLE_FORCE_RUBY_PLATFORM: 1
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
extends: ["@react-native", "plugin:prettier/recommended"],
|
|
||||||
plugins: ["prettier"],
|
|
||||||
};
|
|
||||||
97
examples/chat-rn/.gitignore
vendored
@@ -1,75 +1,38 @@
|
|||||||
# OSX
|
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
|
||||||
#
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Xcode
|
# dependencies
|
||||||
#
|
|
||||||
build/
|
|
||||||
*.pbxuser
|
|
||||||
!default.pbxuser
|
|
||||||
*.mode1v3
|
|
||||||
!default.mode1v3
|
|
||||||
*.mode2v3
|
|
||||||
!default.mode2v3
|
|
||||||
*.perspectivev3
|
|
||||||
!default.perspectivev3
|
|
||||||
xcuserdata
|
|
||||||
*.xccheckout
|
|
||||||
*.moved-aside
|
|
||||||
DerivedData
|
|
||||||
*.hmap
|
|
||||||
*.ipa
|
|
||||||
*.xcuserstate
|
|
||||||
**/.xcode.env.local
|
|
||||||
|
|
||||||
# Android/IntelliJ
|
|
||||||
#
|
|
||||||
build/
|
|
||||||
.idea
|
|
||||||
.gradle
|
|
||||||
local.properties
|
|
||||||
*.iml
|
|
||||||
*.hprof
|
|
||||||
.cxx/
|
|
||||||
*.keystore
|
|
||||||
!debug.keystore
|
|
||||||
.kotlin/
|
|
||||||
|
|
||||||
# node.js
|
|
||||||
#
|
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
|
||||||
yarn-error.log
|
|
||||||
|
|
||||||
# fastlane
|
# Expo
|
||||||
#
|
.expo/
|
||||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
dist/
|
||||||
# screenshots whenever they are needed.
|
web-build/
|
||||||
# For more information about the recommended setup visit:
|
|
||||||
# https://docs.fastlane.tools/best-practices/source-control/
|
|
||||||
|
|
||||||
**/fastlane/report.xml
|
# Native
|
||||||
**/fastlane/Preview.html
|
*.orig.*
|
||||||
**/fastlane/screenshots
|
*.jks
|
||||||
**/fastlane/test_output
|
*.p8
|
||||||
|
*.p12
|
||||||
|
*.key
|
||||||
|
*.mobileprovision
|
||||||
|
|
||||||
# Bundle artifact
|
# Metro
|
||||||
*.jsbundle
|
|
||||||
|
|
||||||
# Ruby / CocoaPods
|
|
||||||
**/Pods/
|
|
||||||
/vendor/bundle/
|
|
||||||
|
|
||||||
# Temporary files created by Metro to check the health of the file watcher
|
|
||||||
.metro-health-check*
|
.metro-health-check*
|
||||||
|
|
||||||
# testing
|
# debug
|
||||||
/coverage
|
npm-debug.*
|
||||||
|
yarn-debug.*
|
||||||
|
yarn-error.*
|
||||||
|
|
||||||
# Yarn
|
# macOS
|
||||||
.yarn/*
|
.DS_Store
|
||||||
!.yarn/patches
|
*.pem
|
||||||
!.yarn/plugins
|
|
||||||
!.yarn/releases
|
# local env files
|
||||||
!.yarn/sdks
|
.env*.local
|
||||||
!.yarn/versions
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
ios
|
||||||
|
android
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
ios
|
|
||||||
android
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
arrowParens: "avoid",
|
|
||||||
bracketSameLine: true,
|
|
||||||
bracketSpacing: true,
|
|
||||||
singleQuote: false,
|
|
||||||
trailingComma: "all",
|
|
||||||
};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{}
|
|
||||||
@@ -1,93 +1,679 @@
|
|||||||
# chat-rn
|
# chat-rn
|
||||||
|
|
||||||
## 1.0.97
|
## 1.0.87
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [f837cfe]
|
- jazz-react-native@0.12.1
|
||||||
- cojson@0.13.10
|
- jazz-tools@0.12.1
|
||||||
- cojson-transport-ws@0.13.10
|
|
||||||
- jazz-react-native@0.13.10
|
|
||||||
- jazz-tools@0.13.10
|
|
||||||
|
|
||||||
## 1.0.96
|
## 1.0.86
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [a6cf01f]
|
- Updated dependencies [01523dc]
|
||||||
- jazz-tools@0.13.9
|
- Updated dependencies [4ea87dc]
|
||||||
- jazz-react-native@0.13.9
|
- Updated dependencies [1e6da19]
|
||||||
|
- Updated dependencies [b6c6a0a]
|
||||||
|
- jazz-tools@0.12.0
|
||||||
|
- jazz-react-native@0.12.0
|
||||||
|
|
||||||
## 1.0.95
|
## 1.0.85
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [bc3d7bb]
|
- jazz-react-native@0.11.8
|
||||||
- Updated dependencies [4e9aae1]
|
- jazz-tools@0.11.8
|
||||||
- Updated dependencies [21c935c]
|
|
||||||
- Updated dependencies [aa1c80e]
|
|
||||||
- Updated dependencies [13074be]
|
|
||||||
- jazz-tools@0.13.7
|
|
||||||
- cojson@0.13.7
|
|
||||||
- jazz-react-native@0.13.7
|
|
||||||
- cojson-transport-ws@0.13.7
|
|
||||||
|
|
||||||
## 1.0.94
|
## 1.0.84
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [e090b39]
|
- Updated dependencies [a140f55]
|
||||||
- Updated dependencies [fe6f561]
|
- Updated dependencies [2b0d1b0]
|
||||||
- cojson@0.13.5
|
- jazz-tools@0.11.7
|
||||||
- jazz-tools@0.13.5
|
- jazz-react-native@0.11.7
|
||||||
- cojson-transport-ws@0.13.5
|
|
||||||
- jazz-react-native@0.13.5
|
|
||||||
|
|
||||||
## 1.0.93
|
## 1.0.83
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [3129982]
|
- Updated dependencies [e7c85b7]
|
||||||
- jazz-tools@0.13.4
|
- jazz-react-native@0.11.6
|
||||||
- jazz-react-native@0.13.4
|
- jazz-tools@0.11.6
|
||||||
|
|
||||||
## 1.0.92
|
## 1.0.82
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [12f8bfa]
|
- jazz-react-native@0.11.5
|
||||||
- Updated dependencies [b19cab7]
|
- jazz-tools@0.11.5
|
||||||
- Updated dependencies [bd57177]
|
|
||||||
- jazz-tools@0.13.3
|
|
||||||
- cojson-transport-ws@0.13.3
|
|
||||||
- jazz-react-native@0.13.3
|
|
||||||
|
|
||||||
## 1.0.91
|
## 1.0.81
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [c551839]
|
- Updated dependencies [57a3dbe]
|
||||||
- cojson@0.13.2
|
- Updated dependencies [a717754]
|
||||||
- cojson-transport-ws@0.13.2
|
- Updated dependencies [a91f343]
|
||||||
- jazz-react-native@0.13.2
|
- jazz-tools@0.11.4
|
||||||
- jazz-tools@0.13.2
|
- jazz-react-native@0.11.4
|
||||||
|
|
||||||
## 1.0.90
|
## 1.0.80
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [63a7aa0]
|
- jazz-react-native@0.11.3
|
||||||
- jazz-react-native@0.13.1
|
- jazz-tools@0.11.3
|
||||||
|
|
||||||
## 1.0.89
|
## 1.0.79
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
||||||
- Updated dependencies [a013538]
|
- Updated dependencies [6892dc6]
|
||||||
- Updated dependencies [bce3bcc]
|
- jazz-tools@0.11.2
|
||||||
- Updated dependencies [afd1374]
|
- jazz-react-native@0.11.2
|
||||||
- Updated dependencies [bce3bcc]
|
|
||||||
- cojson@0.13.0
|
## 1.0.78
|
||||||
- jazz-react-native@0.13.0
|
|
||||||
- jazz-tools@0.13.0
|
### Patch Changes
|
||||||
- cojson-transport-ws@0.13.0
|
|
||||||
|
- jazz-react-native@0.11.1
|
||||||
|
|
||||||
|
## 1.0.77
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [6a96d8b]
|
||||||
|
- Updated dependencies [a35249a]
|
||||||
|
- Updated dependencies [b9d194a]
|
||||||
|
- Updated dependencies [a4713df]
|
||||||
|
- Updated dependencies [34cbdc3]
|
||||||
|
- Updated dependencies [f039e8f]
|
||||||
|
- Updated dependencies [e22de9f]
|
||||||
|
- jazz-tools@0.11.0
|
||||||
|
- jazz-react-native@0.11.0
|
||||||
|
|
||||||
|
## 1.0.76
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [2f99de0]
|
||||||
|
- jazz-tools@0.10.15
|
||||||
|
- jazz-react-native@0.10.15
|
||||||
|
|
||||||
|
## 1.0.75
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [75211e3]
|
||||||
|
- jazz-tools@0.10.14
|
||||||
|
- jazz-react-native@0.10.14
|
||||||
|
|
||||||
|
## 1.0.74
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [07feedd]
|
||||||
|
- jazz-tools@0.10.13
|
||||||
|
- jazz-react-native@0.10.13
|
||||||
|
|
||||||
|
## 1.0.73
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [4612e05]
|
||||||
|
- jazz-tools@0.10.12
|
||||||
|
- jazz-react-native@0.10.12
|
||||||
|
|
||||||
|
## 1.0.72
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5a54e4a]
|
||||||
|
- jazz-react-native@0.10.11
|
||||||
|
|
||||||
|
## 1.0.71
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3405d8f]
|
||||||
|
- jazz-react-native@0.10.10
|
||||||
|
|
||||||
|
## 1.0.70
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [2fb6428]
|
||||||
|
- jazz-tools@0.10.8
|
||||||
|
- jazz-react-native@0.10.8
|
||||||
|
|
||||||
|
## 1.0.69
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1136d9b]
|
||||||
|
- Updated dependencies [0eed228]
|
||||||
|
- jazz-react-native@0.10.7
|
||||||
|
- jazz-tools@0.10.7
|
||||||
|
|
||||||
|
## 1.0.68
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ada802b]
|
||||||
|
- jazz-tools@0.10.6
|
||||||
|
- jazz-react-native@0.10.6
|
||||||
|
|
||||||
|
## 1.0.67
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [59ff77e]
|
||||||
|
- jazz-tools@0.10.5
|
||||||
|
- jazz-react-native@0.10.5
|
||||||
|
|
||||||
|
## 1.0.66
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.10.4
|
||||||
|
- jazz-tools@0.10.4
|
||||||
|
|
||||||
|
## 1.0.65
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [d8582fc]
|
||||||
|
- jazz-tools@0.10.3
|
||||||
|
- jazz-react-native@0.10.3
|
||||||
|
|
||||||
|
## 1.0.64
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.10.2
|
||||||
|
- jazz-tools@0.10.2
|
||||||
|
|
||||||
|
## 1.0.63
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [5a63cba]
|
||||||
|
- jazz-tools@0.10.1
|
||||||
|
- jazz-react-native@0.10.1
|
||||||
|
|
||||||
|
## 1.0.62
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [498954f]
|
||||||
|
- Updated dependencies [d42c2aa]
|
||||||
|
- Updated dependencies [dd03464]
|
||||||
|
- Updated dependencies [b426342]
|
||||||
|
- jazz-react-native@0.10.0
|
||||||
|
- jazz-tools@0.10.0
|
||||||
|
|
||||||
|
## 1.0.61
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.23
|
||||||
|
- jazz-tools@0.9.23
|
||||||
|
|
||||||
|
## 1.0.60
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.22
|
||||||
|
|
||||||
|
## 1.0.59
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1be017d]
|
||||||
|
- jazz-tools@0.9.21
|
||||||
|
- jazz-react-native@0.9.21
|
||||||
|
|
||||||
|
## 1.0.58
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [b01cc1f]
|
||||||
|
- jazz-tools@0.9.20
|
||||||
|
- jazz-react-native@0.9.20
|
||||||
|
|
||||||
|
## 1.0.57
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.19
|
||||||
|
- jazz-tools@0.9.19
|
||||||
|
|
||||||
|
## 1.0.56
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.18
|
||||||
|
- jazz-tools@0.9.18
|
||||||
|
|
||||||
|
## 1.0.55
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c2ca1fe]
|
||||||
|
- Updated dependencies [1227047]
|
||||||
|
- jazz-tools@0.9.17
|
||||||
|
- jazz-react-native@0.9.17
|
||||||
|
|
||||||
|
## 1.0.54
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [24b3b6a]
|
||||||
|
- jazz-tools@0.9.16
|
||||||
|
- jazz-react-native@0.9.16
|
||||||
|
|
||||||
|
## 1.0.53
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7491711]
|
||||||
|
- jazz-tools@0.9.15
|
||||||
|
- jazz-react-native@0.9.15
|
||||||
|
|
||||||
|
## 1.0.52
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3df93cc]
|
||||||
|
- jazz-tools@0.9.14
|
||||||
|
- jazz-react-native@0.9.14
|
||||||
|
|
||||||
|
## 1.0.51
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.13
|
||||||
|
- jazz-tools@0.9.13
|
||||||
|
|
||||||
|
## 1.0.50
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.12
|
||||||
|
- jazz-tools@0.9.12
|
||||||
|
|
||||||
|
## 1.0.49
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.11
|
||||||
|
- jazz-tools@0.9.11
|
||||||
|
|
||||||
|
## 1.0.48
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [f76274c]
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react-native@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
|
## 1.0.47
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8eb9247]
|
||||||
|
- jazz-tools@0.9.9
|
||||||
|
- jazz-react-native@0.9.9
|
||||||
|
|
||||||
|
## 1.0.46
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [d1d773b]
|
||||||
|
- jazz-tools@0.9.8
|
||||||
|
- jazz-react-native@0.9.8
|
||||||
|
|
||||||
|
## 1.0.45
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8a390d2]
|
||||||
|
- jazz-react-native@0.9.6
|
||||||
|
|
||||||
|
## 1.0.44
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c871912]
|
||||||
|
- jazz-react-native@0.9.5
|
||||||
|
|
||||||
|
## 1.0.43
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.9.4
|
||||||
|
|
||||||
|
## 1.0.42
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7cd691f]
|
||||||
|
- jazz-react-native@0.9.3
|
||||||
|
|
||||||
|
## 1.0.41
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [80fd3e9]
|
||||||
|
- jazz-react-native@0.9.2
|
||||||
|
|
||||||
|
## 1.0.40
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1b71969]
|
||||||
|
- jazz-tools@0.9.1
|
||||||
|
- jazz-react-native@0.9.1
|
||||||
|
|
||||||
|
## 1.0.39
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [1da4d55]
|
||||||
|
- Updated dependencies [8eda792]
|
||||||
|
- Updated dependencies [1e5e3a1]
|
||||||
|
- jazz-react-native@0.9.0
|
||||||
|
- jazz-tools@0.9.0
|
||||||
|
|
||||||
|
## 1.0.38
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [dc62b95]
|
||||||
|
- Updated dependencies [1de26f8]
|
||||||
|
- jazz-tools@0.8.51
|
||||||
|
- jazz-react-native@0.8.51
|
||||||
|
|
||||||
|
## 1.0.37
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.50
|
||||||
|
- jazz-tools@0.8.50
|
||||||
|
|
||||||
|
## 1.0.36
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.49
|
||||||
|
- jazz-tools@0.8.49
|
||||||
|
|
||||||
|
## 1.0.35
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [635e824]
|
||||||
|
- Updated dependencies [0a85982]
|
||||||
|
- jazz-tools@0.8.48
|
||||||
|
- jazz-react-native@0.8.48
|
||||||
|
|
||||||
|
## 1.0.34
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [33ef9c4]
|
||||||
|
- jazz-react-native@0.8.47
|
||||||
|
|
||||||
|
## 1.0.33
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [ab4ffbd]
|
||||||
|
- jazz-react-native@0.8.46
|
||||||
|
|
||||||
|
## 1.0.32
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [7701307]
|
||||||
|
- Updated dependencies [fa41f8e]
|
||||||
|
- Updated dependencies [88d7d9a]
|
||||||
|
- Updated dependencies [60e35ea]
|
||||||
|
- jazz-react-native@0.8.45
|
||||||
|
- jazz-tools@0.8.45
|
||||||
|
|
||||||
|
## 1.0.31
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.44
|
||||||
|
- jazz-tools@0.8.44
|
||||||
|
|
||||||
|
## 1.0.30
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.41
|
||||||
|
- jazz-tools@0.8.41
|
||||||
|
|
||||||
|
## 1.0.29
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [0c6b0f3]
|
||||||
|
- Updated dependencies [249eecb]
|
||||||
|
- jazz-react-native@0.8.39
|
||||||
|
- jazz-tools@0.8.39
|
||||||
|
|
||||||
|
## 1.0.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.38
|
||||||
|
- jazz-tools@0.8.38
|
||||||
|
|
||||||
|
## 1.0.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.37
|
||||||
|
- jazz-tools@0.8.37
|
||||||
|
|
||||||
|
## 1.0.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c84764a]
|
||||||
|
- Updated dependencies [441fe27]
|
||||||
|
- jazz-react-native@0.8.36
|
||||||
|
- jazz-tools@0.8.36
|
||||||
|
|
||||||
|
## 1.0.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [8b87117]
|
||||||
|
- jazz-tools@0.8.35
|
||||||
|
- jazz-react-native@0.8.35
|
||||||
|
|
||||||
|
## 1.0.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.34
|
||||||
|
- jazz-tools@0.8.34
|
||||||
|
|
||||||
|
## 1.0.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [df42b2b]
|
||||||
|
- jazz-tools@0.8.32
|
||||||
|
- jazz-react-native@0.8.32
|
||||||
|
|
||||||
|
## 1.0.22
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.31
|
||||||
|
- jazz-tools@0.8.31
|
||||||
|
|
||||||
|
## 1.0.21
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.30
|
||||||
|
- jazz-tools@0.8.30
|
||||||
|
|
||||||
|
## 1.0.20
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.29
|
||||||
|
- jazz-tools@0.8.29
|
||||||
|
|
||||||
|
## 1.0.19
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.28
|
||||||
|
- jazz-tools@0.8.28
|
||||||
|
|
||||||
|
## 1.0.18
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.27
|
||||||
|
- jazz-tools@0.8.27
|
||||||
|
|
||||||
|
## 1.0.17
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [d348c2d]
|
||||||
|
- Updated dependencies [6902b5b]
|
||||||
|
- Updated dependencies [1a0cd3d]
|
||||||
|
- jazz-tools@0.8.23
|
||||||
|
- jazz-react-native@0.8.23
|
||||||
|
|
||||||
|
## 1.0.16
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [149ca97]
|
||||||
|
- jazz-tools@0.8.21
|
||||||
|
- jazz-react-native@0.8.21
|
||||||
|
|
||||||
|
## 1.0.15
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [3ef3ff3]
|
||||||
|
- jazz-react-native@0.8.20
|
||||||
|
|
||||||
|
## 1.0.14
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.19
|
||||||
|
- jazz-tools@0.8.19
|
||||||
|
|
||||||
|
## 1.0.13
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.18
|
||||||
|
- jazz-tools@0.8.18
|
||||||
|
|
||||||
|
## 1.0.12
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.17
|
||||||
|
- jazz-tools@0.8.17
|
||||||
|
|
||||||
|
## 1.0.11
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.16
|
||||||
|
- jazz-tools@0.8.16
|
||||||
|
|
||||||
|
## 1.0.10
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [cce679b]
|
||||||
|
- jazz-tools@0.8.15
|
||||||
|
- jazz-react-native@0.8.15
|
||||||
|
|
||||||
|
## 1.0.9
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [36273b3]
|
||||||
|
- jazz-tools@0.8.14
|
||||||
|
- jazz-react-native@0.8.14
|
||||||
|
|
||||||
|
## 1.0.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [fd011d7]
|
||||||
|
- jazz-tools@0.8.13
|
||||||
|
- jazz-react-native@0.8.13
|
||||||
|
|
||||||
|
## 1.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.12
|
||||||
|
- jazz-tools@0.8.12
|
||||||
|
|
||||||
|
## 1.0.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.11
|
||||||
|
- jazz-tools@0.8.11
|
||||||
|
|
||||||
|
## 1.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- b7639cf: feat(react-native): replaced react-native-mmkv with expo-secure-store and initialize it by default as kvStore in createJazzRNApp() (BREAKING)
|
||||||
|
- Updated dependencies [b7639cf]
|
||||||
|
- jazz-react-native@0.8.8
|
||||||
|
|
||||||
|
## 1.0.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [32b05b6]
|
||||||
|
- jazz-react-native@0.8.7
|
||||||
|
|
||||||
|
## 1.0.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- jazz-react-native@0.8.6
|
||||||
|
|
||||||
|
## 1.0.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [c3f4e6b]
|
||||||
|
- Updated dependencies [d9152ed]
|
||||||
|
- jazz-react-native@0.8.5
|
||||||
|
- jazz-tools@0.8.5
|
||||||
|
|
||||||
|
## 1.0.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- jazz-react-native@0.8.3
|
||||||
|
- jazz-tools@0.8.3
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
source 'https://rubygems.org'
|
|
||||||
|
|
||||||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
||||||
ruby ">= 2.6.10"
|
|
||||||
|
|
||||||
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
|
|
||||||
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
|
|
||||||
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
|
|
||||||
gem 'xcodeproj', '< 1.26.0'
|
|
||||||
gem 'concurrent-ruby', '< 1.3.4'
|
|
||||||
gem "bigdecimal", "~> 3.1"
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
GEM
|
|
||||||
remote: https://rubygems.org/
|
|
||||||
specs:
|
|
||||||
CFPropertyList (3.0.7)
|
|
||||||
base64
|
|
||||||
nkf
|
|
||||||
rexml
|
|
||||||
activesupport (6.1.7.10)
|
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
||||||
i18n (>= 1.6, < 2)
|
|
||||||
minitest (>= 5.1)
|
|
||||||
tzinfo (~> 2.0)
|
|
||||||
zeitwerk (~> 2.3)
|
|
||||||
addressable (2.8.7)
|
|
||||||
public_suffix (>= 2.0.2, < 7.0)
|
|
||||||
algoliasearch (1.27.5)
|
|
||||||
httpclient (~> 2.8, >= 2.8.3)
|
|
||||||
json (>= 1.5.1)
|
|
||||||
atomos (0.1.3)
|
|
||||||
base64 (0.2.0)
|
|
||||||
bigdecimal (3.1.9)
|
|
||||||
claide (1.1.0)
|
|
||||||
cocoapods (1.15.2)
|
|
||||||
addressable (~> 2.8)
|
|
||||||
claide (>= 1.0.2, < 2.0)
|
|
||||||
cocoapods-core (= 1.15.2)
|
|
||||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
|
||||||
cocoapods-downloader (>= 2.1, < 3.0)
|
|
||||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
|
||||||
cocoapods-search (>= 1.0.0, < 2.0)
|
|
||||||
cocoapods-trunk (>= 1.6.0, < 2.0)
|
|
||||||
cocoapods-try (>= 1.1.0, < 2.0)
|
|
||||||
colored2 (~> 3.1)
|
|
||||||
escape (~> 0.0.4)
|
|
||||||
fourflusher (>= 2.3.0, < 3.0)
|
|
||||||
gh_inspector (~> 1.0)
|
|
||||||
molinillo (~> 0.8.0)
|
|
||||||
nap (~> 1.0)
|
|
||||||
ruby-macho (>= 2.3.0, < 3.0)
|
|
||||||
xcodeproj (>= 1.23.0, < 2.0)
|
|
||||||
cocoapods-core (1.15.2)
|
|
||||||
activesupport (>= 5.0, < 8)
|
|
||||||
addressable (~> 2.8)
|
|
||||||
algoliasearch (~> 1.0)
|
|
||||||
concurrent-ruby (~> 1.1)
|
|
||||||
fuzzy_match (~> 2.0.4)
|
|
||||||
nap (~> 1.0)
|
|
||||||
netrc (~> 0.11)
|
|
||||||
public_suffix (~> 4.0)
|
|
||||||
typhoeus (~> 1.0)
|
|
||||||
cocoapods-deintegrate (1.0.5)
|
|
||||||
cocoapods-downloader (2.1)
|
|
||||||
cocoapods-plugins (1.0.0)
|
|
||||||
nap
|
|
||||||
cocoapods-search (1.0.1)
|
|
||||||
cocoapods-trunk (1.6.0)
|
|
||||||
nap (>= 0.8, < 2.0)
|
|
||||||
netrc (~> 0.11)
|
|
||||||
cocoapods-try (1.2.0)
|
|
||||||
colored2 (3.1.2)
|
|
||||||
concurrent-ruby (1.3.3)
|
|
||||||
escape (0.0.4)
|
|
||||||
ethon (0.16.0)
|
|
||||||
ffi (>= 1.15.0)
|
|
||||||
ffi (1.17.1)
|
|
||||||
fourflusher (2.3.1)
|
|
||||||
fuzzy_match (2.0.4)
|
|
||||||
gh_inspector (1.1.3)
|
|
||||||
httpclient (2.9.0)
|
|
||||||
mutex_m
|
|
||||||
i18n (1.14.7)
|
|
||||||
concurrent-ruby (~> 1.0)
|
|
||||||
json (2.7.6)
|
|
||||||
minitest (5.25.4)
|
|
||||||
molinillo (0.8.0)
|
|
||||||
mutex_m (0.3.0)
|
|
||||||
nanaimo (0.3.0)
|
|
||||||
nap (1.1.0)
|
|
||||||
netrc (0.11.0)
|
|
||||||
nkf (0.2.0)
|
|
||||||
public_suffix (4.0.7)
|
|
||||||
rexml (3.4.1)
|
|
||||||
ruby-macho (2.5.1)
|
|
||||||
typhoeus (1.4.1)
|
|
||||||
ethon (>= 0.9.0)
|
|
||||||
tzinfo (2.0.6)
|
|
||||||
concurrent-ruby (~> 1.0)
|
|
||||||
xcodeproj (1.25.1)
|
|
||||||
CFPropertyList (>= 2.3.3, < 4.0)
|
|
||||||
atomos (~> 0.1.3)
|
|
||||||
claide (>= 1.0.2, < 2.0)
|
|
||||||
colored2 (~> 3.1)
|
|
||||||
nanaimo (~> 0.3.0)
|
|
||||||
rexml (>= 3.3.6, < 4.0)
|
|
||||||
zeitwerk (2.6.18)
|
|
||||||
|
|
||||||
PLATFORMS
|
|
||||||
ruby
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
activesupport (>= 6.1.7.5, != 7.1.0)
|
|
||||||
bigdecimal (~> 3.1)
|
|
||||||
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
|
|
||||||
concurrent-ruby (< 1.3.4)
|
|
||||||
xcodeproj (< 1.26.0)
|
|
||||||
|
|
||||||
RUBY VERSION
|
|
||||||
ruby 2.6.10p210
|
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
2.3.25
|
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
# 🎷 Jazz + React Native + Demo Auth
|
# 🎷 Jazz + Expo + `react-navigation` + Demo Auth
|
||||||
|
|
||||||
## 🚀 How to Run
|
## 🚀 How to Run
|
||||||
|
|
||||||
### 1. Inside the Workspace Root
|
### 1. Inside the Workspace Root
|
||||||
|
|
||||||
First, install dependencies for the project:
|
First, install dependencies and build the project:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm i
|
pnpm i
|
||||||
|
pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Inside the `examples/chat-rn` Directory
|
### 2. Inside the `examples/chat-rn` Directory
|
||||||
@@ -15,18 +16,9 @@ pnpm i
|
|||||||
Next, navigate to the specific example project and run the following commands:
|
Next, navigate to the specific example project and run the following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm pods
|
pnpm expo prebuild
|
||||||
pnpm ios
|
npx pod-install
|
||||||
|
pnpm expo run:ios
|
||||||
```
|
```
|
||||||
|
|
||||||
This will set up and launch the app on iOS. For Android, you can skip `pnpm pods` and replace the last command with `pnpm android`.
|
This will set up and launch the app on iOS. For Android, you can replace the last command with `pnpm expo run:android`.
|
||||||
|
|
||||||
## Creation
|
|
||||||
|
|
||||||
This was created using the following command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pnpx @react-native-community/cli init chat-rn --version 0.76.7 --install-pods true --skip-git-init true --package-name com.chatrn --directory chat-rn
|
|
||||||
```
|
|
||||||
|
|
||||||
Then change package name in `package.json`, and begin build instructions above.
|
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
apply plugin: "com.android.application"
|
|
||||||
apply plugin: "org.jetbrains.kotlin.android"
|
|
||||||
apply plugin: "com.facebook.react"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the configuration block to customize your React Native Android app.
|
|
||||||
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
||||||
*/
|
|
||||||
react {
|
|
||||||
/* Folders */
|
|
||||||
// The root of your project, i.e. where "package.json" lives. Default is '../..'
|
|
||||||
// root = file("../../")
|
|
||||||
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
|
|
||||||
// reactNativeDir = file("../../node_modules/react-native")
|
|
||||||
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
|
|
||||||
// codegenDir = file("../../node_modules/@react-native/codegen")
|
|
||||||
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
|
|
||||||
// cliFile = file("../../node_modules/react-native/cli.js")
|
|
||||||
|
|
||||||
/* Variants */
|
|
||||||
// The list of variants to that are debuggable. For those we're going to
|
|
||||||
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
|
|
||||||
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
|
|
||||||
// debuggableVariants = ["liteDebug", "prodDebug"]
|
|
||||||
|
|
||||||
/* Bundling */
|
|
||||||
// A list containing the node command and its flags. Default is just 'node'.
|
|
||||||
// nodeExecutableAndArgs = ["node"]
|
|
||||||
//
|
|
||||||
// The command to run when bundling. By default is 'bundle'
|
|
||||||
// bundleCommand = "ram-bundle"
|
|
||||||
//
|
|
||||||
// The path to the CLI configuration file. Default is empty.
|
|
||||||
// bundleConfig = file(../rn-cli.config.js)
|
|
||||||
//
|
|
||||||
// The name of the generated asset file containing your JS bundle
|
|
||||||
// bundleAssetName = "MyApplication.android.bundle"
|
|
||||||
//
|
|
||||||
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
|
|
||||||
// entryFile = file("../js/MyApplication.android.js")
|
|
||||||
//
|
|
||||||
// A list of extra flags to pass to the 'bundle' commands.
|
|
||||||
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
|
|
||||||
// extraPackagerArgs = []
|
|
||||||
|
|
||||||
/* Hermes Commands */
|
|
||||||
// The hermes compiler command to run. By default it is 'hermesc'
|
|
||||||
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
|
|
||||||
//
|
|
||||||
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
||||||
// hermesFlags = ["-O", "-output-source-map"]
|
|
||||||
|
|
||||||
/* Autolinking */
|
|
||||||
autolinkLibrariesWithApp()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
||||||
*/
|
|
||||||
def enableProguardInReleaseBuilds = false
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The preferred build flavor of JavaScriptCore (JSC)
|
|
||||||
*
|
|
||||||
* For example, to use the international variant, you can use:
|
|
||||||
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
||||||
*
|
|
||||||
* The international variant includes ICU i18n library and necessary data
|
|
||||||
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
||||||
* give correct results when using with locales other than en-US. Note that
|
|
||||||
* this variant is about 6MiB larger per architecture than default.
|
|
||||||
*/
|
|
||||||
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
||||||
|
|
||||||
android {
|
|
||||||
ndkVersion rootProject.ext.ndkVersion
|
|
||||||
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
||||||
compileSdk rootProject.ext.compileSdkVersion
|
|
||||||
|
|
||||||
namespace "com.chatrn"
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "com.chatrn"
|
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
}
|
|
||||||
signingConfigs {
|
|
||||||
debug {
|
|
||||||
storeFile file('debug.keystore')
|
|
||||||
storePassword 'android'
|
|
||||||
keyAlias 'androiddebugkey'
|
|
||||||
keyPassword 'android'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buildTypes {
|
|
||||||
debug {
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
}
|
|
||||||
release {
|
|
||||||
// Caution! In production, you need to generate your own keystore file.
|
|
||||||
// see https://reactnative.dev/docs/signed-apk-android.
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// The version of react-native is set by the React Native Gradle Plugin
|
|
||||||
implementation("com.facebook.react:react-android")
|
|
||||||
|
|
||||||
if (hermesEnabled.toBoolean()) {
|
|
||||||
implementation("com.facebook.react:hermes-android")
|
|
||||||
} else {
|
|
||||||
implementation jscFlavor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
10
examples/chat-rn/android/app/proguard-rules.pro
vendored
@@ -1,10 +0,0 @@
|
|||||||
# Add project specific ProGuard rules here.
|
|
||||||
# By default, the flags in this file are appended to flags specified
|
|
||||||
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
||||||
# You can edit the include path and order by changing the proguardFiles
|
|
||||||
# directive in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# Add any project specific keep options here:
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:usesCleartextTraffic="true"
|
|
||||||
tools:targetApi="28"
|
|
||||||
tools:ignore="GoogleAppIndexingWarning"/>
|
|
||||||
</manifest>
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:name=".MainApplication"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
|
||||||
android:allowBackup="false"
|
|
||||||
android:theme="@style/AppTheme"
|
|
||||||
android:supportsRtl="true">
|
|
||||||
<activity
|
|
||||||
android:name=".MainActivity"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:windowSoftInputMode="adjustResize"
|
|
||||||
android:exported="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
</manifest>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package com.chatrn
|
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity
|
|
||||||
import com.facebook.react.ReactActivityDelegate
|
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
||||||
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
||||||
|
|
||||||
class MainActivity : ReactActivity() {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
||||||
* rendering of the component.
|
|
||||||
*/
|
|
||||||
override fun getMainComponentName(): String = "ChatRN"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
||||||
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
||||||
*/
|
|
||||||
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
|
||||||
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package com.chatrn
|
|
||||||
|
|
||||||
import android.app.Application
|
|
||||||
import com.facebook.react.PackageList
|
|
||||||
import com.facebook.react.ReactApplication
|
|
||||||
import com.facebook.react.ReactHost
|
|
||||||
import com.facebook.react.ReactNativeHost
|
|
||||||
import com.facebook.react.ReactPackage
|
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
|
||||||
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
|
||||||
import com.facebook.react.defaults.DefaultReactNativeHost
|
|
||||||
import com.facebook.react.soloader.OpenSourceMergedSoMapping
|
|
||||||
import com.facebook.soloader.SoLoader
|
|
||||||
|
|
||||||
class MainApplication : Application(), ReactApplication {
|
|
||||||
|
|
||||||
override val reactNativeHost: ReactNativeHost =
|
|
||||||
object : DefaultReactNativeHost(this) {
|
|
||||||
override fun getPackages(): List<ReactPackage> =
|
|
||||||
PackageList(this).packages.apply {
|
|
||||||
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
||||||
// add(MyReactNativePackage())
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getJSMainModuleName(): String = "index"
|
|
||||||
|
|
||||||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
|
||||||
|
|
||||||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
||||||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
|
||||||
}
|
|
||||||
|
|
||||||
override val reactHost: ReactHost
|
|
||||||
get() = getDefaultReactHost(applicationContext, reactNativeHost)
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
super.onCreate()
|
|
||||||
SoLoader.init(this, OpenSourceMergedSoMapping)
|
|
||||||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
||||||
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
||||||
load()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2014 The Android Open Source Project
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
|
|
||||||
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
|
|
||||||
android:insetTop="@dimen/abc_edit_text_inset_top_material"
|
|
||||||
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
|
|
||||||
>
|
|
||||||
|
|
||||||
<selector>
|
|
||||||
<!--
|
|
||||||
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
|
|
||||||
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
|
|
||||||
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
|
|
||||||
|
|
||||||
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
|
||||||
|
|
||||||
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
|
|
||||||
-->
|
|
||||||
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
|
||||||
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
|
|
||||||
</selector>
|
|
||||||
|
|
||||||
</inset>
|
|
||||||
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">ChatRN</string>
|
|
||||||
</resources>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<resources>
|
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
buildscript {
|
|
||||||
ext {
|
|
||||||
buildToolsVersion = "35.0.0"
|
|
||||||
minSdkVersion = 24
|
|
||||||
compileSdkVersion = 35
|
|
||||||
targetSdkVersion = 34
|
|
||||||
ndkVersion = "26.1.10909125"
|
|
||||||
kotlinVersion = "1.9.25"
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath("com.android.tools.build:gradle")
|
|
||||||
classpath("com.facebook.react:react-native-gradle-plugin")
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: "com.facebook.react.rootproject"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
# Project-wide Gradle settings.
|
|
||||||
|
|
||||||
# IDE (e.g. Android Studio) users:
|
|
||||||
# Gradle settings configured through the IDE *will override*
|
|
||||||
# any settings specified in this file.
|
|
||||||
|
|
||||||
# For more details on how to configure your build environment visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
||||||
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
|
||||||
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
|
|
||||||
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
|
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
||||||
# org.gradle.parallel=true
|
|
||||||
|
|
||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
||||||
# Android operating system, and which are packaged with your app's APK
|
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
||||||
android.useAndroidX=true
|
|
||||||
|
|
||||||
# Use this property to specify which architecture you want to build.
|
|
||||||
# You can also override it from the CLI using
|
|
||||||
# ./gradlew <task> -PreactNativeArchitectures=x86_64
|
|
||||||
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
|
||||||
|
|
||||||
# Use this property to enable support to the new architecture.
|
|
||||||
# This will allow you to use TurboModules and the Fabric render in
|
|
||||||
# your application. You should enable this flag either if you want
|
|
||||||
# to write custom TurboModules/Fabric components OR use libraries that
|
|
||||||
# are providing them.
|
|
||||||
newArchEnabled=true
|
|
||||||
|
|
||||||
# Use this property to enable or disable the Hermes JS engine.
|
|
||||||
# If set to false, you will be using JSC instead.
|
|
||||||
hermesEnabled=true
|
|
||||||