diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index be7b5e9ab7..6bcda818c4 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -127,7 +127,7 @@ if (isOverleaf) .row-spaced#userProfileInformation(ng-if="hasProjects") div(ng-hide="withAffiliations", ng-cloak) hr - .text-centered.user-profile + .text-centered.add-affiliation p Are you affiliated with an institution? a.btn.btn-secondary-info.btn-secondary( diff --git a/services/web/frontend/js/features/project-list/components/sidebar/add-affiliation.tsx b/services/web/frontend/js/features/project-list/components/add-affiliation.tsx similarity index 55% rename from services/web/frontend/js/features/project-list/components/sidebar/add-affiliation.tsx rename to services/web/frontend/js/features/project-list/components/add-affiliation.tsx index 51711df5bb..29c50da9e6 100644 --- a/services/web/frontend/js/features/project-list/components/sidebar/add-affiliation.tsx +++ b/services/web/frontend/js/features/project-list/components/add-affiliation.tsx @@ -1,19 +1,26 @@ import { useTranslation } from 'react-i18next' import { Button } from 'react-bootstrap' -import { useProjectListContext } from '../../context/project-list-context' -import getMeta from '../../../../utils/meta' -import { Affiliation } from '../../../../../../types/affiliation' -import { ExposedSettings } from '../../../../../../types/exposed-settings' +import { useProjectListContext } from '../context/project-list-context' +import getMeta from '../../../utils/meta' +import { Affiliation } from '../../../../../types/affiliation' +import { ExposedSettings } from '../../../../../types/exposed-settings' +import classNames from 'classnames' export function useAddAffiliation() { const { totalProjectsCount } = useProjectListContext() const { isOverleaf } = getMeta('ol-ExposedSettings') as ExposedSettings const userAffiliations = getMeta('ol-userAffiliations', []) as Affiliation[] - return { show: isOverleaf && totalProjectsCount && !userAffiliations.length } + return { + show: isOverleaf && totalProjectsCount > 0 && !userAffiliations.length, + } } -function AddAffiliation() { +type AddAffiliationProps = { + className?: string +} + +function AddAffiliation({ className }: AddAffiliationProps) { const { t } = useTranslation() const { show } = useAddAffiliation() @@ -21,8 +28,10 @@ function AddAffiliation() { return null } + const classes = classNames('text-centered', 'add-affiliation', className) + return ( -
+

{t('are_you_affiliated_with_an_institution')}