From fee40badb8b33e3691decb379876552a7ef05721 Mon Sep 17 00:00:00 2001 From: Filip Czaplicki Date: Fri, 15 Mar 2024 22:17:21 +0100 Subject: [PATCH] Link to CC0 At the moment solution is hacky. It looks for part of translation to create link of it Fixes #217 --- src/components/sidebar/photoUploader.tsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/sidebar/photoUploader.tsx b/src/components/sidebar/photoUploader.tsx index 0ccac1b..089facd 100644 --- a/src/components/sidebar/photoUploader.tsx +++ b/src/components/sidebar/photoUploader.tsx @@ -16,6 +16,24 @@ interface DefibrillatorDetailsProps { closeSidebar: () => void; } +// TODO: consider splitting cc0 part from translation +const LicenceInfoBlock: FC = () => { + const { t } = useTranslation(); + const cc0 = "Creative Commons Zero (CC0 v1.0)"; + const licenseInfoText = t("photo.license"); + if (!licenseInfoText.includes(cc0)) { + return

{licenseInfoText}

; + } + const [before, after] = licenseInfoText.split(cc0); + return ( +

+ {before} + {cc0} + {after} +

+ ); +}; + const PhotoUpload: FC = (props) => { const { t } = useTranslation(); const { data, closeSidebar } = props; @@ -29,7 +47,6 @@ const PhotoUpload: FC = (props) => { const accessText = data.tags.access ? ` - ${t(`access.${data.tags.access}`)}` : ""; - return (