diff --git a/.gitignore b/.gitignore
index c131846..e881539 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,7 @@ ios/.xcode.env.local
# Android/IntelliJ
#
+android/
build/
.idea
.gradle
diff --git a/App.tsx b/App.tsx
index a6c4a21..c315dbf 100644
--- a/App.tsx
+++ b/App.tsx
@@ -1,11 +1,14 @@
import 'react-native-gesture-handler';
// ^ le bouge pas ca casse tout ^
+import { AppRegistry, Platform } from 'react-native'
+
+
import { useState } from "react";
import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Provider } from 'react-redux';
-import { store } from './src/redux/store';
-import { MD3DarkTheme, MD3LightTheme, PaperProvider, Portal } from 'react-native-paper';
+import { store,persistor } from './src/redux/store';
+import { PaperProvider } from 'react-native-paper';
import { ToastProvider } from 'react-native-toast-notifications'
import AuthPage from './src/pages/Auth';
import ClipPage from './src/pages/Clips';
@@ -15,11 +18,11 @@ import { Material3Dracula, ReactNavigationDracula } from './src/themes';
import { PixelRatio, useWindowDimensions } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
const Stack = createNativeStackNavigator();
-
+import { PersistGate } from 'redux-persist/integration/react';
function App(){
- const [token,setToken] = useState("");
+ const [token,setToken] = useState(store.getState().user.token);
const [username,setUsername] = useState("");
const {height,width} = useWindowDimensions();
@@ -30,11 +33,12 @@ function App(){
let newToken = store.getState().user.token;
setToken(newToken);
})
-
+
return (
+
@@ -54,6 +58,7 @@ function App(){
+
diff --git a/app.json b/app.json
index c10b0dd..0fd01a3 100644
--- a/app.json
+++ b/app.json
@@ -21,7 +21,8 @@
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
- }
+ },
+ "package": "fr.simailadjalim.ClipSync"
},
"web": {
"favicon": "./assets/favicon.png"
diff --git a/bun.lockb b/bun.lockb
index c94b7ab..37b0f50 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 1d6bcc4..10798e9 100644
--- a/package.json
+++ b/package.json
@@ -4,8 +4,8 @@
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
- "android": "expo start --android",
- "ios": "expo start --ios",
+ "android": "expo run:android",
+ "ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
@@ -22,9 +22,11 @@
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.6",
+ "react-native-android-notification-listener": "^5.0.1",
"react-native-async-storage": "^0.0.1",
"react-native-drawer-layout": "^3.3.0",
"react-native-gesture-handler": "~2.14.0",
+ "react-native-pager-view": "^6.3.0",
"react-native-paper": "^5.12.3",
"react-native-reanimated": "~3.6.2",
"react-native-safe-area-context": "^4.9.0",
@@ -38,6 +40,7 @@
"react-redux": "^9.1.0",
"redux": "^5.0.1",
"redux-persist": "^6.0.0",
+ "redux-persist-expo-filesystem": "^2.0.1",
"redux-thunk": "^3.1.0"
},
"devDependencies": {
diff --git a/src/components/clip/ClipElementLocal.tsx b/src/components/clip/ClipElementLocal.tsx
index a9fe410..b16af74 100644
--- a/src/components/clip/ClipElementLocal.tsx
+++ b/src/components/clip/ClipElementLocal.tsx
@@ -8,7 +8,7 @@ import { store } from '../../redux/store';
import { Button } from 'react-native-paper';
export default function ClipElementLocal({content}:{content: string}){
-
+
const toast = useToast();
function onCopy() {
Clipboard.setStringAsync(content)
diff --git a/src/components/clip/ClipList.tsx b/src/components/clip/ClipList.tsx
index 0af4df6..a687630 100644
--- a/src/components/clip/ClipList.tsx
+++ b/src/components/clip/ClipList.tsx
@@ -1,46 +1,31 @@
import React from 'react';
-import {ScrollView} from 'react-native';
+import {FlatList, ScrollView} from 'react-native';
import ClipElementLocal from './ClipElementLocal';
import ClipElementRemote from './ClipElementRemote';
+import { nanoid } from '@reduxjs/toolkit';
export default class ClipList extends React.Component {
constructor(props: any) {
super(props);
}
- createClipElementLocal(content: string): JSX.Element {
- return ;
- }
-
- createClipElementRemote(
- content: string,
- deviceName: string,
- timestamp: number,
- ): JSX.Element {
- return (
-
- );
- }
-
render(): JSX.Element {
- let clips;
if (this.props.type === 'local') {
- clips = this.props.clips.map((entry: any) =>
- this.createClipElementLocal(entry.content),
- );
+ return }
+ keyExtractor={item => nanoid()}
+ inverted={true}
+ />
} else {
- clips = this.props.clips.map((entry: any) =>
- this.createClipElementRemote(
- entry.content,
- entry.device_name,
- entry.timestamp,
- ),
- );
+ return }
+ keyExtractor={item => nanoid()}
+ inverted={true}
+ />
+ ;
}
- return {clips};
+
}
}
diff --git a/src/components/clip/ClipView.tsx b/src/components/clip/ClipView.tsx
index 4074683..66768bc 100644
--- a/src/components/clip/ClipView.tsx
+++ b/src/components/clip/ClipView.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { useWindowDimensions, ScrollView } from "react-native";
-import { Searchbar } from "react-native-paper"
+import { useWindowDimensions, ScrollView, View } from "react-native";
+import { Searchbar, Button } from "react-native-paper"
import ClipViewLocal from "./ClipViewLocal";
import ClipViewRemote from "./ClipViewRemote";
import { ps } from "../../utils";
@@ -18,12 +18,19 @@ export default function ClipView(){
else if (width < 1200 ) layout = "medium";
else layout = "expanded";
return ( <>
-
-
+ {layout == "compact" ?
+