mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b273e2310 | ||
|
|
ebbefd1497 | ||
|
|
f0bb41ac5f | ||
|
|
eaa0c97cde | ||
|
|
c678ab101e | ||
|
|
c46c75ebee |
No files matched your search
@@ -0,0 +1,58 @@
|
|||||||
|
---
|
||||||
|
name: "Deploy New Release"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v[0-9]+.[0-9]+.[0-9]+
|
||||||
|
branches:
|
||||||
|
- ci-cd/build-release
|
||||||
|
jobs:
|
||||||
|
deploy-release:
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Source
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Set Env
|
||||||
|
id: commit_info
|
||||||
|
run: |
|
||||||
|
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- name: Find Yarn Cache Dir
|
||||||
|
id: yarn-cache-dir-path
|
||||||
|
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
- name: Install deps for NUI & Game Scripts
|
||||||
|
run: |
|
||||||
|
cd phone && yarn --frozen-lockfile
|
||||||
|
cd ../resources && yarn --frozen-lockfile
|
||||||
|
- name: Testing NUI & Game Scripts
|
||||||
|
run: |
|
||||||
|
cd phone && yarn test
|
||||||
|
cd ../resources && yarn test
|
||||||
|
- name: Webpack/build NUI and Game Scripts
|
||||||
|
run: |
|
||||||
|
cd resources && yarn build
|
||||||
|
cd ../phone && yarn build
|
||||||
|
- name: Compressing built files
|
||||||
|
run: tar -czf npwd-${{env.SOURCE_TAG}}.tar.gz resources/dist/ resources/html/ fxmanifest.lua config.json LICENSE
|
||||||
|
- name: Create and deploy GitHub release
|
||||||
|
if: ${{ !env.ACT }}
|
||||||
|
uses: "marvinpinto/action-automatic-releases@latest"
|
||||||
|
with:
|
||||||
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
automatic_release_tag: '${{env.SOURCE_TAG}}'
|
||||||
|
prerelease: false
|
||||||
|
title: '${{ env.SOURCE_TAG }} - New Phone Who Dis'
|
||||||
|
files: npwd-${{env.SOURCE_TAG}}.tar.gz
|
||||||
@@ -52,6 +52,7 @@ export const DialerInput = () => {
|
|||||||
className={classes.input}
|
className={classes.input}
|
||||||
value={inputVal}
|
value={inputVal}
|
||||||
onChange={(e) => set(e.target.value)}
|
onChange={(e) => set(e.target.value)}
|
||||||
|
type="number"
|
||||||
/>
|
/>
|
||||||
<IconButton color="primary" className={classes.iconBtn} disabled={inputVal <= ''}>
|
<IconButton color="primary" className={classes.iconBtn} disabled={inputVal <= ''}>
|
||||||
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
|
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import qs from 'qs';
|
|||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
import Modal from '../../../../ui/components/Modal';
|
import Modal from '../../../../ui/components/Modal';
|
||||||
import PhotoLibraryIcon from '@material-ui/icons/PhotoLibrary';
|
import PhotoLibraryIcon from '@material-ui/icons/PhotoLibrary';
|
||||||
import { Box, Typography, Button } from '@material-ui/core';
|
import { Box, Typography, TextField, Button } from '@material-ui/core';
|
||||||
|
import FileCopyIcon from '@material-ui/icons/FileCopy';
|
||||||
|
import useStyles from './modal.styles';
|
||||||
import { useHistory, useLocation } from 'react-router-dom';
|
import { useHistory, useLocation } from 'react-router-dom';
|
||||||
import { ContextMenu } from '../../../../ui/components/ContextMenu';
|
import { ContextMenu } from '../../../../ui/components/ContextMenu';
|
||||||
import { deleteQueryFromLocation } from '../../../../common/utils/deleteQueryFromLocation';
|
import { deleteQueryFromLocation } from '../../../../common/utils/deleteQueryFromLocation';
|
||||||
@@ -18,8 +20,12 @@ interface IProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const MessageImageModal = ({ isOpen, messageGroupId, onClose, image }: IProps) => {
|
export const MessageImageModal = ({ isOpen, messageGroupId, onClose, image }: IProps) => {
|
||||||
|
const classes = useStyles();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { pathname, search } = useLocation();
|
const { pathname, search } = useLocation();
|
||||||
|
|
||||||
|
const [message, setMessage] = useState('');
|
||||||
|
const [pasteVisible, setPasteVisible] = useState(false);
|
||||||
const [queryParamImagePreview, setQueryParamImagePreview] = useState(null);
|
const [queryParamImagePreview, setQueryParamImagePreview] = useState(null);
|
||||||
|
|
||||||
const removeQueryParamImage = useCallback(() => {
|
const removeQueryParamImage = useCallback(() => {
|
||||||
@@ -49,10 +55,21 @@ export const MessageImageModal = ({ isOpen, messageGroupId, onClose, image }: IP
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!image) return;
|
if (!image) return;
|
||||||
setQueryParamImagePreview(image);
|
setQueryParamImagePreview(image);
|
||||||
}, [image]);
|
}, [image, sendFromQueryParam]);
|
||||||
|
|
||||||
|
const sendFromClipboard = (event) => {
|
||||||
|
if (event.key === 'Enter') {
|
||||||
|
sendImageMessage(message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const menuOptions = useMemo(
|
const menuOptions = useMemo(
|
||||||
() => [
|
() => [
|
||||||
|
{
|
||||||
|
label: 'Paste from clipboard',
|
||||||
|
icon: <FileCopyIcon />,
|
||||||
|
onClick: () => setPasteVisible(true),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Camera / Gallery',
|
label: 'Camera / Gallery',
|
||||||
icon: <PhotoLibraryIcon />,
|
icon: <PhotoLibraryIcon />,
|
||||||
@@ -73,7 +90,7 @@ export const MessageImageModal = ({ isOpen, messageGroupId, onClose, image }: IP
|
|||||||
<Modal visible={queryParamImagePreview} handleClose={removeQueryParamImage}>
|
<Modal visible={queryParamImagePreview} handleClose={removeQueryParamImage}>
|
||||||
<Box py={1}>
|
<Box py={1}>
|
||||||
<Typography paragraph>Do you want to share this image?</Typography>
|
<Typography paragraph>Do you want to share this image?</Typography>
|
||||||
<PictureResponsive src={queryParamImagePreview} alt="Share gallery image preview" />
|
<PictureResponsive src={queryParamImagePreview} alt={'Share gallery image preview'} />
|
||||||
<Button
|
<Button
|
||||||
fullWidth
|
fullWidth
|
||||||
variant="contained"
|
variant="contained"
|
||||||
@@ -84,6 +101,21 @@ export const MessageImageModal = ({ isOpen, messageGroupId, onClose, image }: IP
|
|||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
<Modal visible={pasteVisible} handleClose={() => setPasteVisible(false)}>
|
||||||
|
<Box p={1}>
|
||||||
|
<TextField
|
||||||
|
placeholder="A link to your image or gif"
|
||||||
|
onChange={(e) => setMessage(e.target.value)}
|
||||||
|
value={message}
|
||||||
|
fullWidth
|
||||||
|
inputProps={{
|
||||||
|
className: classes.messagesInput,
|
||||||
|
}}
|
||||||
|
inputRef={(input) => input && input.focus()}
|
||||||
|
onKeyPress={sendFromClipboard}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
</Modal>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -191,10 +191,6 @@
|
|||||||
{
|
{
|
||||||
"label": "Default Light",
|
"label": "Default Light",
|
||||||
"value": "default-light"
|
"value": "default-light"
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Kiddo Dark",
|
|
||||||
"value": "kiddo-dark"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"debug": {
|
"debug": {
|
||||||
|
|||||||
@@ -34,20 +34,5 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"divider": "rgba(255, 255, 255, 0.12)"
|
"divider": "rgba(255, 255, 255, 0.12)"
|
||||||
},
|
|
||||||
"kiddo-dark": {
|
|
||||||
"palette": {
|
|
||||||
"type": "dark",
|
|
||||||
"primary": {
|
|
||||||
"main": "#EBFEF3"
|
|
||||||
},
|
|
||||||
"secondary": {
|
|
||||||
"main": "#5E0035"
|
|
||||||
},
|
|
||||||
"background": {
|
|
||||||
"default": "#033A18",
|
|
||||||
"paper": "#011308"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -16,8 +16,8 @@ import updateLocale from 'dayjs/plugin/updateLocale';
|
|||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
dayjs.extend(updateLocale);
|
dayjs.extend(updateLocale);
|
||||||
|
|
||||||
// Enable Sentry when config setting is true and when in prod
|
// Enable Sentry when config setting is true
|
||||||
if (PhoneConfig.SentryErrorMetrics && process.env.NODE_ENV !== 'development') {
|
if (PhoneConfig.SentryErrorMetrics) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: 'https://[email protected]/5581619',
|
dsn: 'https://[email protected]/5581619',
|
||||||
autoSessionTracking: true,
|
autoSessionTracking: true,
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { BankEvents } from '../../typings/bank';
|
|||||||
import { PhotoEvents } from '../../typings/photo';
|
import { PhotoEvents } from '../../typings/photo';
|
||||||
import { CallEvents } from '../../typings/call';
|
import { CallEvents } from '../../typings/call';
|
||||||
import { MatchEvents } from '../../typings/match';
|
import { MatchEvents } from '../../typings/match';
|
||||||
import { Delay } from '../utils/fivem';
|
|
||||||
|
|
||||||
let isPhoneOpen = false;
|
let isPhoneOpen = false;
|
||||||
let isPhoneReady = false;
|
let isPhoneReady = false;
|
||||||
@@ -52,7 +51,6 @@ const getCurrentGameTime = () => {
|
|||||||
|
|
||||||
const showPhone = async (): Promise<void> => {
|
const showPhone = async (): Promise<void> => {
|
||||||
isPhoneOpen = true;
|
isPhoneOpen = true;
|
||||||
disableControls();
|
|
||||||
const time = getCurrentGameTime();
|
const time = getCurrentGameTime();
|
||||||
await phoneOpenAnim(); // Animation starts before the phone is open
|
await phoneOpenAnim(); // Animation starts before the phone is open
|
||||||
emitNet('phone:getCredentials');
|
emitNet('phone:getCredentials');
|
||||||
@@ -60,7 +58,6 @@ const showPhone = async (): Promise<void> => {
|
|||||||
sendMessage('PHONE', 'setVisibility', true);
|
sendMessage('PHONE', 'setVisibility', true);
|
||||||
sendMessage('PHONE', 'setTime', time);
|
sendMessage('PHONE', 'setTime', time);
|
||||||
SetNuiFocus(true, true);
|
SetNuiFocus(true, true);
|
||||||
SetNuiFocusKeepInput(true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const hidePhone = async (): Promise<void> => {
|
const hidePhone = async (): Promise<void> => {
|
||||||
@@ -68,7 +65,6 @@ const hidePhone = async (): Promise<void> => {
|
|||||||
sendMessage('PHONE', 'setVisibility', false);
|
sendMessage('PHONE', 'setVisibility', false);
|
||||||
await phoneCloseAnim();
|
await phoneCloseAnim();
|
||||||
SetNuiFocus(false, false);
|
SetNuiFocus(false, false);
|
||||||
SetNuiFocusKeepInput(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* * * * * * * * * * * * *
|
/* * * * * * * * * * * * *
|
||||||
@@ -200,30 +196,3 @@ on(`__cfx_nui:${PhoneEvents.CLOSE_PHONE}`, async (data: any, cb: Function) => {
|
|||||||
// const time = getCurrentGameTime()
|
// const time = getCurrentGameTime()
|
||||||
// sendMessage('PHONE', 'setTime', time)
|
// sendMessage('PHONE', 'setTime', time)
|
||||||
// }, 2000);
|
// }, 2000);
|
||||||
|
|
||||||
function disableControls(): void {
|
|
||||||
let timeoutFinished = false;
|
|
||||||
|
|
||||||
const loopTick = setTick(
|
|
||||||
async (useTimeout = false): Promise<void> => {
|
|
||||||
if (!isPhoneOpen) {
|
|
||||||
clearTick(loopTick);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPhoneOpen) {
|
|
||||||
DisableControlAction(0, 1, true);
|
|
||||||
DisableControlAction(0, 2, true);
|
|
||||||
DisableControlAction(0, 16, true);
|
|
||||||
DisableControlAction(0, 17, true);
|
|
||||||
if (useTimeout) {
|
|
||||||
setTimeout(() => {
|
|
||||||
timeoutFinished = true;
|
|
||||||
}, 5000);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
await Delay(30000);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user