mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Feature/floating notifications calling and twitter (#112)
* Add floating notifications :O * Add phone notifications and refactor calling ui * This is unsafe * Fix controls null check * Remove go to alert * Fix phone stuck after call * Remove lazy mount for Phone * Fix open/close cl_main * Use effect for notification visibility * Remove all alerts when phone closes * Avoid re-render useNuiEvent * It works now :c
This commit is contained in:
1 parent
4633146d40
commit
f6d7a3dbe1
42 files changed
+869
-679
No files matched your search
@@ -5,10 +5,7 @@ import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { IMAGE_DELIMITER } from '../utils/images';
|
||||
import { APP_TWITTER } from '../utils/constants';
|
||||
import { twitterState } from './state';
|
||||
import { useNotifications } from '../../../os/notifications/hooks/useNotifications';
|
||||
import { useApp } from '../../../os/apps/hooks/useApps';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useCallback } from 'react';
|
||||
import { useTwitterNotifications } from './useTwitterNotifications';
|
||||
|
||||
/**
|
||||
* Perform all necessary processing/transforms from the raw database
|
||||
@@ -32,22 +29,7 @@ function processTweet(tweet) {
|
||||
* there and have moved that logic here instead.
|
||||
*/
|
||||
export const useTwitterService = () => {
|
||||
const { t } = useTranslation();
|
||||
const { addNotification } = useNotifications();
|
||||
const { icon, notificationIcon } = useApp('TWITTER');
|
||||
|
||||
const setNotification = useCallback(
|
||||
({ profile_name, message }) =>
|
||||
addNotification({
|
||||
app: 'TWITTER',
|
||||
title: t('APPS_TWITTER_NEW_BROADCAST', { profile_name }),
|
||||
href: '/twitter',
|
||||
content: message,
|
||||
icon,
|
||||
notificationIcon,
|
||||
}),
|
||||
[addNotification, icon, notificationIcon, t]
|
||||
);
|
||||
const { setNotification } = useTwitterNotifications();
|
||||
|
||||
const setProfile = useSetRecoilState(twitterState.profile);
|
||||
const setUpdateProfileLoading = useSetRecoilState(
|
||||
|
||||
Reference in new issue
Block a user