Skip to content

Commit

Permalink
hide rabbithole button
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Feb 12, 2024
1 parent 9866b46 commit 8de9d7f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/in-page-ui/ribbon/react/components/ribbon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface Props extends RibbonSubcomponentProps {
getRootElement: () => HTMLElement
bgScriptBG: RemoteBGScriptInterface
setWriteError: (error: string) => void
showRabbitHoleButton: boolean
}

interface State {
Expand Down Expand Up @@ -1683,6 +1684,7 @@ export default class Ribbon extends Component<Props, State> {
</IconContainer>
)
} else {
console.log('showRabbitHoleButton', this.props.showRabbitHoleButton)
return (
<>
<InnerRibbon
Expand Down Expand Up @@ -1775,6 +1777,8 @@ export default class Ribbon extends Component<Props, State> {
this.renderAItriggerButton()}
{!this.props.sidebar
.isSidebarOpen &&
this.props
.showRabbitHoleButton &&
this.renderRabbitHoleTriggerButton()}
{!this.props.sidebar
.isSidebarOpen &&
Expand Down
1 change: 1 addition & 0 deletions src/in-page-ui/ribbon/react/containers/ribbon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export default class RibbonContainer extends StatefulUIElement<
})
}
isTrial={this.state.isTrial}
showRabbitHoleButton={this.state.showRabbitHoleButton}
signupDate={this.state.signupDate}
pageActivityIndicatorBG={this.props.pageActivityIndicatorBG}
contentSharingBG={this.props.contentSharing}
Expand Down
17 changes: 17 additions & 0 deletions src/in-page-ui/ribbon/react/containers/ribbon/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export interface RibbonContainerState {
isTrial: boolean
signupDate: number
themeVariant: MemexThemeVariant
showRabbitHoleButton: boolean
}

export type RibbonContainerEvents = UIEvent<
Expand Down Expand Up @@ -184,6 +185,7 @@ export class RibbonContainerLogic extends UILogic<
isTrial: false,
signupDate: null,
themeVariant: null,
showRabbitHoleButton: false,
}
}

Expand Down Expand Up @@ -225,6 +227,21 @@ export class RibbonContainerLogic extends UILogic<
} catch (error) {
console.error('error in updatePageCounter', error)
}

const onboardingComplete = await browser.storage.local.get(
'rabbitHoleBetaFeatureAccessOnboardingDone',
)

console.log(
'onboardingcomlete',
onboardingComplete['rabbitHoleBetaFeatureAccessOnboardingDone'],
)

if (onboardingComplete['rabbitHoleBetaFeatureAccessOnboardingDone']) {
this.emitMutation({
showRabbitHoleButton: { $set: true },
})
}
}

async initThemeVariant() {
Expand Down

0 comments on commit 8de9d7f

Please sign in to comment.