From c4c39e0557c844ed07b02c114fdc410182b0a891 Mon Sep 17 00:00:00 2001 From: Roland Date: Thu, 2 Nov 2023 18:49:09 -0600 Subject: [PATCH] Changing size of global search for mobile/tablet. Using active tags in search title. --- app/src/DashboardPage.js | 73 ++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 21 deletions(-) diff --git a/app/src/DashboardPage.js b/app/src/DashboardPage.js index caade35c..4738e6f9 100644 --- a/app/src/DashboardPage.js +++ b/app/src/DashboardPage.js @@ -1,6 +1,6 @@ import {LoadStatistic, PageContainer, SearchInput, useTitle} from "./components/Common"; import React, {useContext, useState} from "react"; -import {StatusContext} from "./contexts/contexts"; +import {Media, StatusContext} from "./contexts/contexts"; import {DownloadMenu} from "./components/Download"; import { Button, @@ -160,7 +160,15 @@ export function DashboardPage() { const {searchStr, setSearchStr, activeTags} = useSearch(); const {status} = useContext(StatusContext); - const title = searchStr ? `Search: ${searchStr} - Dashboard` : 'Dashboard'; + let title = 'Dashboard'; + if (searchStr) { + title = `Search: ${searchStr} - Dashboard`; + } else if (activeTags && activeTags.length === 1) { + title = `Tag: ${activeTags[0]} - Dashboard`; + } else if (activeTags && activeTags.length > 1) { + const tagNames = activeTags.join(' & '); + title = `Tags: ${tagNames} - Dashboard`; + } useTitle(title); // Only show dashboard parts if not searching. @@ -175,25 +183,48 @@ export function DashboardPage() { } return - - - - navigate('/')} - style={{marginBottom: '2em'}} - /> - - - - - - + + + + + navigate('/')} + style={{marginBottom: '2em'}} + /> + + + + + + + + + + + + navigate('/')} + style={{marginBottom: '2em'}} + /> + + + + + + + {!searchStr && } {body}