Skip to content

Commit

Permalink
fix up links in the help button
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Jun 5, 2024
1 parent c3a9be1 commit 23f65e6
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions src/overview/help-btn/components/help-btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import * as icons from 'src/common-ui/components/design-library/icons'
import { PopoutBox } from '@worldbrain/memex-common/lib/common-ui/components/popout-box'
import LoadingIndicator from '@worldbrain/memex-common/lib/common-ui/components/loading-indicator'
import { MemexThemeVariant } from '@worldbrain/memex-common/lib/common-ui/styles/types'
import TutorialBox from '@worldbrain/memex-common/lib/common-ui/components/tutorial-box'
import { AuthenticatedUser } from '@worldbrain/memex-common/lib/authentication/types'
import { SETTINGS_URL } from 'src/constants'

export interface Props {
theme: MemexThemeVariant
Expand All @@ -20,6 +23,8 @@ export interface State {
showChat: boolean
showFeedbackForm: boolean
showChangeLog: boolean
showTutorialBox: boolean
currentUser: AuthenticatedUser | null
}

export class HelpBtn extends React.PureComponent<Props, State> {
Expand All @@ -30,6 +35,8 @@ export class HelpBtn extends React.PureComponent<Props, State> {
showChat: false,
showFeedbackForm: false,
showChangeLog: false,
showTutorialBox: false,
currentUser: null,
}

private handleClick: React.MouseEventHandler<HTMLButtonElement> = (e) => {
Expand All @@ -38,6 +45,21 @@ export class HelpBtn extends React.PureComponent<Props, State> {
this.setState((state) => ({ isOpen: !state.isOpen }))
}

renderTutorialBox() {
if (this.state.showTutorialBox) {
return (
<TutorialBox
tutorialId="all"
getRootElement={this.props.getRootElement}
onTutorialClose={() => {
this.setState({ showTutorialBox: false })
}}
isHeadless
/>
)
}
}

private renderMenu() {
if (!this.state.isOpen) {
return null
Expand Down Expand Up @@ -95,9 +117,10 @@ export class HelpBtn extends React.PureComponent<Props, State> {
</MenuItem>
<MenuItem
onClick={() =>
window.open(
'https://tutorials.memex.garden/tutorials',
)
this.setState({
showTutorialBox: !this.state
.showTutorialBox,
})
}
>
<Icon
Expand All @@ -106,6 +129,7 @@ export class HelpBtn extends React.PureComponent<Props, State> {
hoverOff
/>
Tutorials and FAQs
{this.renderTutorialBox()}
</MenuItem>
<MenuItem
onClick={() =>
Expand All @@ -121,7 +145,7 @@ export class HelpBtn extends React.PureComponent<Props, State> {
</MenuItem>
<MenuItem
onClick={() =>
window.open('https://community.memex.garden')
window.open('https://feedback.memex.garden')
}
>
<Icon
Expand All @@ -132,9 +156,7 @@ export class HelpBtn extends React.PureComponent<Props, State> {
Community Forum
</MenuItem>
<MenuItem
onClick={() =>
window.open('https://worldbrain.io/changelog')
}
onClick={() => window.open(SETTINGS_URL, '_blank')}
>
<Icon
filePath={icons.command}
Expand Down Expand Up @@ -171,15 +193,15 @@ export class HelpBtn extends React.PureComponent<Props, State> {
</MenuItem>
<MenuItem
onClick={() =>
window.open('https://twitter.com/memexgarden')
window.open('https://x.com/memexgarden')
}
>
<Icon
filePath={icons.twitter}
heightAndWidth="22px"
hoverOff
/>
Twitter - @memexgarden
Twitter/X - @memexgarden
</MenuItem>
<FooterText>
Memex {browser.runtime.getManifest().version}
Expand Down

0 comments on commit 23f65e6

Please sign in to comment.