mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
Remove client phoneConfig event (#73)
* Remove client phoneConfig event * Remove unused debug * Remove unused import * Remove unused import * Remove duplicated functions | fix useEffect dependency | etc * Fix warnings * Update phone/src/apps/twitter/components/TwitterApp.tsx Co-authored-by: Taso <[email protected]> Co-authored-by: Taso <[email protected]>
This commit is contained in:
1 parent
fdfd4133e2
commit
81f5e27064
12 files changed
+61
-81
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import React, {useEffect} from 'react';
|
||||
import React from 'react';
|
||||
import { Box, Button } from '@material-ui/core';
|
||||
import useStyles from './grid.styles';
|
||||
import { usePhotos } from '../../hooks/usePhotos';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, TextField, Slide } from '@material-ui/core';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
|
||||
import { useNoteModal } from '../hooks/useNoteModal';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { TextField } from '@material-ui/core';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
const useStyles = makeStyles({
|
||||
textField: {
|
||||
flex: '1 1 100%',
|
||||
padding: '10px 15px',
|
||||
@@ -12,7 +12,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
textFieldInput: {
|
||||
fontSize: '22px',
|
||||
},
|
||||
}));
|
||||
});
|
||||
|
||||
export const ImagePrompt = ({ visible, value, handleChange }) => {
|
||||
const textFieldRef = useRef(null);
|
||||
@@ -23,7 +23,10 @@ export const ImagePrompt = ({ visible, value, handleChange }) => {
|
||||
textFieldRef.current && textFieldRef.current.focus();
|
||||
}, [visible]);
|
||||
|
||||
const handleImageChange = useCallback(e => handleChange(e.target.value), []);
|
||||
const handleImageChange = useCallback(
|
||||
(e) => handleChange(e.target.value),
|
||||
[handleChange]
|
||||
);
|
||||
|
||||
if (!visible) return null;
|
||||
return (
|
||||
|
||||
@@ -43,9 +43,6 @@ export const useTwitterService = () => {
|
||||
);
|
||||
const setNotification = useSetRecoilState(twitterState.notification);
|
||||
|
||||
const _setProfile = (profile) => {
|
||||
setProfile(profile);
|
||||
};
|
||||
const _setUpdateProfileSuccess = (isSuccessful) => {
|
||||
setUpdateProfileSuccess(isSuccessful);
|
||||
setUpdateProfileLoading(false); // on any result we should set loading to false
|
||||
@@ -56,10 +53,6 @@ export const useTwitterService = () => {
|
||||
setCreateLoading(false);
|
||||
};
|
||||
|
||||
const _setNotification = (tweet) => {
|
||||
setNotification(tweet);
|
||||
};
|
||||
|
||||
const _setTweets = (tweets) => {
|
||||
setTweets(tweets.map(processTweet));
|
||||
};
|
||||
@@ -67,12 +60,12 @@ export const useTwitterService = () => {
|
||||
setFilteredTweets(tweets.map(processTweet));
|
||||
};
|
||||
|
||||
useNuiEvent(APP_TWITTER, 'getOrCreateTwitterProfile', _setProfile);
|
||||
useNuiEvent(APP_TWITTER, 'getOrCreateTwitterProfile', setProfile);
|
||||
useNuiEvent(APP_TWITTER, 'updateProfileLoading', setUpdateProfileLoading);
|
||||
useNuiEvent(APP_TWITTER, 'updateProfileResult', _setUpdateProfileSuccess);
|
||||
useNuiEvent(APP_TWITTER, 'fetchTweets', _setTweets);
|
||||
useNuiEvent(APP_TWITTER, 'fetchTweetsFiltered', _setFilteredTweets);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetLoading', setCreateLoading);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetResult', _setCreateSuccess);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetBroadcast', _setNotification);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetBroadcast', setNotification);
|
||||
};
|
||||
Reference in new issue
Block a user