From 5c1daf21111c7287dec677972bdb4005e719b4d5 Mon Sep 17 00:00:00 2001 From: Tim Cheung Date: Mon, 22 Jan 2024 14:32:55 +0000 Subject: [PATCH] improve popup menu --- package-lock.json | 9 +++++++++ package.json | 1 + src/popup/components/list-item-link.js | 15 ++++++++++++++- src/popup/sections/about.js | 9 +++++++-- src/popup/sections/general.js | 7 ++++--- src/popup/sections/help.js | 5 ++--- 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 91c45fb7..d6d7aa65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "js-cookie": "^2.2.1", "ky": "^0.11.1", "lodash": "^4.17.10", + "lucide-react": "^0.314.0", "mem": "^4.0.0", "p-memoize": "^1.0.0", "p-retry": "^1.0.0", @@ -10247,6 +10248,14 @@ "node": ">=10" } }, + "node_modules/lucide-react": { + "version": "0.314.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.314.0.tgz", + "integrity": "sha512-c2zOW7TOyKxPCaSs1og2lFdoI3SR4iii3yrZJU2Zpdc78nOw4fUmrcFNultaCiwZcr4CyiKdzjMdvKNlBBk+UQ==", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", diff --git a/package.json b/package.json index 9d4da017..7b76790e 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "js-cookie": "^2.2.1", "ky": "^0.11.1", "lodash": "^4.17.10", + "lucide-react": "^0.314.0", "mem": "^4.0.0", "p-memoize": "^1.0.0", "p-retry": "^1.0.0", diff --git a/src/popup/components/list-item-link.js b/src/popup/components/list-item-link.js index f2dbaaf7..e6b04a20 100644 --- a/src/popup/components/list-item-link.js +++ b/src/popup/components/list-item-link.js @@ -1,8 +1,16 @@ import ListItem from '@material-ui/core/ListItem' import ListItemText from '@material-ui/core/ListItemText' +import { ExternalLink } from 'lucide-react' import React from 'react' -export default ({ href, faceit, steamCommunity, subreddit, ...props }) => { +export default ({ + href, + faceit, + steamCommunity, + subreddit, + twitter, + ...props +}) => { let link = href if (faceit) { @@ -13,11 +21,16 @@ export default ({ href, faceit, steamCommunity, subreddit, ...props }) => { link = `https://www.reddit.com/r/repeekgg/${ typeof subreddit === 'string' ? subreddit : '' }` + } else if (twitter) { + link = `https://www.twitter.com/${twitter}` } return ( +
+ +
) } diff --git a/src/popup/sections/about.js b/src/popup/sections/about.js index 72f8df1b..627061e8 100644 --- a/src/popup/sections/about.js +++ b/src/popup/sections/about.js @@ -1,6 +1,7 @@ import React from 'react' import { version } from '../../manifest' import ListItemLink from '../components/list-item-link' +import ListItemText from '../components/list-item-text' import ListSubheader from '../components/list-subheader' export const ABOUT = 'About' @@ -8,7 +9,7 @@ export const ABOUT = 'About' export default () => ( About - + ( /> Team - + ) diff --git a/src/popup/sections/general.js b/src/popup/sections/general.js index 7e566ed4..63f4e6ae 100644 --- a/src/popup/sections/general.js +++ b/src/popup/sections/general.js @@ -33,11 +33,12 @@ export default ({ getSwitchProps }) => { secondary="FACEIT will be enhanced." {...getSwitchProps('extensionEnabled')} /> + FACEIT Beta {typeof hasFaceitBetaHostPermission === 'boolean' && typeof extensionEnabledFaceitBeta === 'boolean' && ( { if (!hasFaceitBetaHostPermission) { await requestFaceitBetaHostPermission() @@ -56,7 +57,7 @@ export default ({ getSwitchProps }) => { )} diff --git a/src/popup/sections/help.js b/src/popup/sections/help.js index 26dd6c92..20437c0e 100644 --- a/src/popup/sections/help.js +++ b/src/popup/sections/help.js @@ -11,7 +11,7 @@ export const HELP = 'Help' export default () => ( - Issues? + Issues/Questions? ( }\nBrowser: ${capitalize(userBrowser.name)} (${userBrowser.version})`, )} /> - Questions? - + )