Skip to content

Commit

Permalink
Merge pull request #707 from nathanrdodson/master
Browse files Browse the repository at this point in the history
Following breadcrumbs now closes sidebar
  • Loading branch information
viktorstrate committed Jun 30, 2022
2 parents 8d78c58 + 29516a3 commit 548eeed
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 548eeed

Please sign in to comment.