misc: remove features page buttons

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-03-29 17:00:26 +02:00 committed by Philip Molares
parent 6cc288a2ea
commit 4e3c1ede0e
5 changed files with 2 additions and 47 deletions

View file

@ -26,17 +26,6 @@ describe('Intro page', () => {
}) })
}) })
describe('features button', () => {
it('is hidden when logged in', () => {
cy.getByCypressId('features-button').should('not.exist')
})
it('is visible when logged out', () => {
cy.logout()
cy.getByCypressId('features-button').should('exist')
})
})
describe('sign in button', () => { describe('sign in button', () => {
it('is hidden when logged in', () => { it('is hidden when logged in', () => {
cy.getByCypressId('sign-in-button').should('not.exist') cy.getByCypressId('sign-in-button').should('not.exist')

View file

@ -57,7 +57,6 @@
}, },
"landing": { "landing": {
"intro": { "intro": {
"exploreFeatures": "Explore all features",
"markdownWhileLoading": "Loading...", "markdownWhileLoading": "Loading...",
"markdownLoadingError": "Error while fetching intro content" "markdownLoadingError": "Error while fetching intro content"
}, },
@ -262,7 +261,6 @@
}, },
"documents": { "documents": {
"title": "Documents", "title": "Documents",
"features": "Features",
"yamlMetadata": "YAML Metadata", "yamlMetadata": "YAML Metadata",
"slideExample": "Slide Example" "slideExample": "Slide Example"
} }

View file

@ -71,14 +71,6 @@ export const LinksTabContent: React.FC = () => {
</h3> </h3>
<div> <div>
<ul className='list-unstyled'> <ul className='list-unstyled'>
<li>
<TranslatedInternalLink
i18nKey='editor.help.documents.features'
href='/n/features'
icon={IconDot}
className='text-primary'
/>
</li>
<li> <li>
<TranslatedInternalLink <TranslatedInternalLink
i18nKey='editor.help.documents.yamlMetadata' i18nKey='editor.help.documents.yamlMetadata'

View file

@ -4,19 +4,12 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { useApplicationState } from '../../../hooks/common/use-application-state' import { useApplicationState } from '../../../hooks/common/use-application-state'
import { cypressId } from '../../../utils/cypress-attribute'
import { ShowIf } from '../../common/show-if/show-if'
import { SignInButton } from '../../landing-layout/navigation/sign-in-button' import { SignInButton } from '../../landing-layout/navigation/sign-in-button'
import './cover-buttons.module.scss' import styles from './cover-buttons.module.scss'
import Link from 'next/link'
import React from 'react' import React from 'react'
import { Button } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
export const CoverButtons: React.FC = () => { export const CoverButtons: React.FC = () => {
useTranslation()
const userExists = useApplicationState((state) => !!state.user) const userExists = useApplicationState((state) => !!state.user)
const anyAuthProviderActivated = useApplicationState((state) => state.config.authProviders.length > 0)
if (userExists) { if (userExists) {
return null return null
@ -24,17 +17,7 @@ export const CoverButtons: React.FC = () => {
return ( return (
<div className='mb-5'> <div className='mb-5'>
<SignInButton className='cover-button' variant='success' size='lg' /> <SignInButton className={styles['cover-button']} variant='success' size='lg' />
<ShowIf condition={anyAuthProviderActivated}>
<span className='m-2'>
<Trans i18nKey='common.or' />
</span>
</ShowIf>
<Link href='/n/features' passHref={true}>
<Button {...cypressId('features-button')} className='cover-button' variant='primary' size='lg'>
<Trans i18nKey='landing.intro.exploreFeatures' />
</Button>
</Link>
</div> </div>
) )
} }

View file

@ -11,7 +11,6 @@ import { SignOutDropdownButton } from './sign-out-dropdown-button'
import Link from 'next/link' import Link from 'next/link'
import React from 'react' import React from 'react'
import { Dropdown } from 'react-bootstrap' import { Dropdown } from 'react-bootstrap'
import { Lightning as IconLightning } from 'react-bootstrap-icons'
import { Person as IconPerson } from 'react-bootstrap-icons' import { Person as IconPerson } from 'react-bootstrap-icons'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
@ -33,12 +32,6 @@ export const UserDropdown: React.FC = () => {
</Dropdown.Toggle> </Dropdown.Toggle>
<Dropdown.Menu className='text-start'> <Dropdown.Menu className='text-start'>
<Link href={'/n/features'} passHref={true} legacyBehavior={true}>
<Dropdown.Item dir='auto' {...cypressId('user-dropdown-features-button')}>
<UiIcon icon={IconLightning} className='mx-2' />
<Trans i18nKey='editor.help.documents.features' />
</Dropdown.Item>
</Link>
<Link href={'/profile'} passHref={true} legacyBehavior={true}> <Link href={'/profile'} passHref={true} legacyBehavior={true}>
<Dropdown.Item dir='auto' {...cypressId('user-dropdown-profile-button')}> <Dropdown.Item dir='auto' {...cypressId('user-dropdown-profile-button')}>
<UiIcon icon={IconPerson} className='mx-2' /> <UiIcon icon={IconPerson} className='mx-2' />