Skip to content

Commit

Permalink
Following breadcrumbs closes sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanrdodson committed Jun 29, 2022
1 parent 8d78c58 commit 29516a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/src/components/sidebar/MediaSidebar/MediaSidebar.tsx
@@ -1,12 +1,13 @@
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'
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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 29516a3

Please sign in to comment.