Merge pull request #707 from nathanrdodson/master
Following breadcrumbs now closes sidebar
This commit is contained in:
commit
548eeed81c
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue