working typescript compiling and fixing linting issues

This commit is contained in:
erik-sn committed 2020-10-11 13:59:25 -04:00
1 parent b1babd88c2
commit 3273d192c9
49 files changed
+271 -110

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
interface TwitterConfig {
generateProfileNameFromUsers: boolean;
characterLimit: number;
allowEdtiableProfileName: boolean;
enableAvatars: boolean;
enableEmojis: boolean;
enableImages: boolean;
maxImages: number;
}
export interface ServerConfig {
Locale: string;
KeyTogglePhone: number;
KeyTakeCall: number;
PhoneAsItem: boolean;
SwimDestroy: boolean;
RunRate: number;
DestoryChance: number;
DestroyPhoneReCheck: number;
twitter: TwitterConfig;
}
+1 -1
View File
@@ -55,7 +55,7 @@ export const useInitKeyboard = () => {
Escape: useRecoilValue(keyboardState.Escape),
};
const setEscape = useSetRecoilState(keyboardState.Escape);
const setEscape = useSetRecoilState<any>(keyboardState.Escape);
useEffect(
function handleNUIKeyboardMessage() {
@@ -35,17 +35,17 @@ export const Navigation = () => {
<BottomNavigationAction
label="Phone"
value={() => history.push("/phone")}
icon={<PhoneIcon className={classes.icon} />}
icon={<PhoneIcon />}
/>
<BottomNavigationAction
label="Home"
value={() => history.push("/")}
icon={<AppsIcon className={classes.icon} />}
icon={<AppsIcon />}
/>
<BottomNavigationAction
label="Close"
value={() => closePhone()}
icon={<RadioButtonUncheckedIcon className={classes.icon} />}
icon={<RadioButtonUncheckedIcon />}
/>
<BottomNavigationAction
label="Back"
Whitespace-only changes.
@@ -25,7 +25,16 @@ const useStyles = makeStyles((theme) => ({
},
}));
export const NotificationBar = ({ notifications = [] }) => {
interface INotification {
key: string;
icon: JSX.Element;
}
interface IProps {
notifications?: INotification[];
}
export const NotificationBar = ({ notifications = [] }: IProps) => {
const classes = useStyles();
return (
<Grid
+8 -2
View File
@@ -1,8 +1,14 @@
import { useEffect, useRef } from "react";
import { eventNameFactory } from "../utils/nuiUtils";
export const useNuiEvent = (app, method, handler, options = {}) => {
const savedHandler = useRef();
interface IOptions {
capture?: boolean;
passive?: boolean;
once?: boolean;
}
export const useNuiEvent = (app, method, handler, options: IOptions = {}) => {
const savedHandler: any = useRef();
const { capture, passive, once } = options;
useEffect(() => {
@@ -1,7 +1,13 @@
import { useEffect } from "react";
import { eventNameFactory } from "../utils/nuiUtils";
export const useNuiService = (options = {}) => {
interface IOptions {
capture?: boolean;
passive?: boolean;
once?: boolean;
}
export const useNuiService = (options: IOptions = {}) => {
const { capture, passive, once } = options;
const eventListener = (event) => {
const { app, method, data } = event.data;
+1 -1
View File
@@ -7,6 +7,6 @@ export const phoneState = {
}),
phoneConfig: atom({
key: "phoneConfig",
default: null,
default: undefined,
}),
};
+7 -1
View File
@@ -1,7 +1,13 @@
import { useRecoilValue } from "recoil";
import { phoneState } from "./state";
import { ServerConfig } from "../../interfaces/serverConfig";
export const usePhone = () => {
interface IUsePhone {
visibility: boolean;
config?: ServerConfig;
}
export const usePhone = (): IUsePhone => {
const visibility = useRecoilValue(phoneState.visibility);
const config = useRecoilValue(phoneState.phoneConfig);
return { visibility, config };