diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..8acbeaf --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,53 @@ +name: Building APK +run-name: Build APK +on: [push] +jobs: + build-apk: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: '17' + + - name: Setup NodeJS + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Setup bun + uses: oven-sh/setup-bun@v1 + + - name: Install dependencies + run: bun install + + - name: Setup EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} + packager: bun + + - name: Build Website + run: bunx expo export --platform web + + - name: Upload disk ZIP + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + + - name: Create SSH key + run: | + install -m 600 -D /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts + + - uses: GuillaumeFalourd/setup-rsync@v1.2 + + - name: Deploy with rsync + run: rsync -rav --delete dist/ www-data@simailadjalim.fr:/var/www/clipsync-webapp diff --git a/src/components/clip/ClipView.tsx b/src/components/clip/ClipView.tsx index 4ede6fe..3d5ec5b 100644 --- a/src/components/clip/ClipView.tsx +++ b/src/components/clip/ClipView.tsx @@ -48,11 +48,11 @@ export default function ClipView() { {layout == 'compact' ? ( - - {() => } - {() => } + + + {() => } ) : ( @@ -63,8 +63,8 @@ export default function ClipView() { height: '100%', padding: ps(30), }}> - + )} diff --git a/src/components/clip/ClipViewLocal.tsx b/src/components/clip/ClipViewLocal.tsx index c10590c..e50074d 100644 --- a/src/components/clip/ClipViewLocal.tsx +++ b/src/components/clip/ClipViewLocal.tsx @@ -45,7 +45,7 @@ export default function ClipViewLocal({}) { onPress={() => { dispatch(addToLocal); }}> - Coller depuis le presse papier + Paste from clipboard diff --git a/src/components/clip/ClipViewRemote.tsx b/src/components/clip/ClipViewRemote.tsx index 66cc7b3..9e9a0d4 100644 --- a/src/components/clip/ClipViewRemote.tsx +++ b/src/components/clip/ClipViewRemote.tsx @@ -21,7 +21,7 @@ export default function ClipViewRemote() { async function getClips(dispatch) { axios .get( - 'http://notifysync.simailadjalim.fr/clipboard?token=' + + 'https://notifysync.simailadjalim.fr/clipboard?token=' + store.getState().user.token, ) .then((response, status) => { @@ -31,7 +31,6 @@ export default function ClipViewRemote() { toast.show('fetched latest clips from remote'); }) .catch(response => { - toast.show(JSON.stringify(response)); toast.show('failed to fetch latest clips'); }); } diff --git a/src/components/notif/NotifView.tsx b/src/components/notif/NotifView.tsx index bff2998..036c272 100644 --- a/src/components/notif/NotifView.tsx +++ b/src/components/notif/NotifView.tsx @@ -48,12 +48,12 @@ export default function NotifView() { {layout == 'compact' ? ( - - {() => } - {() => } + + {() => } + ) : ( - + )} diff --git a/src/components/notif/NotifViewLocal.tsx b/src/components/notif/NotifViewLocal.tsx index 2e68b61..507a826 100644 --- a/src/components/notif/NotifViewLocal.tsx +++ b/src/components/notif/NotifViewLocal.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {ScrollView, View, Text, useWindowDimensions} from 'react-native'; +import {View, Text, useWindowDimensions, Platform} from 'react-native'; import {Button} from 'react-native-paper'; import NotifList from './NotifList'; import {useDispatch} from 'react-redux'; @@ -8,6 +8,7 @@ import {useToast} from 'react-native-toast-notifications'; import * as Clipboard from 'expo-clipboard'; import {ps} from '../../utils'; import {store} from '../../redux/store'; +import { ReactNavigationDracula } from '../../themes'; export default function NotifViewLocal({}) { const [notifs, setNotifs] = React.useState( @@ -43,6 +44,21 @@ export default function NotifViewLocal({}) { }); } + if (Platform.OS != "android"){ + return ( + 600 ? ps(10) : 0, + }}/> + + ) + } + return ( { - console.log('TODO'); dispatch(addToLocal); }}> - importer la derniere notification + Import last notification - + - + ); } diff --git a/src/components/notif/NotifViewRemote.tsx b/src/components/notif/NotifViewRemote.tsx index 224e847..f8c57fe 100644 --- a/src/components/notif/NotifViewRemote.tsx +++ b/src/components/notif/NotifViewRemote.tsx @@ -22,7 +22,7 @@ export default function NotifViewRemote() { async function getNotif(dispatch) { axios .get( - 'http://notifysync.simailadjalim.fr/notification?token=' + + 'https://notifysync.simailadjalim.fr/notification?token=' + store.getState().user.token, ) .then((response, status) => { @@ -32,7 +32,6 @@ export default function NotifViewRemote() { toast.show('fetched latest notifications from remote'); }) .catch(response => { - toast.show(JSON.stringify(response)); toast.show('failed to fetch latest notifications'); }); } diff --git a/src/redux/reducers.tsx b/src/redux/reducers.tsx index a428676..9899159 100644 --- a/src/redux/reducers.tsx +++ b/src/redux/reducers.tsx @@ -39,7 +39,7 @@ export const localClipsSlice = createSlice({ localClipRemoveFromList: (state, action) => { state.localClip = state.localClip.filter(e => e !== action.payload); }, - localClipClear: (state, action) => { + localClipClear: state => { state.localClip = []; }, }, @@ -66,7 +66,7 @@ export const remoteClipsSlice = createSlice({ remoteClipRemoveFromList: (state, action) => { state.remoteClip = state.remoteClip.filter(e => e !== action.payload); }, - remoteClipClear: (state, action) => { + remoteClipClear: state => { state.remoteClip = []; }, }, @@ -87,7 +87,7 @@ export const localNotifsSlice = createSlice({ localNotifRemoveFromList: (state, action) => { state.localNotif = state.localNotif.filter(e => e !== action.payload); }, - localNotifClear: (state, action) => { + localNotifClear: state => { state.localNotif = []; }, }, @@ -108,7 +108,7 @@ export const remoteNotifsSlice = createSlice({ remoteNotifRemoveFromList: (state, action) => { state.remoteNotif = state.remoteNotif.filter(e => e !== action.payload); }, - remoteNotifClear: (state, action) => { + remoteNotifClear: state => { state.remoteNotif = []; }, },