mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
working typescript version
This commit is contained in:
1 parent
581d6011e0
commit
cff746aa38
119 files changed
+247
-189
No files matched your search
+10
-10
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"presets": [
|
"presets": [
|
||||||
[
|
[
|
||||||
"@babel/preset-env",
|
"@babel/preset-env",
|
||||||
{
|
{
|
||||||
"modules": false
|
"modules": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@babel/preset-react"
|
"@babel/preset-react"
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@babel/plugin-proposal-class-properties",
|
"@babel/plugin-proposal-class-properties",
|
||||||
"@babel/plugin-syntax-dynamic-import"
|
"@babel/plugin-syntax-dynamic-import"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+7
-2
@@ -35,6 +35,9 @@
|
|||||||
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
|
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
|
||||||
"@babel/preset-env": "^7.4.5",
|
"@babel/preset-env": "^7.4.5",
|
||||||
"@babel/preset-react": "^7.0.0",
|
"@babel/preset-react": "^7.0.0",
|
||||||
|
"@types/node": "^14.11.5",
|
||||||
|
"@types/react": "^16.9.51",
|
||||||
|
"@types/react-dom": "^16.9.8",
|
||||||
"babel-eslint": "^10.0.1",
|
"babel-eslint": "^10.0.1",
|
||||||
"babel-loader": "^8.1.0",
|
"babel-loader": "^8.1.0",
|
||||||
"babel-plugin-styled-components": "^1.10.0",
|
"babel-plugin-styled-components": "^1.10.0",
|
||||||
@@ -50,6 +53,8 @@
|
|||||||
"style-loader": "^0.23.1",
|
"style-loader": "^0.23.1",
|
||||||
"svg-url-loader": "^2.3.2",
|
"svg-url-loader": "^2.3.2",
|
||||||
"terser-webpack-plugin": "^1.3.0",
|
"terser-webpack-plugin": "^1.3.0",
|
||||||
|
"ts-loader": "^8.0.4",
|
||||||
|
"typescript": "^4.0.3",
|
||||||
"url-loader": "^1.1.2",
|
"url-loader": "^1.1.2",
|
||||||
"webpack-cli": "^3.3.12"
|
"webpack-cli": "^3.3.12"
|
||||||
},
|
},
|
||||||
@@ -58,8 +63,8 @@
|
|||||||
"watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js",
|
"watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"build:resources": "cross-env NODE_ENV=production webpack --config webpack/webpack.resources.js --color -p --progress --hide-modules --display-optimization-bailout",
|
"build:resources": "cross-env NODE_ENV=production webpack --config webpack/webpack.resources.js --color -p --progress --hide-modules --display-optimization-bailout",
|
||||||
"test": "react-scripts test --watchAll=false --testMatch **/src/**/*.test.js",
|
"test": "react-scripts test --watchAll=false --testMatch **/src/**/*.test.[jt]s?(x)",
|
||||||
"test:watch": "react-scripts test --watchAll --testMatch **/src/**/*.test.js",
|
"test:watch": "react-scripts test --watchAll --testMatch **/src/**/*.test.[jt]s?(x)",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
/// <reference types="react-scripts" />
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,31 +0,0 @@
|
|||||||
import { useRecoilState, atom } from 'recoil';
|
|
||||||
|
|
||||||
const transactionListState = atom({
|
|
||||||
key: 'transactionList',
|
|
||||||
default: [
|
|
||||||
{
|
|
||||||
id: 0,
|
|
||||||
amount: 300,
|
|
||||||
type: 'withdraw',
|
|
||||||
date: '3'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
amount: 1000,
|
|
||||||
type: 'withdraw',
|
|
||||||
date: '3'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
amount: 50,
|
|
||||||
type: 'transfer',
|
|
||||||
date: '2'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
export const useBank = () => {
|
|
||||||
const [transactionList, setTransactionList] = useRecoilState
|
|
||||||
(transactionListState);
|
|
||||||
return { transactionList, setTransactionList };
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { useRecoilState, atom } from "recoil";
|
||||||
|
|
||||||
|
const transactionListState = atom({
|
||||||
|
key: "transactionList",
|
||||||
|
default: [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
amount: 300,
|
||||||
|
type: "withdraw",
|
||||||
|
date: "3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
amount: 1000,
|
||||||
|
type: "withdraw",
|
||||||
|
date: "3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
amount: 50,
|
||||||
|
type: "transfer",
|
||||||
|
date: "2",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
export const useBank = () => {
|
||||||
|
const [transactionList, setTransactionList] = useRecoilState(
|
||||||
|
transactionListState
|
||||||
|
);
|
||||||
|
return { transactionList, setTransactionList };
|
||||||
|
};
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+6
-2
@@ -127,7 +127,7 @@ export const AddTweetModal = () => {
|
|||||||
withValidImage(cleanedLink, () => setImages([...images, image]));
|
withValidImage(cleanedLink, () => setImages([...images, image]));
|
||||||
|
|
||||||
setShowImagePrompt(false);
|
setShowImagePrompt(false);
|
||||||
setLink('')
|
setLink("");
|
||||||
};
|
};
|
||||||
const removeImage = (id) =>
|
const removeImage = (id) =>
|
||||||
setImages(images.filter((image) => id !== image.id));
|
setImages(images.filter((image) => id !== image.id));
|
||||||
@@ -171,7 +171,11 @@ export const AddTweetModal = () => {
|
|||||||
/>
|
/>
|
||||||
<div className={classes.buttonsContainer}>
|
<div className={classes.buttonsContainer}>
|
||||||
<IconButtons
|
<IconButtons
|
||||||
onImageClick={images.length < config.twitter.maxImages ? toggleShowImagePrompt : null}
|
onImageClick={
|
||||||
|
images.length < config.twitter.maxImages
|
||||||
|
? toggleShowImagePrompt
|
||||||
|
: null
|
||||||
|
}
|
||||||
onEmojiClick={toggleShowEmoji}
|
onEmojiClick={toggleShowEmoji}
|
||||||
/>
|
/>
|
||||||
<ControlButtons
|
<ControlButtons
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+11
-7
@@ -21,18 +21,22 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
export const IconButtons = ({ onImageClick, onEmojiClick }) => {
|
export const IconButtons = ({ onImageClick, onEmojiClick }) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { config } = usePhone();
|
const { config } = usePhone();
|
||||||
|
|
||||||
if (!config) return null;
|
if (!config) return null;
|
||||||
const { enableImages, enableEmojis } = config.twitter;
|
const { enableImages, enableEmojis } = config.twitter;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.buttons}>
|
<div className={classes.buttons}>
|
||||||
{enableImages && (<Button className={classes.button} onClick={onImageClick}>
|
{enableImages && (
|
||||||
<InsertPhotoIcon color="action" />
|
<Button className={classes.button} onClick={onImageClick}>
|
||||||
</Button>)}
|
<InsertPhotoIcon color="action" />
|
||||||
{enableEmojis && (<Button className={classes.button} onClick={onEmojiClick}>
|
</Button>
|
||||||
<EmojiIcon color="action" />
|
)}
|
||||||
</Button>)}
|
{enableEmojis && (
|
||||||
|
<Button className={classes.button} onClick={onEmojiClick}>
|
||||||
|
<EmojiIcon color="action" />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-2
@@ -27,7 +27,6 @@ export function Profile() {
|
|||||||
const { profile } = useProfile();
|
const { profile } = useProfile();
|
||||||
const { config } = usePhone();
|
const { config } = usePhone();
|
||||||
|
|
||||||
|
|
||||||
// note that this assumes we are defensively checking
|
// note that this assumes we are defensively checking
|
||||||
// that profile is not null in a parent above this component.
|
// that profile is not null in a parent above this component.
|
||||||
// Annoyingling adding conditionals above this line to not render
|
// Annoyingling adding conditionals above this line to not render
|
||||||
@@ -50,7 +49,7 @@ export function Profile() {
|
|||||||
Nui.send("phone:updateTwitterProfile", data);
|
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;
|
if (!config) return null;
|
||||||
|
|
||||||
const { enableAvatars, allowEdtiableProfileName } = config.twitter;
|
const { enableAvatars, allowEdtiableProfileName } = config.twitter;
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+5
-2
@@ -23,8 +23,11 @@ export const TweetMessage = ({ message, handleChange }) => {
|
|||||||
const { config } = usePhone();
|
const { config } = usePhone();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const overCharacterLimit = message.trim().length > config.twitter.characterLimit;
|
const overCharacterLimit =
|
||||||
const characterWarningPrompt = `${t("APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT")} (${config.twitter.characterLimit})`;
|
message.trim().length > config.twitter.characterLimit;
|
||||||
|
const characterWarningPrompt = `${t(
|
||||||
|
"APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT"
|
||||||
|
)} (${config.twitter.characterLimit})`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TextField
|
<TextField
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -12,7 +12,10 @@ const DAYS = "APPS_TWITTER_TIME_DAYS";
|
|||||||
* @param {function} t - translation object passed from a component implementing the hook
|
* @param {function} t - translation object passed from a component implementing the hook
|
||||||
* @param {number} seconds - seconds to translate to a string
|
* @param {number} seconds - seconds to translate to a string
|
||||||
*/
|
*/
|
||||||
export function secondsToHumanReadable(t, seconds) {
|
export function secondsToHumanReadable(
|
||||||
|
t: (input: string) => string,
|
||||||
|
seconds: number
|
||||||
|
): string {
|
||||||
if (seconds < 60) {
|
if (seconds < 60) {
|
||||||
return t(JUST_NOW);
|
return t(JUST_NOW);
|
||||||
} else if (seconds < ONE_HOUR) {
|
} else if (seconds < ONE_HOUR) {
|
||||||
@@ -2,17 +2,17 @@ import Default from "../default.json";
|
|||||||
import { atom, useRecoilState } from "recoil";
|
import { atom, useRecoilState } from "recoil";
|
||||||
|
|
||||||
const configState = atom({
|
const configState = atom({
|
||||||
key: 'config',
|
key: "config",
|
||||||
default: Default
|
default: Default,
|
||||||
})
|
});
|
||||||
|
|
||||||
export const useConfig = (state = configState) => {
|
export const useConfig = (state = configState) => {
|
||||||
const [config, _setConfig] = useRecoilState(state)
|
const [config, _setConfig] = useRecoilState(state);
|
||||||
|
|
||||||
const setConfig = (key, value) => {
|
const setConfig = (key, value) => {
|
||||||
_setConfig(oldConfig => ({
|
_setConfig((oldConfig) => ({
|
||||||
...oldConfig,
|
...oldConfig,
|
||||||
[key]: value
|
[key]: value,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ import { initReactI18next } from "react-i18next";
|
|||||||
import en from "./locale/en.json";
|
import en from "./locale/en.json";
|
||||||
|
|
||||||
const resources = {
|
const resources = {
|
||||||
en
|
en,
|
||||||
};
|
};
|
||||||
|
|
||||||
i18n
|
i18n
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+6
-3
@@ -78,9 +78,12 @@ export const useInitKeyboard = () => {
|
|||||||
[getters]
|
[getters]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(function registerEscapeHandler() {
|
useEffect(
|
||||||
setEscape({ handler: () => console.log("close phone") });
|
function registerEscapeHandler() {
|
||||||
}, [setEscape]);
|
setEscape({ handler: () => console.log("close phone") });
|
||||||
|
},
|
||||||
|
[setEscape]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useKeyboard = () => {
|
export const useKeyboard = () => {
|
||||||
File renamed without changes.
File renamed without changes.
+7
-2
@@ -20,7 +20,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
color: theme.palette.text.primary,
|
color: theme.palette.text.primary,
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
padding: '4px',
|
padding: "4px",
|
||||||
color: theme.palette.text.primary,
|
color: theme.palette.text.primary,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@@ -36,7 +36,12 @@ export const NotificationBar = ({ notifications = [] }) => {
|
|||||||
>
|
>
|
||||||
<Grid container item wrap="nowrap">
|
<Grid container item wrap="nowrap">
|
||||||
{notifications.map((notification) => (
|
{notifications.map((notification) => (
|
||||||
<Grid item key={notification.key} component={IconButton} className={classes.icon}>
|
<Grid
|
||||||
|
item
|
||||||
|
key={notification.key}
|
||||||
|
component={IconButton}
|
||||||
|
className={classes.icon}
|
||||||
|
>
|
||||||
{notification.icon}
|
{notification.icon}
|
||||||
</Grid>
|
</Grid>
|
||||||
))}
|
))}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
/// <reference types="react-scripts" />
|
||||||
@@ -11,9 +11,9 @@
|
|||||||
// opt-in, read https://bit.ly/CRA-PWA
|
// opt-in, read https://bit.ly/CRA-PWA
|
||||||
|
|
||||||
const isLocalhost = Boolean(
|
const isLocalhost = Boolean(
|
||||||
window.location.hostname === 'localhost' ||
|
window.location.hostname === "localhost" ||
|
||||||
// [::1] is the IPv6 localhost address.
|
// [::1] is the IPv6 localhost address.
|
||||||
window.location.hostname === '[::1]' ||
|
window.location.hostname === "[::1]" ||
|
||||||
// 127.0.0.0/8 are considered localhost for IPv4.
|
// 127.0.0.0/8 are considered localhost for IPv4.
|
||||||
window.location.hostname.match(
|
window.location.hostname.match(
|
||||||
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
/^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) {
|
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.
|
// The URL constructor is available in all browsers that support SW.
|
||||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
||||||
if (publicUrl.origin !== window.location.origin) {
|
if (publicUrl.origin !== window.location.origin) {
|
||||||
@@ -31,7 +31,7 @@ export function register(config) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
window.addEventListener("load", () => {
|
||||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||||
|
|
||||||
if (isLocalhost) {
|
if (isLocalhost) {
|
||||||
@@ -42,8 +42,8 @@ export function register(config) {
|
|||||||
// service worker/PWA documentation.
|
// service worker/PWA documentation.
|
||||||
navigator.serviceWorker.ready.then(() => {
|
navigator.serviceWorker.ready.then(() => {
|
||||||
console.log(
|
console.log(
|
||||||
'This web app is being served cache-first by a service ' +
|
"This web app is being served cache-first by a service " +
|
||||||
'worker. To learn more, visit https://bit.ly/CRA-PWA'
|
"worker. To learn more, visit https://bit.ly/CRA-PWA"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -57,21 +57,21 @@ export function register(config) {
|
|||||||
function registerValidSW(swUrl, config) {
|
function registerValidSW(swUrl, config) {
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
.register(swUrl)
|
.register(swUrl)
|
||||||
.then(registration => {
|
.then((registration) => {
|
||||||
registration.onupdatefound = () => {
|
registration.onupdatefound = () => {
|
||||||
const installingWorker = registration.installing;
|
const installingWorker = registration.installing;
|
||||||
if (installingWorker == null) {
|
if (installingWorker == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
installingWorker.onstatechange = () => {
|
installingWorker.onstatechange = () => {
|
||||||
if (installingWorker.state === 'installed') {
|
if (installingWorker.state === "installed") {
|
||||||
if (navigator.serviceWorker.controller) {
|
if (navigator.serviceWorker.controller) {
|
||||||
// At this point, the updated precached content has been fetched,
|
// At this point, the updated precached content has been fetched,
|
||||||
// but the previous service worker will still serve the older
|
// but the previous service worker will still serve the older
|
||||||
// content until all client tabs are closed.
|
// content until all client tabs are closed.
|
||||||
console.log(
|
console.log(
|
||||||
'New content is available and will be used when all ' +
|
"New content is available and will be used when all " +
|
||||||
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
|
"tabs for this page are closed. See https://bit.ly/CRA-PWA."
|
||||||
);
|
);
|
||||||
|
|
||||||
// Execute callback
|
// Execute callback
|
||||||
@@ -82,7 +82,7 @@ function registerValidSW(swUrl, config) {
|
|||||||
// At this point, everything has been precached.
|
// At this point, everything has been precached.
|
||||||
// It's the perfect time to display a
|
// It's the perfect time to display a
|
||||||
// "Content is cached for offline use." message.
|
// "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
|
// Execute callback
|
||||||
if (config && config.onSuccess) {
|
if (config && config.onSuccess) {
|
||||||
@@ -93,25 +93,25 @@ function registerValidSW(swUrl, config) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
console.error('Error during service worker registration:', error);
|
console.error("Error during service worker registration:", error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkValidServiceWorker(swUrl, config) {
|
function checkValidServiceWorker(swUrl, config) {
|
||||||
// Check if the service worker can be found. If it can't reload the page.
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
fetch(swUrl, {
|
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.
|
// 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 (
|
if (
|
||||||
response.status === 404 ||
|
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.
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
navigator.serviceWorker.ready.then(registration => {
|
navigator.serviceWorker.ready.then((registration) => {
|
||||||
registration.unregister().then(() => {
|
registration.unregister().then(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
@@ -123,18 +123,18 @@ function checkValidServiceWorker(swUrl, config) {
|
|||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
console.log(
|
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() {
|
export function unregister() {
|
||||||
if ('serviceWorker' in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
navigator.serviceWorker.ready
|
navigator.serviceWorker.ready
|
||||||
.then(registration => {
|
.then((registration) => {
|
||||||
registration.unregister();
|
registration.unregister();
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
console.error(error.message);
|
console.error(error.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
File renamed without changes.
File renamed without changes.
@@ -10,7 +10,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
"& > *": {
|
"& > *": {
|
||||||
margin: theme.spacing(1),
|
margin: theme.spacing(1),
|
||||||
},
|
},
|
||||||
padding: 0
|
padding: 0,
|
||||||
},
|
},
|
||||||
avatar: {
|
avatar: {
|
||||||
backgroundColor: ({ backgroundColor }) => backgroundColor,
|
backgroundColor: ({ backgroundColor }) => backgroundColor,
|
||||||
@@ -18,11 +18,14 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
width: theme.spacing(7),
|
width: theme.spacing(7),
|
||||||
height: theme.spacing(7),
|
height: theme.spacing(7),
|
||||||
fontSize: theme.typography.h4.fontSize,
|
fontSize: theme.typography.h4.fontSize,
|
||||||
}
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const AppIcon = ({ name, icon, backgroundColor, color }) => {
|
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 (
|
return (
|
||||||
<Button className={classes.root}>
|
<Button className={classes.root}>
|
||||||
<Avatar className={classes.avatar}>
|
<Avatar className={classes.avatar}>
|
||||||
File renamed without changes.
@@ -10,7 +10,7 @@ export const AppWrapper = ({ children, style, handleClickAway, ...props }) => {
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
position: 'relative',
|
position: "relative",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
...style,
|
...style,
|
||||||
}}
|
}}
|
||||||
File renamed without changes.
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user