mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Make Template Gallery optional; rename environment variables
This commit is contained in:
@@ -5,6 +5,8 @@ export default function GalleryPopularTags() {
|
||||
const { t } = useTranslation()
|
||||
const { templateLinks } = getMeta('ol-ExposedSettings') || []
|
||||
|
||||
if(!templateLinks || templateLinks.length < 2) return null
|
||||
|
||||
return (
|
||||
<div className="popular-tags">
|
||||
<h1>{t('categories')}</h1>
|
||||
|
||||
@@ -29,7 +29,7 @@ function TemplatePageContent() {
|
||||
const footerProps = getMeta('ol-footer')
|
||||
const { template } = useTemplateContext()
|
||||
const { templateLinks } = getMeta('ol-ExposedSettings') || []
|
||||
const categoryName = templateLinks?.find(link => link.url === template.category)?.name || t('all_templates')
|
||||
const categoryName = templateLinks?.find(link => link.url === template.category)?.name
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -38,15 +38,15 @@ function TemplatePageContent() {
|
||||
<div className="container">
|
||||
<OLRow className="previous-page-link-container">
|
||||
<OLCol lg={6}>
|
||||
<a className="previous-page-link" href={template.category}>
|
||||
<a className="previous-page-link" href={'/templates/all'}>
|
||||
<i className="material-symbols material-symbols-rounded" aria-hidden="true">arrow_left_alt</i>
|
||||
{categoryName}
|
||||
{t('all_templates')}
|
||||
</a>
|
||||
{template.category !== '/templates/all' && (
|
||||
{categoryName && template.category !== '/templates/all' && (
|
||||
<>
|
||||
<span className="mx-2">/</span>
|
||||
<a className="previous-page-link" href={'/templates/all'}>
|
||||
{t('all_templates')}
|
||||
<a className="previous-page-link" href={template.category}>
|
||||
{categoryName}
|
||||
</a>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -4,6 +4,7 @@ import type { NavbarSessionUser } from '@/shared/components/types/navbar'
|
||||
import NavLinkItem from '@/shared/components/navbar/nav-link-item'
|
||||
import { AccountMenuItems } from './account-menu-items'
|
||||
import { useSendProjectListMB } from '@/features/project-list/components/project-list-events'
|
||||
import getMeta from '@/utils/meta'
|
||||
|
||||
export default function LoggedInItems({
|
||||
sessionUser,
|
||||
@@ -14,14 +15,18 @@ export default function LoggedInItems({
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
const sendProjectListMB = useSendProjectListMB()
|
||||
const { templatesEnabled } = getMeta('ol-ExposedSettings')
|
||||
|
||||
return (
|
||||
<>
|
||||
<NavLinkItem href="/project" className="nav-item-projects">
|
||||
{t('projects')}
|
||||
</NavLinkItem>
|
||||
<NavLinkItem href="/templates" className="nav-item-templates">
|
||||
{t('templates')}
|
||||
</NavLinkItem>
|
||||
{templatesEnabled && (
|
||||
<NavLinkItem href="/templates" className="nav-item-templates">
|
||||
{t('templates')}
|
||||
</NavLinkItem>
|
||||
)}
|
||||
<NavDropdownMenu
|
||||
title={t('Account')}
|
||||
className="nav-item-account"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import NavLinkItem from '@/shared/components/navbar/nav-link-item'
|
||||
import { useSendProjectListMB } from '@/features/project-list/components/project-list-events'
|
||||
import getMeta from '@/utils/meta'
|
||||
|
||||
export default function LoggedOutItems({
|
||||
showSignUpLink,
|
||||
@@ -9,12 +10,15 @@ export default function LoggedOutItems({
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
const sendMB = useSendProjectListMB()
|
||||
const { templatesEnabled } = getMeta('ol-ExposedSettings')
|
||||
|
||||
return (
|
||||
<>
|
||||
<NavLinkItem href="/templates" className="nav-item-templates">
|
||||
{t('templates')}
|
||||
</NavLinkItem>
|
||||
{templatesEnabled && (
|
||||
<NavLinkItem href="/templates" className="nav-item-templates">
|
||||
{t('templates')}
|
||||
</NavLinkItem>
|
||||
)}
|
||||
{showSignUpLink ? (
|
||||
<NavLinkItem
|
||||
href="/register"
|
||||
|
||||
Reference in New Issue
Block a user