1
Fork 0

Merge pull request #707 from nathanrdodson/master

Following breadcrumbs now closes sidebar
This commit is contained in:
Viktor Strate Kløvedal 2022-06-30 11:27:09 +02:00 committed by GitHub
commit 548eeed81c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

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