1
Fork 0

Following breadcrumbs closes sidebar

This commit is contained in:
Nathan Dodson 2022-06-29 15:59:37 -05:00
parent 8d78c58859
commit 29516a3b49
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import { gql, useLazyQuery } from '@apollo/client'
import React, { useEffect } from 'react'
import React, { useEffect, useContext } from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'
import styled from 'styled-components'
@ -7,6 +7,7 @@ import { authToken } from '../../../helpers/authentication'
import { isNil } from '../../../helpers/utils'
import { MediaType } from '../../../__generated__/globalTypes'
import { SidebarFacesOverlay } from '../../facesOverlay/FacesOverlay'
import { SidebarContext } from '../Sidebar'
import {
ProtectedImage,
ProtectedVideo,
@ -162,6 +163,7 @@ type SidebarContentProps = {
}
const SidebarContent = ({ media, hidePreview }: SidebarContentProps) => {
const { updateSidebar } = useContext(SidebarContext)
const { t } = useTranslation()
let previewImage = null
if (media.highRes) previewImage = media.highRes
@ -190,6 +192,7 @@ const SidebarContent = ({ media, hidePreview }: SidebarContentProps) => {
<Link
className="text-blue-900 dark:text-blue-200 hover:underline"
to={`/album/${album.id}`}
onClick={() => updateSidebar(null)}
>
{album.title}
</Link>