Skip to content

Commit

Permalink
removed condition for global settings under header
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmesh-hemaram committed Aug 20, 2024
1 parent 6fd1935 commit 9123d84
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions apps/acf-options-page/src/app/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Header() {

const { setIsOpen } = useTour();
const theme = useAppSelector(themeSelector);
const { role, error } = useAppSelector(firebaseSelector);
const { role } = useAppSelector(firebaseSelector);

const dispatch = useAppDispatch();
const { t, i18n } = useTranslation();
Expand Down Expand Up @@ -145,35 +145,35 @@ function Header() {
<div className='vr d-none d-lg-flex h-100 mx-lg-2 text-white'></div>
<hr className='d-lg-none my-2 text-white-50'></hr>
</Nav.Item>
{!error && (
<Nav.Item as='li' className='col-6 col-lg-auto'>
<Nav.Link onClick={() => dispatch(switchSettingsModal())} data-testid='open-global-settings'>
<GearFill title={t('header.settings')} />
<small className='d-lg-none ms-2'>{t('header.settings')}</small>
</Nav.Link>
</Nav.Item>
)}

<Nav.Item as='li' className='col-6 col-lg-auto'>
<Nav.Link onClick={() => dispatch(switchSettingsModal())} data-testid='open-global-settings'>
<GearFill title={t('header.settings')} />
<small className='d-lg-none ms-2'>{t('header.settings')}</small>
</Nav.Link>
</Nav.Item>

<Nav.Item as='li' className='col-6 col-lg-auto'>
<Nav.Link onClick={toggleTheme} data-testid='switch-theme'>
{theme !== 'light' ? <Sun title={t('header.theme.dark')} /> : <Moon title={t('header.theme.light')} />}
<small className='d-lg-none ms-2'>Toggle Theme</small>
</Nav.Link>
</Nav.Item>
{!error && (
<Nav.Item as='li' className='col-6 col-lg-auto'>
<NavDropdown title={i18n.language} id='language-nav-dropdown' align='end' className='text-uppercase fw-bolder' data-testid='switch-language'>
{APP_LANGUAGES.map((language) => (
<NavDropdown.Item key={language} title={language} onClick={() => changeLanguage(language)} active={i18n.language === language}>
{t(`language.${language}`)}
</NavDropdown.Item>
))}
<NavDropdown.Divider />
<NavDropdown.Item title='Add your Language' href='https://github.com/Dhruv-Techapps/acf-i18n/discussions/4' target='_blank' rel='noopener noreferrer'>
Add your Language

<Nav.Item as='li' className='col-6 col-lg-auto'>
<NavDropdown title={i18n.language} id='language-nav-dropdown' align='end' className='text-uppercase fw-bolder' data-testid='switch-language'>
{APP_LANGUAGES.map((language) => (
<NavDropdown.Item key={language} title={language} onClick={() => changeLanguage(language)} active={i18n.language === language}>
{t(`language.${language}`)}
</NavDropdown.Item>
</NavDropdown>
</Nav.Item>
)}
))}
<NavDropdown.Divider />
<NavDropdown.Item title='Add your Language' href='https://github.com/Dhruv-Techapps/acf-i18n/discussions/4' target='_blank' rel='noopener noreferrer'>
Add your Language
</NavDropdown.Item>
</NavDropdown>
</Nav.Item>

<Nav.Item as='li' className='py-2 py-lg-1 col-12 col-lg-auto'>
<div className='vr d-none d-lg-flex h-100 mx-lg-2 text-white'></div>
<hr className='d-lg-none my-2 text-white-50'></hr>
Expand Down

0 comments on commit 9123d84

Please sign in to comment.