Skip to content

Commit

Permalink
improve popup menu
Browse files Browse the repository at this point in the history
  • Loading branch information
timche committed Jan 23, 2024
1 parent 51c90fa commit 5c1daf2
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 9 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 14 additions & 1 deletion src/popup/components/list-item-link.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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 (
<ListItem button component="a" href={link} target="_blank">
<ListItemText {...props} />
<div style={{ marginLeft: 16 }}>
<ExternalLink size={16} color="#999b9d" />
</div>
</ListItem>
)
}
9 changes: 7 additions & 2 deletions src/popup/sections/about.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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'

export default () => (
<React.Fragment>
<ListSubheader>About</ListSubheader>
<ListItemLink primary="Version" secondary={version} />
<ListItemText primary="Version" secondary={version} />
<ListItemLink
primary="Website"
secondary="repeek.gg"
Expand All @@ -28,6 +29,10 @@ export default () => (
/>
<ListItemLink primary="Steam" steamCommunity="groups/repeekdotgg" />
<ListSubheader divider>Team</ListSubheader>
<ListItemLink primary="azn" secondary="Creator & Developer" faceit="azn" />
<ListItemLink
primary="timche"
secondary="Creator & Developer"
twitter="timche_"
/>
</React.Fragment>
)
7 changes: 4 additions & 3 deletions src/popup/sections/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ export default ({ getSwitchProps }) => {
secondary="FACEIT will be enhanced."
{...getSwitchProps('extensionEnabled')}
/>
<ListSubheader>FACEIT Beta</ListSubheader>
{typeof hasFaceitBetaHostPermission === 'boolean' &&
typeof extensionEnabledFaceitBeta === 'boolean' && (
<ListItemSwitch
primary="Enabled on FACEIT Beta"
secondary="FACEIT Beta (beta.faceit.com) will be enhanced. Please note that the FACEIT Beta is considered unstable, so Repeek will be as well. If you experience any issues with Repeek, please report them on Reddit or Twitter."
primary="Enabled"
secondary="FACEIT Beta (beta.faceit.com) will be enhanced. Please note that the FACEIT Beta may contain errors or inaccuracies and may not function as well as standard FACEIT (www.faceit.com). If you experience any issues with Repeek, please report them on Reddit or Twitter."
onClick={async () => {
if (!hasFaceitBetaHostPermission) {
await requestFaceitBetaHostPermission()
Expand All @@ -56,7 +57,7 @@ export default ({ getSwitchProps }) => {
)}
<ListItemLink
primary="FACEIT Beta FAQ"
secondary="Read more about the FACEIT Beta and how to opt-in/out of it."
secondary="Read more about the FACEIT Beta, how to opt-in/out of it and provide feedback or report any issues."
href="https://support.faceit.com/hc/en-us/articles/11287180980124-Public-BETA-FAQs"
/>
</React.Fragment>
Expand Down
5 changes: 2 additions & 3 deletions src/popup/sections/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const HELP = 'Help'

export default () => (
<React.Fragment>
<ListSubheader>Issues?</ListSubheader>
<ListSubheader>Issues/Questions?</ListSubheader>
<ListItemLink
primary="Report an Issue"
subreddit={encodeURI(
Expand All @@ -20,8 +20,7 @@ export default () => (
}\nBrowser: ${capitalize(userBrowser.name)} (${userBrowser.version})`,
)}
/>
<ListSubheader divider>Questions?</ListSubheader>
<ListItemLink primary="Ask on Reddit" subreddit="submit?selftext=true" />
<ListItemLink primary="Tweet Us" href="https://twitter.com/repeekgg" />
<ListItemLink primary="Tweet Us" twitter="repeekgg" />
</React.Fragment>
)

0 comments on commit 5c1daf2

Please sign in to comment.