From bb234135332812e8a5a36e4262d79fb9c77aaa7f Mon Sep 17 00:00:00 2001 From: erik-sn Date: Mon, 5 Oct 2020 21:37:19 -0400 Subject: [PATCH 01/20] initial likes implementation This adds the initial likes implementation. We take an approach of just toggling the like in the database rather than adding a loading mechanic and waiting on the UI. --- .../twitter/components/buttons/LikeButton.js | 23 ++++++ .../apps/twitter/components/tweet/Tweet.js | 7 +- resources/client/cl_twitter.lua | 4 + resources/html/index.html | 45 ++++++++++- resources/import.sql | 6 +- resources/server/sv_twitter.lua | 76 +++++++++++++++++-- 6 files changed, 149 insertions(+), 12 deletions(-) create mode 100644 phone/src/apps/twitter/components/buttons/LikeButton.js diff --git a/phone/src/apps/twitter/components/buttons/LikeButton.js b/phone/src/apps/twitter/components/buttons/LikeButton.js new file mode 100644 index 0000000..6b72e65 --- /dev/null +++ b/phone/src/apps/twitter/components/buttons/LikeButton.js @@ -0,0 +1,23 @@ +import React, { useState, useEffect } from "react"; +import { Button } from "@material-ui/core"; +import FavoriteBorderIcon from "@material-ui/icons/FavoriteBorder"; +import FavoriteIcon from "@material-ui/icons/Favorite"; + +import Nui from "../../../../os/nui-events/utils/Nui"; + +function LikeButton({ tweetId, isLiked }) { + const [liked, setLiked] = useState(isLiked); + + const handleClick = () => { + Nui.send("phone:toggleLike", tweetId); + setLiked(!liked); + }; + + return ( + + ); +} + +export default LikeButton; diff --git a/phone/src/apps/twitter/components/tweet/Tweet.js b/phone/src/apps/twitter/components/tweet/Tweet.js index 5f87c9b..138f5b7 100644 --- a/phone/src/apps/twitter/components/tweet/Tweet.js +++ b/phone/src/apps/twitter/components/tweet/Tweet.js @@ -12,6 +12,7 @@ import MoreIcon from "@material-ui/icons/MoreVert"; import { ListItem } from "../../../../ui/components/ListItem"; import { secondsToHumanReadable } from "../../utils/time"; +import LikeButton from "../buttons/LikeButton"; import ReplyButton from "../buttons/ReplyButton"; import ImageDisplay from "../images/ImageDisplay"; import Avatar from "../Avatar"; @@ -63,11 +64,13 @@ const useStyles = makeStyles(() => ({ export const Tweet = (tweet) => { const { + id, message, images, avatar_url, profile_name, seconds_since_tweet, + isLiked, } = tweet; const classes = useStyles(); const { t } = useTranslation(); @@ -110,9 +113,7 @@ export const Tweet = (tweet) => { {enableImages && }
- + + ); + } + return ( )} - {enableEmojis && ()} + {enableImages && ( + + )} + {enableEmojis && ( + + )}
); }; diff --git a/phone/src/apps/twitter/components/buttons/LikeButton.js b/phone/src/apps/twitter/components/buttons/LikeButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/LikeButton.js rename to phone/src/apps/twitter/components/buttons/LikeButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/ProfileUpdateButton.js b/phone/src/apps/twitter/components/buttons/ProfileUpdateButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/ProfileUpdateButton.js rename to phone/src/apps/twitter/components/buttons/ProfileUpdateButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/QuoteButton.js b/phone/src/apps/twitter/components/buttons/QuoteButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/QuoteButton.js rename to phone/src/apps/twitter/components/buttons/QuoteButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/ReplyButton.js b/phone/src/apps/twitter/components/buttons/ReplyButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/ReplyButton.js rename to phone/src/apps/twitter/components/buttons/ReplyButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/SearchButton.js b/phone/src/apps/twitter/components/buttons/SearchButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/SearchButton.js rename to phone/src/apps/twitter/components/buttons/SearchButton.tsx diff --git a/phone/src/apps/twitter/components/buttons/TweetButton.js b/phone/src/apps/twitter/components/buttons/TweetButton.tsx similarity index 100% rename from phone/src/apps/twitter/components/buttons/TweetButton.js rename to phone/src/apps/twitter/components/buttons/TweetButton.tsx diff --git a/phone/src/apps/twitter/components/images/Image.js b/phone/src/apps/twitter/components/images/Image.tsx similarity index 100% rename from phone/src/apps/twitter/components/images/Image.js rename to phone/src/apps/twitter/components/images/Image.tsx diff --git a/phone/src/apps/twitter/components/images/ImageDisplay.js b/phone/src/apps/twitter/components/images/ImageDisplay.tsx similarity index 100% rename from phone/src/apps/twitter/components/images/ImageDisplay.js rename to phone/src/apps/twitter/components/images/ImageDisplay.tsx diff --git a/phone/src/apps/twitter/components/images/ImagePrompt.js b/phone/src/apps/twitter/components/images/ImagePrompt.tsx similarity index 100% rename from phone/src/apps/twitter/components/images/ImagePrompt.js rename to phone/src/apps/twitter/components/images/ImagePrompt.tsx diff --git a/phone/src/apps/twitter/components/profile/Profile.js b/phone/src/apps/twitter/components/profile/Profile.tsx similarity index 97% rename from phone/src/apps/twitter/components/profile/Profile.js rename to phone/src/apps/twitter/components/profile/Profile.tsx index f14690c..292cceb 100644 --- a/phone/src/apps/twitter/components/profile/Profile.js +++ b/phone/src/apps/twitter/components/profile/Profile.tsx @@ -27,7 +27,6 @@ export function Profile() { const { profile } = useProfile(); const { config } = usePhone(); - // note that this assumes we are defensively checking // that profile is not null in a parent above this component. // Annoyingling adding conditionals above this line to not render @@ -50,7 +49,7 @@ export function Profile() { Nui.send("phone:updateTwitterProfile", data); }; - // fetching the config is an asynchronous call so defend against it + // fetching the config is an asynchronous call so defend against it if (!config) return null; const { enableAvatars, allowEdtiableProfileName } = config.twitter; diff --git a/phone/src/apps/twitter/components/profile/ProfileField.js b/phone/src/apps/twitter/components/profile/ProfileField.tsx similarity index 100% rename from phone/src/apps/twitter/components/profile/ProfileField.js rename to phone/src/apps/twitter/components/profile/ProfileField.tsx diff --git a/phone/src/apps/twitter/components/profile/ProfilePrompt.js b/phone/src/apps/twitter/components/profile/ProfilePrompt.tsx similarity index 100% rename from phone/src/apps/twitter/components/profile/ProfilePrompt.js rename to phone/src/apps/twitter/components/profile/ProfilePrompt.tsx diff --git a/phone/src/apps/twitter/components/tweet/Tweet.js b/phone/src/apps/twitter/components/tweet/Tweet.tsx similarity index 100% rename from phone/src/apps/twitter/components/tweet/Tweet.js rename to phone/src/apps/twitter/components/tweet/Tweet.tsx diff --git a/phone/src/apps/twitter/components/tweet/TweetList.js b/phone/src/apps/twitter/components/tweet/TweetList.tsx similarity index 100% rename from phone/src/apps/twitter/components/tweet/TweetList.js rename to phone/src/apps/twitter/components/tweet/TweetList.tsx diff --git a/phone/src/apps/twitter/components/tweet/TweetListContainer.js b/phone/src/apps/twitter/components/tweet/TweetListContainer.tsx similarity index 100% rename from phone/src/apps/twitter/components/tweet/TweetListContainer.js rename to phone/src/apps/twitter/components/tweet/TweetListContainer.tsx diff --git a/phone/src/apps/twitter/components/tweet/TweetMessage.js b/phone/src/apps/twitter/components/tweet/TweetMessage.tsx similarity index 83% rename from phone/src/apps/twitter/components/tweet/TweetMessage.js rename to phone/src/apps/twitter/components/tweet/TweetMessage.tsx index 595ea4e..878817a 100644 --- a/phone/src/apps/twitter/components/tweet/TweetMessage.js +++ b/phone/src/apps/twitter/components/tweet/TweetMessage.tsx @@ -23,8 +23,11 @@ export const TweetMessage = ({ message, handleChange }) => { const { config } = usePhone(); const { t } = useTranslation(); - const overCharacterLimit = message.trim().length > config.twitter.characterLimit; - const characterWarningPrompt = `${t("APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT")} (${config.twitter.characterLimit})`; + const overCharacterLimit = + message.trim().length > config.twitter.characterLimit; + const characterWarningPrompt = `${t( + "APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT" + )} (${config.twitter.characterLimit})`; return ( string, + seconds: number +): string { if (seconds < 60) { return t(JUST_NOW); } else if (seconds < ONE_HOUR) { diff --git a/phone/src/config/hooks/useConfig.js b/phone/src/config/hooks/useConfig.ts similarity index 64% rename from phone/src/config/hooks/useConfig.js rename to phone/src/config/hooks/useConfig.ts index 70ed6b1..4db3ecf 100644 --- a/phone/src/config/hooks/useConfig.js +++ b/phone/src/config/hooks/useConfig.ts @@ -2,17 +2,17 @@ import Default from "../default.json"; import { atom, useRecoilState } from "recoil"; const configState = atom({ - key: 'config', - default: Default -}) + key: "config", + default: Default, +}); export const useConfig = (state = configState) => { - const [config, _setConfig] = useRecoilState(state) + const [config, _setConfig] = useRecoilState(state); const setConfig = (key, value) => { - _setConfig(oldConfig => ({ + _setConfig((oldConfig) => ({ ...oldConfig, - [key]: value + [key]: value, })); }; diff --git a/phone/src/i18n.js b/phone/src/i18n.ts similarity index 98% rename from phone/src/i18n.js rename to phone/src/i18n.ts index 25acb8f..f4ca0de 100644 --- a/phone/src/i18n.js +++ b/phone/src/i18n.ts @@ -3,7 +3,7 @@ import { initReactI18next } from "react-i18next"; import en from "./locale/en.json"; const resources = { - en + en, }; i18n diff --git a/phone/src/index.js b/phone/src/index.tsx similarity index 100% rename from phone/src/index.js rename to phone/src/index.tsx diff --git a/phone/src/modal/components/CallModal.js b/phone/src/modal/components/CallModal.tsx similarity index 100% rename from phone/src/modal/components/CallModal.js rename to phone/src/modal/components/CallModal.tsx diff --git a/phone/src/modal/hooks/state.js b/phone/src/modal/hooks/state.ts similarity index 100% rename from phone/src/modal/hooks/state.js rename to phone/src/modal/hooks/state.ts diff --git a/phone/src/modal/hooks/useCall.js b/phone/src/modal/hooks/useCall.ts similarity index 100% rename from phone/src/modal/hooks/useCall.js rename to phone/src/modal/hooks/useCall.ts diff --git a/phone/src/modal/hooks/useCallService.js b/phone/src/modal/hooks/useCallService.ts similarity index 100% rename from phone/src/modal/hooks/useCallService.js rename to phone/src/modal/hooks/useCallService.ts diff --git a/phone/src/os/apps/hooks/useApps.js b/phone/src/os/apps/hooks/useApps.tsx similarity index 100% rename from phone/src/os/apps/hooks/useApps.js rename to phone/src/os/apps/hooks/useApps.tsx diff --git a/phone/src/os/keyboard/hooks/useKeyboard.js b/phone/src/os/keyboard/hooks/useKeyboard.ts similarity index 93% rename from phone/src/os/keyboard/hooks/useKeyboard.js rename to phone/src/os/keyboard/hooks/useKeyboard.ts index 1fe5c85..0b02a39 100644 --- a/phone/src/os/keyboard/hooks/useKeyboard.js +++ b/phone/src/os/keyboard/hooks/useKeyboard.ts @@ -78,9 +78,12 @@ export const useInitKeyboard = () => { [getters] ); - useEffect(function registerEscapeHandler() { - setEscape({ handler: () => console.log("close phone") }); - }, [setEscape]); + useEffect( + function registerEscapeHandler() { + setEscape({ handler: () => console.log("close phone") }); + }, + [setEscape] + ); }; export const useKeyboard = () => { diff --git a/phone/src/os/navigation-bar/components/Navigation.js b/phone/src/os/navigation-bar/components/Navigation.tsx similarity index 100% rename from phone/src/os/navigation-bar/components/Navigation.js rename to phone/src/os/navigation-bar/components/Navigation.tsx diff --git a/phone/src/os/navigation-bar/hooks/useNavigationBar.js b/phone/src/os/navigation-bar/hooks/useNavigationBar.ts similarity index 100% rename from phone/src/os/navigation-bar/hooks/useNavigationBar.js rename to phone/src/os/navigation-bar/hooks/useNavigationBar.ts diff --git a/phone/src/os/notifications/components/NotificationBar.js b/phone/src/os/notifications/components/NotificationBar.tsx similarity index 88% rename from phone/src/os/notifications/components/NotificationBar.js rename to phone/src/os/notifications/components/NotificationBar.tsx index 8bd028d..2ea2059 100644 --- a/phone/src/os/notifications/components/NotificationBar.js +++ b/phone/src/os/notifications/components/NotificationBar.tsx @@ -20,7 +20,7 @@ const useStyles = makeStyles((theme) => ({ color: theme.palette.text.primary, }, icon: { - padding: '4px', + padding: "4px", color: theme.palette.text.primary, }, })); @@ -36,7 +36,12 @@ export const NotificationBar = ({ notifications = [] }) => { > {notifications.map((notification) => ( - + {notification.icon} ))} diff --git a/phone/src/os/notifications/components/NotificationIcon.js b/phone/src/os/notifications/components/NotificationIcon.tsx similarity index 100% rename from phone/src/os/notifications/components/NotificationIcon.js rename to phone/src/os/notifications/components/NotificationIcon.tsx diff --git a/phone/src/os/nui-events/hooks/useNuiEvent.js b/phone/src/os/nui-events/hooks/useNuiEvent.ts similarity index 100% rename from phone/src/os/nui-events/hooks/useNuiEvent.js rename to phone/src/os/nui-events/hooks/useNuiEvent.ts diff --git a/phone/src/os/nui-events/hooks/useNuiService.js b/phone/src/os/nui-events/hooks/useNuiService.ts similarity index 100% rename from phone/src/os/nui-events/hooks/useNuiService.js rename to phone/src/os/nui-events/hooks/useNuiService.ts diff --git a/phone/src/os/nui-events/utils/Nui.js b/phone/src/os/nui-events/utils/Nui.ts similarity index 100% rename from phone/src/os/nui-events/utils/Nui.js rename to phone/src/os/nui-events/utils/Nui.ts diff --git a/phone/src/os/nui-events/utils/nuiUtils.js b/phone/src/os/nui-events/utils/nuiUtils.ts similarity index 100% rename from phone/src/os/nui-events/utils/nuiUtils.js rename to phone/src/os/nui-events/utils/nuiUtils.ts diff --git a/phone/src/os/phone/hooks/state.js b/phone/src/os/phone/hooks/state.ts similarity index 100% rename from phone/src/os/phone/hooks/state.js rename to phone/src/os/phone/hooks/state.ts diff --git a/phone/src/os/phone/hooks/usePhone.js b/phone/src/os/phone/hooks/usePhone.ts similarity index 100% rename from phone/src/os/phone/hooks/usePhone.js rename to phone/src/os/phone/hooks/usePhone.ts diff --git a/phone/src/os/phone/hooks/usePhoneService.js b/phone/src/os/phone/hooks/usePhoneService.ts similarity index 100% rename from phone/src/os/phone/hooks/usePhoneService.js rename to phone/src/os/phone/hooks/usePhoneService.ts diff --git a/phone/src/os/simcard/hooks/state.js b/phone/src/os/simcard/hooks/state.ts similarity index 100% rename from phone/src/os/simcard/hooks/state.js rename to phone/src/os/simcard/hooks/state.ts diff --git a/phone/src/os/simcard/hooks/useSimcard.js b/phone/src/os/simcard/hooks/useSimcard.ts similarity index 100% rename from phone/src/os/simcard/hooks/useSimcard.js rename to phone/src/os/simcard/hooks/useSimcard.ts diff --git a/phone/src/os/simcard/hooks/useSimcardService.js b/phone/src/os/simcard/hooks/useSimcardService.ts similarity index 100% rename from phone/src/os/simcard/hooks/useSimcardService.js rename to phone/src/os/simcard/hooks/useSimcardService.ts diff --git a/phone/src/react-app-env.d.ts b/phone/src/react-app-env.d.ts new file mode 100644 index 0000000..6431bc5 --- /dev/null +++ b/phone/src/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/phone/src/serviceWorker.js b/phone/src/serviceWorker.ts similarity index 77% rename from phone/src/serviceWorker.js rename to phone/src/serviceWorker.ts index b04b771..c7cd666 100644 --- a/phone/src/serviceWorker.js +++ b/phone/src/serviceWorker.ts @@ -11,9 +11,9 @@ // opt-in, read https://bit.ly/CRA-PWA const isLocalhost = Boolean( - window.location.hostname === 'localhost' || + window.location.hostname === "localhost" || // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || + window.location.hostname === "[::1]" || // 127.0.0.0/8 are considered localhost for IPv4. window.location.hostname.match( /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ @@ -21,7 +21,7 @@ const isLocalhost = Boolean( ); export function register(config) { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) { // The URL constructor is available in all browsers that support SW. const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); if (publicUrl.origin !== window.location.origin) { @@ -31,7 +31,7 @@ export function register(config) { return; } - window.addEventListener('load', () => { + window.addEventListener("load", () => { const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; if (isLocalhost) { @@ -42,8 +42,8 @@ export function register(config) { // service worker/PWA documentation. navigator.serviceWorker.ready.then(() => { console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' + "This web app is being served cache-first by a service " + + "worker. To learn more, visit https://bit.ly/CRA-PWA" ); }); } else { @@ -57,21 +57,21 @@ export function register(config) { function registerValidSW(swUrl, config) { navigator.serviceWorker .register(swUrl) - .then(registration => { + .then((registration) => { registration.onupdatefound = () => { const installingWorker = registration.installing; if (installingWorker == null) { return; } installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { + if (installingWorker.state === "installed") { if (navigator.serviceWorker.controller) { // At this point, the updated precached content has been fetched, // but the previous service worker will still serve the older // content until all client tabs are closed. console.log( - 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' + "New content is available and will be used when all " + + "tabs for this page are closed. See https://bit.ly/CRA-PWA." ); // Execute callback @@ -82,7 +82,7 @@ function registerValidSW(swUrl, config) { // At this point, everything has been precached. // It's the perfect time to display a // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); + console.log("Content is cached for offline use."); // Execute callback if (config && config.onSuccess) { @@ -93,25 +93,25 @@ function registerValidSW(swUrl, config) { }; }; }) - .catch(error => { - console.error('Error during service worker registration:', error); + .catch((error) => { + console.error("Error during service worker registration:", error); }); } function checkValidServiceWorker(swUrl, config) { // Check if the service worker can be found. If it can't reload the page. fetch(swUrl, { - headers: { 'Service-Worker': 'script' }, + headers: { "Service-Worker": "script" }, }) - .then(response => { + .then((response) => { // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); + const contentType = response.headers.get("content-type"); if ( response.status === 404 || - (contentType != null && contentType.indexOf('javascript') === -1) + (contentType != null && contentType.indexOf("javascript") === -1) ) { // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then(registration => { + navigator.serviceWorker.ready.then((registration) => { registration.unregister().then(() => { window.location.reload(); }); @@ -123,18 +123,18 @@ function checkValidServiceWorker(swUrl, config) { }) .catch(() => { console.log( - 'No internet connection found. App is running in offline mode.' + "No internet connection found. App is running in offline mode." ); }); } export function unregister() { - if ('serviceWorker' in navigator) { + if ("serviceWorker" in navigator) { navigator.serviceWorker.ready - .then(registration => { + .then((registration) => { registration.unregister(); }) - .catch(error => { + .catch((error) => { console.error(error.message); }); } diff --git a/phone/src/setupTests.js b/phone/src/setupTests.ts similarity index 100% rename from phone/src/setupTests.js rename to phone/src/setupTests.ts diff --git a/phone/src/ui/components/AppContent.js b/phone/src/ui/components/AppContent.tsx similarity index 100% rename from phone/src/ui/components/AppContent.js rename to phone/src/ui/components/AppContent.tsx diff --git a/phone/src/ui/components/AppIcon.js b/phone/src/ui/components/AppIcon.tsx similarity index 85% rename from phone/src/ui/components/AppIcon.js rename to phone/src/ui/components/AppIcon.tsx index f50ab19..c10248e 100644 --- a/phone/src/ui/components/AppIcon.js +++ b/phone/src/ui/components/AppIcon.tsx @@ -10,7 +10,7 @@ const useStyles = makeStyles((theme) => ({ "& > *": { margin: theme.spacing(1), }, - padding: 0 + padding: 0, }, avatar: { backgroundColor: ({ backgroundColor }) => backgroundColor, @@ -18,11 +18,14 @@ const useStyles = makeStyles((theme) => ({ width: theme.spacing(7), height: theme.spacing(7), fontSize: theme.typography.h4.fontSize, - } + }, })); export const AppIcon = ({ name, icon, backgroundColor, color }) => { - const classes = useStyles({ backgroundColor: backgroundColor || green[50], color: color || green[400] }); + const classes = useStyles({ + backgroundColor: backgroundColor || green[50], + color: color || green[400], + }); return ( + + + + + + ); +}; diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutList.js b/phone/src/apps/sellout/components/SelloutList/SelloutList.js new file mode 100644 index 0000000..9c7df00 --- /dev/null +++ b/phone/src/apps/sellout/components/SelloutList/SelloutList.js @@ -0,0 +1,13 @@ +import React from "react"; +import { List } from "../../../../ui/components/List"; +import { SelloutItem } from "./SelloutItem"; + +export const SelloutList = ({ listings }) => { + return ( + + {listings.map((listing) => ( + + ))} + + ); +}; diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.js b/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.js new file mode 100644 index 0000000..4117b89 --- /dev/null +++ b/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.js @@ -0,0 +1,8 @@ +import React from "react"; +import { useListing } from "../../hooks/useListing"; +import { SelloutList } from "./SelloutList"; + +export const SelloutListContainer = () => { + const { listing } = useListing(); + return ; +}; diff --git a/phone/src/apps/sellout/components/SelloutTitle.js b/phone/src/apps/sellout/components/SelloutTitle.js new file mode 100644 index 0000000..e16b4d1 --- /dev/null +++ b/phone/src/apps/sellout/components/SelloutTitle.js @@ -0,0 +1,29 @@ +import React from "react"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles } from "@material-ui/core"; +import LinkedInIcon from "@material-ui/icons/LinkedIn"; + +const useStyles = makeStyles((theme) => ({ + root: { + height: "60px", + width: "100%", + display: "flex", + flexFlow: "row nowrap", + justifyContent: "center", + alignItems: "center", + background: "#424242", + }, + icon: { + color: "#f44336", + fontSize: 40, + }, +})); + +export const SelloutTitle = () => { + const classes = useStyles(); + return ( + + + + ); +}; diff --git a/phone/src/apps/sellout/components/form/ListingForm.js b/phone/src/apps/sellout/components/form/ListingForm.js new file mode 100644 index 0000000..669a91f --- /dev/null +++ b/phone/src/apps/sellout/components/form/ListingForm.js @@ -0,0 +1,64 @@ +import React from "react"; +import { makeStyles, Button, TextField } from "@material-ui/core"; + +const useStyles = makeStyles((theme) => ({ + root: { + width: "100%", + margin: "auto", + textAlign: "center", + }, + input: { + marginBottom: 25, + }, + textFieldInput: { + fontSize: 22, + }, + multilineFieldInput: { + fontSize: 20, + }, + postButton: { + display: "block", + margin: "auto", + background: "#f44336", + width: "80%", + fontSize: 20, + }, +})); + +export const ListingForm = () => { + const classes = useStyles(); + return ( +
+

New Listing

+ + + + + + + +
+ ); +}; diff --git a/phone/src/apps/sellout/components/form/ListingFormContainer.js b/phone/src/apps/sellout/components/form/ListingFormContainer.js new file mode 100644 index 0000000..de5cb54 --- /dev/null +++ b/phone/src/apps/sellout/components/form/ListingFormContainer.js @@ -0,0 +1,10 @@ +import React from 'react' +import { ListingForm } from './ListingForm'; + +export const ListingFormContainer = () => { + return ( +
+ +
+ ) +} diff --git a/phone/src/apps/sellout/components/images/ImageDisplay.js b/phone/src/apps/sellout/components/images/ImageDisplay.js new file mode 100644 index 0000000..d8a0b27 --- /dev/null +++ b/phone/src/apps/sellout/components/images/ImageDisplay.js @@ -0,0 +1,5 @@ +import React from 'react' + +export const ImageDisplay = ({ imgURL }) => { + return Image +} diff --git a/phone/src/apps/sellout/components/navigation/NavigationBar.js b/phone/src/apps/sellout/components/navigation/NavigationBar.js new file mode 100644 index 0000000..3763989 --- /dev/null +++ b/phone/src/apps/sellout/components/navigation/NavigationBar.js @@ -0,0 +1,47 @@ +import React, { useState } from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import { Link } from "react-router-dom"; +import { BottomNavigation, BottomNavigationAction } from "@material-ui/core"; +import HomeIcon from '@material-ui/icons/Home'; +import AddCircleIcon from '@material-ui/icons/AddCircle'; +import FaceIcon from '@material-ui/icons/Face'; + +const useStyles = makeStyles((theme) => ({ + root: { + width: '100%' + }, + icon: { + color: "#f44336" + } +})) + +export const NavigationBar = () => { + const classes = useStyles(); + const [activePage, setActivePage] = useState(0); + return ( + { + setActivePage(newPage) + }} + showLabels + className={classes.root} + > + } + to="/sellout" + /> + } + to="/sellout/new" + /> + } + to="/sellout/profile" + /> + + ) +} diff --git a/phone/src/apps/sellout/hooks/state.js b/phone/src/apps/sellout/hooks/state.js new file mode 100644 index 0000000..a7b02f7 --- /dev/null +++ b/phone/src/apps/sellout/hooks/state.js @@ -0,0 +1,8 @@ +import { atom } from 'recoil'; + +export const selloutState = { + listing: atom({ + key: 'listing', + default: null + }) +} \ No newline at end of file diff --git a/phone/src/apps/sellout/hooks/useListing.js b/phone/src/apps/sellout/hooks/useListing.js new file mode 100644 index 0000000..a090de0 --- /dev/null +++ b/phone/src/apps/sellout/hooks/useListing.js @@ -0,0 +1,7 @@ +import { useRecoilValue } from 'recoil'; +import { selloutState } from './state'; + +export const useListing = () => { + const listing = useRecoilValue(selloutState.listing); + return { listing }; +} diff --git a/phone/src/apps/sellout/hooks/useSelloutService.js b/phone/src/apps/sellout/hooks/useSelloutService.js new file mode 100644 index 0000000..e191e51 --- /dev/null +++ b/phone/src/apps/sellout/hooks/useSelloutService.js @@ -0,0 +1,10 @@ +import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent'; +import { selloutState } from './state'; +import { useListing } from './useListing'; +import { useSetRecoilState } from 'recoil'; + +export const useSelloutService = () => { + const setSellout = useSetRecoilState(selloutState.listing); + useNuiEvent('SELLOUT', 'setListings', setSellout); + return useListing() +} \ No newline at end of file From 3081fcdcdc6f7d1e23601a51ef37cfa15022f516 Mon Sep 17 00:00:00 2001 From: chip Date: Sat, 10 Oct 2020 22:28:02 +0200 Subject: [PATCH 09/20] Tweak(Sellout): Change of header icon --- phone/src/apps/sellout/components/SelloutTitle.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phone/src/apps/sellout/components/SelloutTitle.js b/phone/src/apps/sellout/components/SelloutTitle.js index e16b4d1..99d6daa 100644 --- a/phone/src/apps/sellout/components/SelloutTitle.js +++ b/phone/src/apps/sellout/components/SelloutTitle.js @@ -2,6 +2,8 @@ import React from "react"; import Paper from "@material-ui/core/Paper"; import { makeStyles } from "@material-ui/core"; import LinkedInIcon from "@material-ui/icons/LinkedIn"; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faAd } from '@fortawesome/free-solid-svg-icons' const useStyles = makeStyles((theme) => ({ root: { @@ -23,7 +25,7 @@ export const SelloutTitle = () => { const classes = useStyles(); return ( - + ); }; From dc8604d4d115a86c180d6b8aab05c32dd0390ba2 Mon Sep 17 00:00:00 2001 From: chip Date: Sat, 10 Oct 2020 22:28:36 +0200 Subject: [PATCH 10/20] Feat(useSelloutService in Phone.tsx) --- phone/src/Phone.tsx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/phone/src/Phone.tsx b/phone/src/Phone.tsx index c84c01d..26881e6 100644 --- a/phone/src/Phone.tsx +++ b/phone/src/Phone.tsx @@ -18,6 +18,7 @@ import { useApps } from "./os/apps/hooks/useApps"; import { useContactsService } from "./apps/contacts/hooks/useContactsService"; import { useTwitterService } from "./apps/twitter/hooks/useTwitterService"; +import { useSelloutService } from "./apps/sellout/hooks/useSelloutService"; //These events are just for testing. Comment it out before building. setTimeout(() => { @@ -67,6 +68,33 @@ setTimeout(() => { ); }, 1000); +setTimeout(() => { + window.dispatchEvent( + new MessageEvent('message', { + data: { + app: 'SELLOUT', + method: 'setListings', + data: [ + { + id: 1, + name: 'Donald Trump', + number: '123-4567', + description: 'This is me just selling the whole country, because like why not dude', + img: 'some shady link?' + }, + { + id: 2, + name: 'Joe Biden', + number: '666-6666', + description: 'I think I might buy it Trump!', + img: 'even shadier link?' + } + ] + } + }) + ) +}) + function Phone() { useNuiService(); const { visibility } = usePhoneService(); @@ -76,6 +104,7 @@ function Phone() { useContactsService(); useTwitterService(); useInitKeyboard(); + useSelloutService(); if (visibility === false) { return null; From 9db4c7e0beaebddae771c6271fd61d96c8a3eaf5 Mon Sep 17 00:00:00 2001 From: chip Date: Sat, 10 Oct 2020 22:29:08 +0200 Subject: [PATCH 11/20] Feat(useApps): Adding SelloutIcon app --- phone/src/os/apps/hooks/useApps.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phone/src/os/apps/hooks/useApps.tsx b/phone/src/os/apps/hooks/useApps.tsx index dbdec36..de2aaa1 100644 --- a/phone/src/os/apps/hooks/useApps.tsx +++ b/phone/src/os/apps/hooks/useApps.tsx @@ -7,8 +7,12 @@ import { green, orange, purple, + red, amber, } from "@material-ui/core/colors"; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faAd } from '@fortawesome/free-solid-svg-icons' + import ContactsIcon from "@material-ui/icons/Contacts"; import SettingsIcon from "@material-ui/icons/Settings"; import PhoneIcon from "@material-ui/icons/Phone"; @@ -27,6 +31,7 @@ import { BankApp } from "../../../apps/bank/components/BankApp"; import { MessagesApp } from "../../../apps/messages/components/MessagesApp"; import { TwitterApp } from "../../../apps/twitter/components/TwitterApp"; import { ExampleApp } from "../../../apps/example/components/ExampleApp"; +import { SelloutApp } from "../../../apps/sellout/components/SelloutApp"; const appsState = atom({ key: "apps", @@ -95,6 +100,15 @@ const appsState = atom({ path: "/twitter", Route: () => , }, + { + id: "SELLOUT", + nameLocale: "APPS_SELLOUT", + icon: , + backgroundColor: red[500], + color: common.white, + path: "/sellout", + Route: () => , + }, { id: "EXAMPLE", nameLocale: "APPS_EXAMPLE", From 63de2d9c5692c51e9e9fd6d0ee477df72af98dd3 Mon Sep 17 00:00:00 2001 From: chip Date: Sat, 10 Oct 2020 22:40:47 +0200 Subject: [PATCH 12/20] Sellout app changed to TS, like how did I not see that --- .../src/apps/sellout/components/{SelloutApp.js => SelloutApp.tsx} | 0 .../components/SelloutList/{SelloutItem.js => SelloutItem.tsx} | 0 .../components/SelloutList/{SelloutList.js => SelloutList.tsx} | 0 .../{SelloutListContainer.js => SelloutListContainer.tsx} | 0 .../apps/sellout/components/{SelloutTitle.js => SelloutTitle.tsx} | 0 phone/src/apps/sellout/hooks/{state.js => state.ts} | 0 phone/src/apps/sellout/hooks/{useListing.js => useListing.ts} | 0 .../sellout/hooks/{useSelloutService.js => useSelloutService.ts} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename phone/src/apps/sellout/components/{SelloutApp.js => SelloutApp.tsx} (100%) rename phone/src/apps/sellout/components/SelloutList/{SelloutItem.js => SelloutItem.tsx} (100%) rename phone/src/apps/sellout/components/SelloutList/{SelloutList.js => SelloutList.tsx} (100%) rename phone/src/apps/sellout/components/SelloutList/{SelloutListContainer.js => SelloutListContainer.tsx} (100%) rename phone/src/apps/sellout/components/{SelloutTitle.js => SelloutTitle.tsx} (100%) rename phone/src/apps/sellout/hooks/{state.js => state.ts} (100%) rename phone/src/apps/sellout/hooks/{useListing.js => useListing.ts} (100%) rename phone/src/apps/sellout/hooks/{useSelloutService.js => useSelloutService.ts} (100%) diff --git a/phone/src/apps/sellout/components/SelloutApp.js b/phone/src/apps/sellout/components/SelloutApp.tsx similarity index 100% rename from phone/src/apps/sellout/components/SelloutApp.js rename to phone/src/apps/sellout/components/SelloutApp.tsx diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutItem.js b/phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx similarity index 100% rename from phone/src/apps/sellout/components/SelloutList/SelloutItem.js rename to phone/src/apps/sellout/components/SelloutList/SelloutItem.tsx diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutList.js b/phone/src/apps/sellout/components/SelloutList/SelloutList.tsx similarity index 100% rename from phone/src/apps/sellout/components/SelloutList/SelloutList.js rename to phone/src/apps/sellout/components/SelloutList/SelloutList.tsx diff --git a/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.js b/phone/src/apps/sellout/components/SelloutList/SelloutListContainer.tsx similarity index 100% rename from phone/src/apps/sellout/components/SelloutList/SelloutListContainer.js rename to phone/src/apps/sellout/components/SelloutList/SelloutListContainer.tsx diff --git a/phone/src/apps/sellout/components/SelloutTitle.js b/phone/src/apps/sellout/components/SelloutTitle.tsx similarity index 100% rename from phone/src/apps/sellout/components/SelloutTitle.js rename to phone/src/apps/sellout/components/SelloutTitle.tsx diff --git a/phone/src/apps/sellout/hooks/state.js b/phone/src/apps/sellout/hooks/state.ts similarity index 100% rename from phone/src/apps/sellout/hooks/state.js rename to phone/src/apps/sellout/hooks/state.ts diff --git a/phone/src/apps/sellout/hooks/useListing.js b/phone/src/apps/sellout/hooks/useListing.ts similarity index 100% rename from phone/src/apps/sellout/hooks/useListing.js rename to phone/src/apps/sellout/hooks/useListing.ts diff --git a/phone/src/apps/sellout/hooks/useSelloutService.js b/phone/src/apps/sellout/hooks/useSelloutService.ts similarity index 100% rename from phone/src/apps/sellout/hooks/useSelloutService.js rename to phone/src/apps/sellout/hooks/useSelloutService.ts From aec8956500893c4180704a329cf2533c9ef352ef Mon Sep 17 00:00:00 2001 From: chip Date: Sun, 11 Oct 2020 02:11:04 +0200 Subject: [PATCH 13/20] Feat(UI): Added interfaces for UI components --- phone/src/ui/interface/InterfaceUI.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 phone/src/ui/interface/InterfaceUI.ts diff --git a/phone/src/ui/interface/InterfaceUI.ts b/phone/src/ui/interface/InterfaceUI.ts new file mode 100644 index 0000000..0af07db --- /dev/null +++ b/phone/src/ui/interface/InterfaceUI.ts @@ -0,0 +1,12 @@ +export interface AppContentTypes { + children: any; + style?: any; + backdrop?: any; + onClickBackdrop?: any; +} + +export interface AppWrapperTypes { + children: any; + style?: any; + handleClickAway?: any; +} \ No newline at end of file From af60384e747f90332fb2350f90e17b4b6e04cdee Mon Sep 17 00:00:00 2001 From: chip Date: Sun, 11 Oct 2020 02:11:47 +0200 Subject: [PATCH 14/20] Fix(Sellout): Fixed NavigationBar --- .../components/navigation/NavigationBar.tsx | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 phone/src/apps/sellout/components/navigation/NavigationBar.tsx diff --git a/phone/src/apps/sellout/components/navigation/NavigationBar.tsx b/phone/src/apps/sellout/components/navigation/NavigationBar.tsx new file mode 100644 index 0000000..3b13dd6 --- /dev/null +++ b/phone/src/apps/sellout/components/navigation/NavigationBar.tsx @@ -0,0 +1,48 @@ +import React, { useState } from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import { Link } from "react-router-dom"; +import { BottomNavigation, BottomNavigationAction } from "@material-ui/core"; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faHome } from '@fortawesome/free-solid-svg-icons' +import AddCircleIcon from '@material-ui/icons/AddCircle'; +import FaceIcon from '@material-ui/icons/Face'; + +const useStyles = makeStyles((theme) => ({ + root: { + width: '100%' + }, + icon: { + color: "#f44336" + } +})) + +export const NavigationBar = () => { + const classes = useStyles(); + const [activePage, setActivePage] = useState(0); + return ( + { + setActivePage(newPage) + }} + showLabels + className={classes.root} + > + } + to="/sellout" + /> + } + to="/sellout/new" + /> + } + to="/sellout/new" + /> + + ) +} From 0c3c76efd5181592c3e82d7498ddfbf137b68168 Mon Sep 17 00:00:00 2001 From: chip Date: Sun, 11 Oct 2020 02:12:45 +0200 Subject: [PATCH 15/20] Feat(UI): Types added to AppContent & AppWrapper --- phone/src/ui/components/AppContent.tsx | 3 ++- phone/src/ui/components/AppWrapper.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phone/src/ui/components/AppContent.tsx b/phone/src/ui/components/AppContent.tsx index 570f5e2..d2181a7 100644 --- a/phone/src/ui/components/AppContent.tsx +++ b/phone/src/ui/components/AppContent.tsx @@ -1,5 +1,6 @@ import React from "react"; import { Box, makeStyles, Backdrop, Paper } from "@material-ui/core"; +import { AppContentTypes } from '../interface/InterfaceUI'; const useStyles = makeStyles((theme) => ({ wrapper: { @@ -28,7 +29,7 @@ export const AppContent = ({ backdrop, onClickBackdrop, ...props -}) => { +}: AppContentTypes) => { const classes = useStyles(); return ( diff --git a/phone/src/ui/components/AppWrapper.tsx b/phone/src/ui/components/AppWrapper.tsx index b6ecaba..92a5e45 100644 --- a/phone/src/ui/components/AppWrapper.tsx +++ b/phone/src/ui/components/AppWrapper.tsx @@ -1,6 +1,7 @@ import React from "react"; +import { AppWrapperTypes } from '../interface/InterfaceUI'; -export const AppWrapper = ({ children, style, handleClickAway, ...props }) => { +export const AppWrapper = ({ children, style, handleClickAway, ...props }: AppWrapperTypes) => { return (
Date: Sun, 11 Oct 2020 02:13:42 +0200 Subject: [PATCH 16/20] Tweak(Sellout): Navigation Component JS > TSX --- .../components/navigation/NavigationBar.js | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 phone/src/apps/sellout/components/navigation/NavigationBar.js diff --git a/phone/src/apps/sellout/components/navigation/NavigationBar.js b/phone/src/apps/sellout/components/navigation/NavigationBar.js deleted file mode 100644 index 3763989..0000000 --- a/phone/src/apps/sellout/components/navigation/NavigationBar.js +++ /dev/null @@ -1,47 +0,0 @@ -import React, { useState } from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import { Link } from "react-router-dom"; -import { BottomNavigation, BottomNavigationAction } from "@material-ui/core"; -import HomeIcon from '@material-ui/icons/Home'; -import AddCircleIcon from '@material-ui/icons/AddCircle'; -import FaceIcon from '@material-ui/icons/Face'; - -const useStyles = makeStyles((theme) => ({ - root: { - width: '100%' - }, - icon: { - color: "#f44336" - } -})) - -export const NavigationBar = () => { - const classes = useStyles(); - const [activePage, setActivePage] = useState(0); - return ( - { - setActivePage(newPage) - }} - showLabels - className={classes.root} - > - } - to="/sellout" - /> - } - to="/sellout/new" - /> - } - to="/sellout/profile" - /> - - ) -} From 329a13dcc4a3f07e7e385848ac3981c32e947e60 Mon Sep 17 00:00:00 2001 From: chip Date: Sun, 11 Oct 2020 02:14:40 +0200 Subject: [PATCH 17/20] Feat(Sellout): Added colors on navigaton bar icons --- phone/src/apps/sellout/components/Sellout.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phone/src/apps/sellout/components/Sellout.css b/phone/src/apps/sellout/components/Sellout.css index e69de29..af2ac60 100644 --- a/phone/src/apps/sellout/components/Sellout.css +++ b/phone/src/apps/sellout/components/Sellout.css @@ -0,0 +1,3 @@ +#sellout-app .Mui-selected { + color: #f44336 !important; +} \ No newline at end of file From e7f8043dd9ae34c49d9510dc2fe98919d877ffcb Mon Sep 17 00:00:00 2001 From: chip Date: Sun, 11 Oct 2020 02:19:53 +0200 Subject: [PATCH 18/20] Changed last files to tsx --- .../sellout/components/form/{ListingForm.js => ListingForm.tsx} | 0 .../form/{ListingFormContainer.js => ListingFormContainer.tsx} | 0 .../components/images/{ImageDisplay.js => ImageDisplay.tsx} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename phone/src/apps/sellout/components/form/{ListingForm.js => ListingForm.tsx} (100%) rename phone/src/apps/sellout/components/form/{ListingFormContainer.js => ListingFormContainer.tsx} (100%) rename phone/src/apps/sellout/components/images/{ImageDisplay.js => ImageDisplay.tsx} (100%) diff --git a/phone/src/apps/sellout/components/form/ListingForm.js b/phone/src/apps/sellout/components/form/ListingForm.tsx similarity index 100% rename from phone/src/apps/sellout/components/form/ListingForm.js rename to phone/src/apps/sellout/components/form/ListingForm.tsx diff --git a/phone/src/apps/sellout/components/form/ListingFormContainer.js b/phone/src/apps/sellout/components/form/ListingFormContainer.tsx similarity index 100% rename from phone/src/apps/sellout/components/form/ListingFormContainer.js rename to phone/src/apps/sellout/components/form/ListingFormContainer.tsx diff --git a/phone/src/apps/sellout/components/images/ImageDisplay.js b/phone/src/apps/sellout/components/images/ImageDisplay.tsx similarity index 100% rename from phone/src/apps/sellout/components/images/ImageDisplay.js rename to phone/src/apps/sellout/components/images/ImageDisplay.tsx From c6e8baac5659cf1cadfd3847113276c3440fcd50 Mon Sep 17 00:00:00 2001 From: chip Date: Sun, 11 Oct 2020 15:26:04 +0200 Subject: [PATCH 19/20] Barebone start on lua > ts --- resources/client/client.ts | 12 ++++++------ resources/server/server.ts | 9 ++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/resources/client/client.ts b/resources/client/client.ts index d03f94e..81bc6d1 100644 --- a/resources/client/client.ts +++ b/resources/client/client.ts @@ -1,7 +1,7 @@ -setImmediate(() => { - emitNet("helloserver"); -}); +let ESX = null; -onNet("helloclient", (message) => { - console.log(`The server replied: ${message}`); -}); +setTick(() => { + while (ESX === null) { + emit('esx:getSharedObject', (obj) => ESX = obj); + } +}); \ No newline at end of file diff --git a/resources/server/server.ts b/resources/server/server.ts index 9b6e429..d8770b5 100644 --- a/resources/server/server.ts +++ b/resources/server/server.ts @@ -1,8 +1,3 @@ -onNet("helloserver", () => { - const _source = (global as any).source; +let ESX = null; - const test = (x) => x; - console.log(`Hello from ${_source}`); - - emitNet("helloclient", _source, "i got your message!"); -}); +emit('esx:getSharedObject', (obj) => ESX = obj); \ No newline at end of file From db9f99d9c750a92bdae911150a0bef6f33d6be39 Mon Sep 17 00:00:00 2001 From: chip Date: Sun, 11 Oct 2020 15:27:17 +0200 Subject: [PATCH 20/20] Installed fontawesome package --- phone/package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phone/package.json b/phone/package.json index 685003a..9010876 100644 --- a/phone/package.json +++ b/phone/package.json @@ -4,6 +4,10 @@ "private": true, "dependencies": { "@babel/polyfill": "^7.4.4", + "@fortawesome/fontawesome-free": "^5.15.1", + "@fortawesome/fontawesome-svg-core": "^1.2.32", + "@fortawesome/free-solid-svg-icons": "^5.15.1", + "@fortawesome/react-fontawesome": "^0.1.11", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.56",