From 14f10cf9c3e996ade55af1ce27f3218badd2065b Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Sun, 20 Nov 2022 11:42:50 +0000 Subject: [PATCH] fix: classic photo info - plus the testing option of 10 seconds for interval --- .../sections/background/Background.jsx | 2 - .../widgets/background/PhotoInformation.jsx | 96 +++++++++++++------ 2 files changed, 67 insertions(+), 31 deletions(-) diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx index 933dbf42..21a375b4 100644 --- a/src/components/modals/main/settings/sections/background/Background.jsx +++ b/src/components/modals/main/settings/sections/background/Background.jsx @@ -83,7 +83,6 @@ export default class BackgroundSettings extends PureComponent { value2={Date.now()} > - @@ -143,7 +142,6 @@ export default class BackgroundSettings extends PureComponent { options={this.state.backgroundCategories} name="apiCategories" > - )} { const excludeImage = async (info) => { // eslint-disable-next-line no-restricted-globals - const confirmed = confirm(variables.getMessage('widgets.background.exclude_confirm', { category: info.category })); + const confirmed = confirm( + variables.getMessage('widgets.background.exclude_confirm', { category: info.category }), + ); if (!confirmed) return; let backgroundExclude = JSON.parse(localStorage.getItem('backgroundExclude')); backgroundExclude.push(info.pun); @@ -145,7 +147,8 @@ function PhotoInformation({ info, url, api }) { return null; } - const tile = variables.constants.API_URL + `/map?latitude=${info.latitude}&longitude=${info.longitude}`; + const tile = + variables.constants.API_URL + `/map?latitude=${info.latitude}&longitude=${info.longitude}`; showingPhotoMap = true; return ( @@ -197,6 +200,7 @@ function PhotoInformation({ info, url, api }) { {localStorage.getItem('widgetStyle') !== 'legacy' || other ? (
setshowExtraInfo(true)} onMouseLeave={() => setshowExtraInfo(false)} > @@ -235,11 +239,13 @@ function PhotoInformation({ info, url, api }) {
) : null}
- { - (showExtraInfo || other) && info.description - ? (info.description.length > 40 ? info.description.substring(0, 40) + '...' : info.description) - : info.location?.split(',').slice(-2).join(', ').trim() - } + + {(showExtraInfo || other) && info.description + ? info.description.length > 40 + ? info.description.substring(0, 40) + '...' + : info.description + : info.location?.split(',').slice(-2).join(', ').trim()} + {photo} {credit} @@ -270,56 +276,88 @@ function PhotoInformation({ info, url, api }) { {variables.getMessage('widgets.background.information')} {info.location && info.location !== 'N/A' ? ( -
+
{info.location}
) : null} {info.camera && info.camera !== 'N/A' ? ( -
+
{info.camera}
) : null} -
+
{width}x{height}
{info.category ? ( -
+
- {info.category[0].toUpperCase() + info.category.slice(1)} + + {info.category[0].toUpperCase() + info.category.slice(1)} +
) : null} {api ? ( -
{!info.offline ? ( - + openShareModal(true)} /> ) : null} - + {!info.offline ? ( @@ -349,4 +387,4 @@ function PhotoInformation({ info, url, api }) { ); } -export default memo(PhotoInformation); \ No newline at end of file +export default memo(PhotoInformation);