This commit is contained in:
erik-sn committed 2020-10-03 13:52:51 -04:00
1 parent e9e5836744
commit 345f591670
12 files changed
+12 -124

No files matched your search

+1
View File
@@ -0,0 +1 @@
-3
View File
@@ -1,3 +0,0 @@
{
"editor.formatOnSave": true
}
-3
View File
@@ -1,3 +0,0 @@
{
"editor.formatOnSave": true
}
@@ -32,12 +32,6 @@ const useStyles = makeStyles((theme) => ({
},
}));
// TODO move this to the router so the application back button works
const PAGE_COMPONENT_MAPPING = {
0: <TweetListContainer />,
1: <TwitterSearch />,
2: <TwitterProfile />,
};
const TWEETS_REFRESH_RATE = 15000; // TODO move this to twitter config
export const TwitterApp = () => {
@@ -1,8 +0,0 @@
import React from "react";
import ReactDOM from "react-dom";
import { TwitterApp } from "../TwitterApp";
it("renders without crashing", () => {
const div = document.createElement("div");
ReactDOM.render(<TwitterApp />, div);
});
@@ -35,8 +35,6 @@ export const ControlButtons = ({
: t("APPS_TWITTER_TWEET");
const showCloseButton = showImagePrompt || showEmoji;
if (createTweetLoading) return <h1>!!!</h1>;
return (
<div className={classes.buttons}>
<Button variant="contained" color="primary" onClick={onPrimaryClick}>
@@ -3,9 +3,8 @@ import { v4 as uuidv4 } from "uuid";
import { useNuiEvent } from "../../../os/nui-events/hooks/useNuiEvent";
import { IMAGE_DELIMITER } from "../utils/images";
import types from "../types";
import { APP_TWITTER } from "../utils/constants";
import { twitterState } from "./state";
import { useTweets } from "./useTweets";
/**
* Perform all necessary processing/transforms from the raw database
@@ -63,19 +62,11 @@ export const useTwitterService = () => {
setFilteredTweets(tweets.map(processTweet));
};
useNuiEvent(types.APP_TWITTER, "getOrCreateTwitterProfile", _setProfile);
useNuiEvent(
types.APP_TWITTER,
"updateProfileLoading",
setUpdateProfileLoading
);
useNuiEvent(
types.APP_TWITTER,
"updateProfileResult",
_setUpdateProfileSuccess
);
useNuiEvent(types.APP_TWITTER, "fetchTweets", _setTweets);
useNuiEvent(types.APP_TWITTER, "fetchTweetsFiltered", _setFilteredTweets);
useNuiEvent(types.APP_TWITTER, "createTweetLoading", setCreateLoading);
useNuiEvent(types.APP_TWITTER, "createTweetResult", _setCreateSuccess);
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);
};
-7
View File
@@ -1,7 +0,0 @@
export default {
IMAGE: "image",
GIF: "gif",
VIDEO: "video",
APP_TWITTER: "TWITTER",
};
@@ -1,2 +1,3 @@
export const IMG_DEFAULT_AVATAR = "./media/twitter/egg.png";
export const IMG_INVALID_AVATAR = "./media/twitter/invalid.png";
export const APP_TWITTER = "TWITTER";
-27
View File
@@ -1,27 +0,0 @@
// intended for use on initial application loads
import React from "react";
import { makeStyles, CircularProgress } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
root: {
height: "400px",
width: "100%",
display: "flex",
flexFlow: "row nowrap",
justifyContent: "center",
alignItems: "center",
},
progress: {
color: "white",
},
}));
export const AppLoader = () => {
const classes = useStyles();
return (
<div className={classes.root}>
<CircularProgress className={classes.progress} size={60} />
</div>
);
};
+1 -7
View File
@@ -270,10 +270,4 @@ AddEventHandler('onResourceStop', function(resource)
ClearPedTasks(GetPlayerPed(-1)) -- Leave here until launch as it'll fix any stuck animations.
end
end)
Citizen.CreateThread(function()
Citizen.Wait(0)
Phone()
end)
+1 -44
View File
@@ -1,44 +1 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<!--
Notice the use of in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script src="dev.js"></script></body>
</html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="%PUBLIC_URL%/favicon.ico"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>React App</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="main.js"></script></body></html>