mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
tweak(config): Config var & send as event method
config -> ResourceConfig for readability and the resource config in NUI is now being referenced consistently from state so it can be referenced at runtime and not compile time. Also removes the need to copy the config before using `cp`
This commit is contained in:
1 parent
8ce6ec7559
commit
dd3eac4a0e
18 files changed
+66
-89
No files matched your search
+8
-1
@@ -32,10 +32,12 @@ import { usePhone } from './os/phone/hooks/usePhone';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useSnackbar } from './ui/hooks/useSnackbar';
|
import { useSnackbar } from './ui/hooks/useSnackbar';
|
||||||
import { PhoneEvents } from '../../typings/phone';
|
import { PhoneEvents } from '../../typings/phone';
|
||||||
import dayjs from 'dayjs';
|
|
||||||
import { isDefaultWallpaper } from './apps/settings/utils/isDefaultWallpaper';
|
import { isDefaultWallpaper } from './apps/settings/utils/isDefaultWallpaper';
|
||||||
import { useKeyboardService } from './os/keyboard/hooks/useKeyboardService';
|
import { useKeyboardService } from './os/keyboard/hooks/useKeyboardService';
|
||||||
|
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import DefaultConfig from '../../config.json';
|
||||||
|
|
||||||
function Phone() {
|
function Phone() {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
|
|
||||||
@@ -168,4 +170,9 @@ InjectDebugData<any>([
|
|||||||
method: PhoneEvents.SET_TIME,
|
method: PhoneEvents.SET_TIME,
|
||||||
data: dayjs().format('hh:mm'),
|
data: dayjs().format('hh:mm'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
app: 'PHONE',
|
||||||
|
method: PhoneEvents.SET_CONFIG,
|
||||||
|
data: DefaultConfig,
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
@@ -42,8 +42,8 @@ export function ProfileForm({ profile, showPreview }: IProps) {
|
|||||||
const Nui = useNuiRequest();
|
const Nui = useNuiRequest();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
// note that this assumes we are defensively checking
|
// note that this assumes we are defensively checking
|
||||||
// that profile is not null in a parent above this component.
|
// that profile is not null in a parent above this component.
|
||||||
// Annoyingling adding conditionals above this line to not render
|
// Annoyingling adding conditionals above this line to not render
|
||||||
@@ -77,7 +77,7 @@ export function ProfileForm({ profile, showPreview }: IProps) {
|
|||||||
Nui.send(event, updatedProfile);
|
Nui.send(event, updatedProfile);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!profile && !config.match.allowEdtiableProfileName) {
|
if (!profile && !ResourceConfig.match.allowEditableProfileName) {
|
||||||
return <PageText text={t('APPS_MATCH_PROFILE_CONFIGURATION')} />;
|
return <PageText text={t('APPS_MATCH_PROFILE_CONFIGURATION')} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ export function ProfileForm({ profile, showPreview }: IProps) {
|
|||||||
label={t('APPS_MATCH_EDIT_PROFILE_NAME')}
|
label={t('APPS_MATCH_EDIT_PROFILE_NAME')}
|
||||||
value={name}
|
value={name}
|
||||||
handleChange={setName}
|
handleChange={setName}
|
||||||
allowChange={config.match.allowEdtiableProfileName}
|
allowChange={ResourceConfig.match.allowEditableProfileName}
|
||||||
/>
|
/>
|
||||||
<ProfileField
|
<ProfileField
|
||||||
label={t('APPS_MATCH_EDIT_PROFILE_BIO')}
|
label={t('APPS_MATCH_EDIT_PROFILE_BIO')}
|
||||||
|
|||||||
@@ -53,14 +53,14 @@ export const AddTweetModal = () => {
|
|||||||
const Nui = useNuiRequest();
|
const Nui = useNuiRequest();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { message, setMessage, modalVisible, setModalVisible } = useModal();
|
const { message, setMessage, modalVisible, setModalVisible } = useModal();
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
const [showEmoji, setShowEmoji] = useState(false);
|
const [showEmoji, setShowEmoji] = useState(false);
|
||||||
const [showImagePrompt, setShowImagePrompt] = useState(false);
|
const [showImagePrompt, setShowImagePrompt] = useState(false);
|
||||||
const [link, setLink] = useState('');
|
const [link, setLink] = useState('');
|
||||||
|
|
||||||
const [images, setImages] = useState<Image[]>([]);
|
const [images, setImages] = useState<Image[]>([]);
|
||||||
const { characterLimit, newLineLimit } = config.twitter;
|
const { characterLimit, newLineLimit } = ResourceConfig.twitter;
|
||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
setShowImagePrompt(false);
|
setShowImagePrompt(false);
|
||||||
@@ -93,7 +93,7 @@ export const AddTweetModal = () => {
|
|||||||
window.addEventListener('keydown', _handleEscape, true);
|
window.addEventListener('keydown', _handleEscape, true);
|
||||||
return () => window.removeEventListener('keydown', _handleEscape);
|
return () => window.removeEventListener('keydown', _handleEscape);
|
||||||
});
|
});
|
||||||
if (!config) return null;
|
if (!ResourceConfig) return null;
|
||||||
|
|
||||||
const isValidMessage = (message) => {
|
const isValidMessage = (message) => {
|
||||||
if (message.length > characterLimit) return false;
|
if (message.length > characterLimit) return false;
|
||||||
@@ -154,7 +154,7 @@ export const AddTweetModal = () => {
|
|||||||
setMessage(message.concat(emojiObject.native));
|
setMessage(message.concat(emojiObject.native));
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!config) return null;
|
if (!ResourceConfig) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal visible={modalVisible} handleClose={_handleClose}>
|
<Modal visible={modalVisible} handleClose={_handleClose}>
|
||||||
@@ -172,7 +172,9 @@ export const AddTweetModal = () => {
|
|||||||
/>
|
/>
|
||||||
<div className={classes.buttonsContainer}>
|
<div className={classes.buttonsContainer}>
|
||||||
<IconButtons
|
<IconButtons
|
||||||
onImageClick={images.length < config.twitter.maxImages ? toggleShowImagePrompt : null}
|
onImageClick={
|
||||||
|
images.length < ResourceConfig.twitter.maxImages ? toggleShowImagePrompt : null
|
||||||
|
}
|
||||||
onEmojiClick={toggleShowEmoji}
|
onEmojiClick={toggleShowEmoji}
|
||||||
/>
|
/>
|
||||||
<ControlButtons
|
<ControlButtons
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ const useStyles = makeStyles({
|
|||||||
function Avatar({ avatarUrl, showInvalidImage, height, width }) {
|
function Avatar({ avatarUrl, showInvalidImage, height, width }) {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const [showImageError, setShowImageError] = useState(false);
|
const [showImageError, setShowImageError] = useState(false);
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
const handleImageError = () => setShowImageError(true);
|
const handleImageError = () => setShowImageError(true);
|
||||||
const handleImageLoad = () => setShowImageError(false);
|
const handleImageLoad = () => setShowImageError(false);
|
||||||
|
|
||||||
if (!config || !config.twitter.enableAvatars) return null;
|
if (!ResourceConfig || !ResourceConfig.twitter.enableAvatars) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ const useStyles = makeStyles({
|
|||||||
|
|
||||||
export const IconButtons = ({ onImageClick, onEmojiClick }) => {
|
export const IconButtons = ({ onImageClick, onEmojiClick }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
if (!config) return null;
|
if (!ResourceConfig) return null;
|
||||||
const { enableImages, enableEmojis } = config.twitter;
|
const { enableImages, enableEmojis } = ResourceConfig.twitter;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.buttons}>
|
<div className={classes.buttons}>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export function Profile() {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { profile } = useProfile();
|
const { profile } = useProfile();
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
// note that this assumes we are defensively checking
|
// note that this assumes we are defensively checking
|
||||||
// that profile is not null in a parent above this component.
|
// that profile is not null in a parent above this component.
|
||||||
@@ -51,9 +51,9 @@ export function Profile() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// fetching the config is an asynchronous call so defend against it
|
// fetching the config is an asynchronous call so defend against it
|
||||||
if (!config) return null;
|
if (!ResourceConfig) return null;
|
||||||
|
|
||||||
const { enableAvatars, allowEdtiableProfileName } = config.twitter;
|
const { enableAvatars, allowEditableProfileName } = ResourceConfig.twitter;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
@@ -69,7 +69,7 @@ export function Profile() {
|
|||||||
label={t('APPS_TWITTER_EDIT_PROFILE_NAME')}
|
label={t('APPS_TWITTER_EDIT_PROFILE_NAME')}
|
||||||
value={name}
|
value={name}
|
||||||
handleChange={handleNameChange}
|
handleChange={handleNameChange}
|
||||||
allowChange={allowEdtiableProfileName}
|
allowChange={allowEditableProfileName}
|
||||||
/>
|
/>
|
||||||
<ProfileField
|
<ProfileField
|
||||||
label={t('APPS_TWITTER_EDIT_PROFILE_BIO')}
|
label={t('APPS_TWITTER_EDIT_PROFILE_BIO')}
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ export function ProfilePrompt() {
|
|||||||
const { profile } = useProfile();
|
const { profile } = useProfile();
|
||||||
const defaultProfileNames = useRecoilValue(twitterState.defaultProfileNames);
|
const defaultProfileNames = useRecoilValue(twitterState.defaultProfileNames);
|
||||||
const [profileName, setProfileName] = useState(profile?.profile_name || '');
|
const [profileName, setProfileName] = useState(profile?.profile_name || '');
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
const showDefaultProfileNames = !config.twitter.allowEdtiableProfileName && !profile;
|
const showDefaultProfileNames = !ResourceConfig.twitter.allowEditableProfileName && !profile;
|
||||||
const eventName = showDefaultProfileNames
|
const eventName = showDefaultProfileNames
|
||||||
? TwitterEvents.CREATE_PROFILE
|
? TwitterEvents.CREATE_PROFILE
|
||||||
: TwitterEvents.UPDATE_PROFILE;
|
: TwitterEvents.UPDATE_PROFILE;
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
|||||||
const Nui = useNuiRequest();
|
const Nui = useNuiRequest();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [anchorEl, setAnchorEl] = useState<Element | null>(null);
|
const [anchorEl, setAnchorEl] = useState<Element | null>(null);
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
if (!config) return null;
|
if (!ResourceConfig) return null;
|
||||||
|
|
||||||
const handleClick = (event: React.MouseEvent) => {
|
const handleClick = (event: React.MouseEvent) => {
|
||||||
const element = event.currentTarget;
|
const element = event.currentTarget;
|
||||||
@@ -29,8 +29,8 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
|||||||
handleClose();
|
handleClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
const allowedToDelete = config.twitter.allowDeleteTweets && isMine;
|
const allowedToDelete = ResourceConfig.twitter.allowDeleteTweets && isMine;
|
||||||
const allowedToReport = config.twitter.allowReportTweets && !isMine;
|
const allowedToReport = ResourceConfig.twitter.allowReportTweets && !isMine;
|
||||||
|
|
||||||
// if the user cannot perform any actions in show more then don't
|
// if the user cannot perform any actions in show more then don't
|
||||||
// allow them to interact with it
|
// allow them to interact with it
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ export const Tweet = (tweet: ITweet) => {
|
|||||||
} = tweet;
|
} = tweet;
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
if (!config) return null;
|
if (!ResourceConfig) return null;
|
||||||
const { enableAvatars, enableImages } = config.twitter;
|
const { enableAvatars, enableImages } = ResourceConfig.twitter;
|
||||||
|
|
||||||
// this is a workaround to transfer string new lines and returns that
|
// this is a workaround to transfer string new lines and returns that
|
||||||
// are stored into the database into html for the UI to render
|
// are stored into the database into html for the UI to render
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ export const TweetMessage = ({ modalVisible, message, handleChange }) => {
|
|||||||
const textFieldRef = useRef(null);
|
const textFieldRef = useRef(null);
|
||||||
const textFieldInputRef = useRef(null);
|
const textFieldInputRef = useRef(null);
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { characterLimit, newLineLimit } = config.twitter;
|
const { characterLimit, newLineLimit } = ResourceConfig.twitter;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
textFieldInputRef.current && textFieldInputRef.current.focus();
|
textFieldInputRef.current && textFieldInputRef.current.focus();
|
||||||
@@ -46,7 +46,7 @@ export const TweetMessage = ({ modalVisible, message, handleChange }) => {
|
|||||||
[handleChange],
|
[handleChange],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!config) return null;
|
if (!ResourceConfig) return null;
|
||||||
|
|
||||||
let errorMessage = null;
|
let errorMessage = null;
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"Locale": "en",
|
|
||||||
"KeyTogglePhone": 288,
|
|
||||||
"KeyTakeCall": 38,
|
|
||||||
"PhoneAsItem": false,
|
|
||||||
"SwimDestroy": false,
|
|
||||||
"RunRate": 10,
|
|
||||||
"DestoryChance": 100,
|
|
||||||
"DestroyPhoneReCheck": 3,
|
|
||||||
"notificationPosition": {
|
|
||||||
"horizontal": "right",
|
|
||||||
"vertical": "top"
|
|
||||||
},
|
|
||||||
"general": {
|
|
||||||
"useDashNumber": true
|
|
||||||
},
|
|
||||||
"twitter": {
|
|
||||||
"showNotifications": true,
|
|
||||||
"generateProfileNameFromUsers": true,
|
|
||||||
"allowEdtiableProfileName": true,
|
|
||||||
"allowDeleteTweets": true,
|
|
||||||
"allowReportTweets": true,
|
|
||||||
"characterLimit": 160,
|
|
||||||
"newLineLimit": 10,
|
|
||||||
"enableAvatars": true,
|
|
||||||
"enableEmojis": true,
|
|
||||||
"enableImages": true,
|
|
||||||
"maxImages": 3
|
|
||||||
},
|
|
||||||
"match": {
|
|
||||||
"generateProfileNameFromUsers": true,
|
|
||||||
"allowEdtiableProfileName": true
|
|
||||||
},
|
|
||||||
"bank": {
|
|
||||||
"showNotifications": true
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"level": "debug",
|
|
||||||
"enabled": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,10 @@ const configState = atom({
|
|||||||
default: Default,
|
default: Default,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const useConfig = (state: any = configState): any => {
|
// This is NOT the resource config but instead the NUI specific config,
|
||||||
|
// this means that if there are changs to the config in `../default.json`,
|
||||||
|
// it will require a rebuild for those to take effect.
|
||||||
|
export const usePhoneConfig = (state: any = configState): any => {
|
||||||
const [config, _setConfig] = useRecoilState(state);
|
const [config, _setConfig] = useRecoilState(state);
|
||||||
|
|
||||||
const setConfig = (key, value) => {
|
const setConfig = (key, value) => {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { atom } from 'recoil';
|
import { atom } from 'recoil';
|
||||||
import { IServerConfig } from '../../../../../typings/config';
|
import { ResourceConfig } from '../../../../../typings/config';
|
||||||
|
|
||||||
export const phoneState = {
|
export const phoneState = {
|
||||||
visibility: atom<boolean>({
|
visibility: atom<boolean>({
|
||||||
key: 'phoneVisibility',
|
key: 'phoneVisibility',
|
||||||
default: false,
|
default: false,
|
||||||
}),
|
}),
|
||||||
phoneConfig: atom<IServerConfig>({
|
resourceConfig: atom<ResourceConfig>({
|
||||||
key: 'phoneConfig',
|
key: 'resourceConfig',
|
||||||
default: null,
|
default: null,
|
||||||
}),
|
}),
|
||||||
phoneReady: atom<boolean>({
|
phoneReady: atom<boolean>({
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { IServerConfig } from '../../../../../typings/config';
|
import { ResourceConfig } from '../../../../../typings/config';
|
||||||
import ServerConfig from '../../../config.autogen.json';
|
|
||||||
import { useNotifications } from '../../notifications/hooks/useNotifications';
|
import { useNotifications } from '../../notifications/hooks/useNotifications';
|
||||||
import { useNuiRequest } from 'fivem-nui-react-lib';
|
import { useNuiRequest } from 'fivem-nui-react-lib';
|
||||||
import { phoneState } from './state';
|
import { phoneState } from './state';
|
||||||
import { PhoneEvents } from '../../../../../typings/phone';
|
import { PhoneEvents } from '../../../../../typings/phone';
|
||||||
|
|
||||||
interface IUsePhone {
|
interface IUsePhone {
|
||||||
config?: IServerConfig;
|
ResourceConfig?: ResourceConfig;
|
||||||
openPhone(): void;
|
openPhone(): void;
|
||||||
closePhone(): void;
|
closePhone(): void;
|
||||||
isPhoneOpen: boolean;
|
isPhoneOpen: boolean;
|
||||||
@@ -18,6 +17,7 @@ export const usePhone = (): IUsePhone => {
|
|||||||
const Nui = useNuiRequest();
|
const Nui = useNuiRequest();
|
||||||
const isPhoneOpen = useRecoilValue(phoneState.visibility);
|
const isPhoneOpen = useRecoilValue(phoneState.visibility);
|
||||||
const isPhoneReady = useRecoilValue(phoneState.phoneReady);
|
const isPhoneReady = useRecoilValue(phoneState.phoneReady);
|
||||||
|
const config = useRecoilValue(phoneState.resourceConfig);
|
||||||
|
|
||||||
const { removeAlerts } = useNotifications();
|
const { removeAlerts } = useNotifications();
|
||||||
|
|
||||||
@@ -29,5 +29,11 @@ export const usePhone = (): IUsePhone => {
|
|||||||
Nui.send(PhoneEvents.OPEN_PHONE);
|
Nui.send(PhoneEvents.OPEN_PHONE);
|
||||||
};
|
};
|
||||||
|
|
||||||
return { config: ServerConfig as any, closePhone, openPhone, isPhoneOpen, isPhoneReady };
|
return {
|
||||||
|
ResourceConfig: config as ResourceConfig,
|
||||||
|
closePhone,
|
||||||
|
openPhone,
|
||||||
|
isPhoneOpen,
|
||||||
|
isPhoneReady,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
@@ -13,11 +13,11 @@ export const usePhoneService = () => {
|
|||||||
}, [send]);
|
}, [send]);
|
||||||
|
|
||||||
const setVisibility = useSetRecoilState(phoneState.visibility);
|
const setVisibility = useSetRecoilState(phoneState.visibility);
|
||||||
const setPhoneConfig = useSetRecoilState(phoneState.phoneConfig);
|
const setResourceConfig = useSetRecoilState(phoneState.resourceConfig);
|
||||||
const setPhoneReady = useSetRecoilState(phoneState.phoneReady);
|
const setPhoneReady = useSetRecoilState(phoneState.phoneReady);
|
||||||
const setPhoneTime = useSetRecoilState(phoneState.phoneTime);
|
const setPhoneTime = useSetRecoilState(phoneState.phoneTime);
|
||||||
useNuiEvent('PHONE', PhoneEvents.SET_VISIBILITY, setVisibility);
|
useNuiEvent('PHONE', PhoneEvents.SET_VISIBILITY, setVisibility);
|
||||||
useNuiEvent('PHONE', PhoneEvents.SET_PHONE_READY, setPhoneReady);
|
useNuiEvent('PHONE', PhoneEvents.SET_PHONE_READY, setPhoneReady);
|
||||||
useNuiEvent('PHONE', PhoneEvents.SET_CONFIG, setPhoneConfig);
|
useNuiEvent('PHONE', PhoneEvents.SET_CONFIG, setResourceConfig);
|
||||||
useNuiEvent('PHONE', PhoneEvents.SET_TIME, setPhoneTime);
|
useNuiEvent('PHONE', PhoneEvents.SET_TIME, setPhoneTime);
|
||||||
};
|
};
|
||||||
@@ -21,13 +21,13 @@ const useStyles = makeStyles({
|
|||||||
|
|
||||||
function Notification({ children, handleClose, open }) {
|
function Notification({ children, handleClose, open }) {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { config } = usePhone();
|
const { ResourceConfig } = usePhone();
|
||||||
|
|
||||||
const currentTheme = usePhoneTheme();
|
const currentTheme = usePhoneTheme();
|
||||||
|
|
||||||
if (!config) return null;
|
if (!ResourceConfig) return null;
|
||||||
|
|
||||||
const { horizontal, vertical } = config.notificationPosition;
|
const { horizontal, vertical } = ResourceConfig.notificationPosition;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={currentTheme}>
|
<ThemeProvider theme={currentTheme}>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import ClientUtils from './cl_utils';
|
import ClientUtils from './cl_utils';
|
||||||
import { IServerConfig } from '../../typings/config';
|
import { ResourceConfig } from '../../typings/config';
|
||||||
|
|
||||||
// Setup and export the config for the resource
|
// Setup and export the config for the resource
|
||||||
export const config: IServerConfig = JSON.parse(
|
export const config: ResourceConfig = JSON.parse(
|
||||||
LoadResourceFile(GetCurrentResourceName(), 'config.json'),
|
LoadResourceFile(GetCurrentResourceName(), 'config.json'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Server } from 'esx.js';
|
import { Server } from 'esx.js';
|
||||||
import { IServerConfig } from '../../typings/config';
|
import { ResourceConfig } from '../../typings/config';
|
||||||
|
|
||||||
// Setup and export config loaded at runtime
|
// Setup and export config loaded at runtime
|
||||||
export const config: IServerConfig = JSON.parse(
|
export const config: ResourceConfig = JSON.parse(
|
||||||
LoadResourceFile(GetCurrentResourceName(), 'config.json'),
|
LoadResourceFile(GetCurrentResourceName(), 'config.json'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user