mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
added setting in configuration on whether or not to show config
This commit is contained in:
1 parent
b2466f0e15
commit
7e37678c78
4 files changed
+5
-2
No files matched your search
@@ -4,6 +4,7 @@ import { makeStyles } from "@material-ui/core/styles";
|
||||
import TwitterIcon from '@material-ui/icons/Twitter';
|
||||
import { useTwitterNotification } from '../../hooks/useTwitterNotification';
|
||||
import Notification from '../../../../ui/components/Notification';
|
||||
import { usePhone } from "../../../../os/phone/hooks/usePhone";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
content: {
|
||||
@@ -48,12 +49,13 @@ function TwitterNotification() {
|
||||
const { t } = useTranslation();
|
||||
const [visible, setVisible] = useState(false);
|
||||
const { notification } = useTwitterNotification();
|
||||
const { config } = usePhone();
|
||||
|
||||
useEffect(() => {
|
||||
setVisible(true);
|
||||
}, [notification?.id])
|
||||
|
||||
if (!notification) return null;
|
||||
if (!config?.twitter.showNotifications || !notification) return null;
|
||||
|
||||
return (
|
||||
<Notification key={notification.id} open={visible} handleClose={() => setVisible(false)}>
|
||||
|
||||
@@ -6,7 +6,6 @@ import { IMAGE_DELIMITER } from "../utils/images";
|
||||
import { APP_TWITTER } from "../utils/constants";
|
||||
import { twitterState } from "./state";
|
||||
|
||||
const NOTIFICATION_TIMEOUT = 5000;
|
||||
|
||||
/**
|
||||
* Perform all necessary processing/transforms from the raw database
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
interface TwitterConfig {
|
||||
showNotifications: boolean;
|
||||
generateProfileNameFromUsers: boolean;
|
||||
characterLimit: number;
|
||||
allowEdtiableProfileName: boolean;
|
||||
|
||||
@@ -12,6 +12,7 @@ export default {
|
||||
|
||||
// twitter app
|
||||
twitter: {
|
||||
showNotifications: true,
|
||||
generateProfileNameFromUsers: true,
|
||||
characterLimit: 240,
|
||||
allowEdtiableProfileName: true,
|
||||
|
||||
Reference in new issue
Block a user