mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
feat(resources/server): move some functions to 'misc'
This commit is contained in:
1 parent
4029e8c7a1
commit
b033eae51e
7 files changed
+65
-21
No files matched your search
@@ -0,0 +1,50 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { photoState } from './state';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useNuiCallback } from 'fivem-nui-react-lib';
|
||||
import { GalleryPhoto, PhotoEvents } from '../../../../../typings/photo';
|
||||
import { usePhotoService } from './usePhotoService';
|
||||
|
||||
/*
|
||||
export const usePhotoActions = () => {
|
||||
const { t } = useTranslation();
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
const [photos, setPhotos] = usePhotoService();
|
||||
const [isUploading, setUploading] = useState(false);
|
||||
|
||||
const onPhotoSuccess = useCallback((photo) => {
|
||||
setUploading(false);
|
||||
if (!photo?.image) return;
|
||||
setPhotos((curr) => [photo, ...curr]);
|
||||
}, [setPhotos])
|
||||
|
||||
const onPhotoError = useCallback(
|
||||
(i18nKey) => {
|
||||
setUploading(false);
|
||||
addAlert({ type: 'error', message: t(i18nKey) });
|
||||
},
|
||||
[addAlert, t],
|
||||
);
|
||||
|
||||
const [_takePhoto] = useNuiCallback<void, GalleryPhoto>(
|
||||
'CAMERA',
|
||||
PhotoEvents.TAKE_PHOTO,
|
||||
onPhotoSuccess,
|
||||
onPhotoError,
|
||||
);
|
||||
|
||||
const takePhoto = () => {
|
||||
_takePhoto(undefined, { timeout: 60000 });
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
photos,
|
||||
setPhotos,
|
||||
takePhoto,
|
||||
isLoading: isUploading
|
||||
}
|
||||
|
||||
}*/
|
||||
+3
-9
@@ -1,11 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
@@ -18,12 +14,10 @@
|
||||
"isolatedModules": true,
|
||||
"noImplicitAny": false,
|
||||
"noEmit": true,
|
||||
"jsx": "react",
|
||||
"jsx": "react-jsx",
|
||||
"strictNullChecks": false,
|
||||
"sourceMap": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in new issue
Block a user