From 084a842a4f9b6caaed22edbe77bc9e414bc1f387 Mon Sep 17 00:00:00 2001 From: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Date: Sat, 16 Oct 2021 11:46:18 -0400 Subject: [PATCH] fix(ui): refinements for 'About' page (#2173) * fix(ui): refinements for 'About' page * fix: remove unneeded GithubLink function * fix: display/link badges appropriately --- src/components/Common/Modal/index.tsx | 6 +- .../Settings/SettingsAbout/Releases/index.tsx | 91 +++++++------------ .../Settings/SettingsAbout/index.tsx | 77 ++++++++++++---- src/i18n/locale/en.json | 10 +- src/styles/globals.css | 4 + 5 files changed, 103 insertions(+), 85 deletions(-) diff --git a/src/components/Common/Modal/index.tsx b/src/components/Common/Modal/index.tsx index 97a9cd51..08e92d95 100644 --- a/src/components/Common/Modal/index.tsx +++ b/src/components/Common/Modal/index.tsx @@ -128,16 +128,16 @@ const Modal: React.FC = ({ /> )} -
+
{iconSvg &&
{iconSvg}
}
{title && ( {title} diff --git a/src/components/Settings/SettingsAbout/Releases/index.tsx b/src/components/Settings/SettingsAbout/Releases/index.tsx index f3ef21fe..cf876794 100644 --- a/src/components/Settings/SettingsAbout/Releases/index.tsx +++ b/src/components/Settings/SettingsAbout/Releases/index.tsx @@ -4,7 +4,6 @@ import { defineMessages, FormattedRelativeTime, useIntl } from 'react-intl'; import ReactMarkdown from 'react-markdown'; import useSWR from 'swr'; import globalMessages from '../../../../i18n/globalMessages'; -import Alert from '../../../Common/Alert'; import Badge from '../../../Common/Badge'; import Button from '../../../Common/Button'; import LoadingSpinner from '../../../Common/LoadingSpinner'; @@ -13,14 +12,12 @@ import Transition from '../../../Transition'; const messages = defineMessages({ releases: 'Releases', - releasedataMissing: 'Release data unavailable. Is GitHub down?', - versionChangelog: 'Version Changelog', + releasedataMissing: 'Release data is currently unavailable.', + versionChangelog: '{version} Changelog', viewongithub: 'View on GitHub', latestversion: 'Latest', - currentversion: 'Current Version', + currentversion: 'Current', viewchangelog: 'View Changelog', - runningDevelopMessage: - 'The latest changes to the develop branch of Overseerr are not shown below. Please see the commit history for this branch on GitHub for details.', }); const REPO_RELEASE_API = @@ -58,8 +55,9 @@ const Release: React.FC = ({ }) => { const intl = useIntl(); const [isModalOpen, setModalOpen] = useState(false); + return ( -
+
= ({ setModalOpen(false)} iconSvg={} - title={intl.formatMessage(messages.versionChangelog)} + title={intl.formatMessage(messages.versionChangelog, { + version: release.name, + })} cancelText={intl.formatMessage(globalMessages.close)} okText={intl.formatMessage(messages.viewongithub)} onOk={() => { @@ -84,38 +84,34 @@ const Release: React.FC = ({
-
- - +
+ + + + + {release.name} - {release.name} {isLatest && ( - - - {intl.formatMessage(messages.latestversion)} - - + + {intl.formatMessage(messages.latestversion)} + )} {release.name.includes(currentVersion) && ( - - - {intl.formatMessage(messages.currentversion)} - - + + {intl.formatMessage(messages.currentversion)} + )}
-
- -
+
); }; @@ -143,31 +139,10 @@ const Releases: React.FC = ({ currentVersion }) => { return (

{intl.formatMessage(messages.releases)}

-
- {currentVersion.startsWith('develop-') && ( - {msg}; - }, - GithubLink: function GithubLink(msg) { - return ( - - {msg} - - ); - }, - })} - /> - )} - {data?.map((release, index) => { +
+ {data.map((release, index) => { return ( -
+
develop branch of Overseerr, which is only recommended for those contributing to development or assisting with bleeding-edge testing.', }); const SettingsAbout: React.FC = () => { @@ -81,22 +84,58 @@ const SettingsAbout: React.FC = () => {
+ {data.version.startsWith('develop-') && ( + {msg}; + }, + })} + /> + )} - {data.version.replace('develop-', '')} - {status?.updateAvailable ? ( - - {intl.formatMessage(messages.outofdate)} - - ) : ( - status?.commitTag !== 'local' && ( - - {intl.formatMessage(messages.uptodate)} - - ) - )} + + {data.version.replace('develop-', '')} + + {status?.commitTag !== 'local' && + (status?.updateAvailable ? ( + + + {intl.formatMessage(messages.outofdate)} + + + ) : ( + + + {intl.formatMessage(messages.uptodate)} + + + ))} {intl.formatNumber(data.totalMediaItems)} @@ -118,7 +157,7 @@ const SettingsAbout: React.FC = () => { href="https://docs.overseerr.dev" target="_blank" rel="noreferrer" - className="text-indigo-500 hover:underline" + className="text-indigo-500 transition duration-300 hover:underline" > https://docs.overseerr.dev @@ -128,7 +167,7 @@ const SettingsAbout: React.FC = () => { href="https://github.com/sct/overseerr/discussions" target="_blank" rel="noreferrer" - className="text-indigo-500 hover:underline" + className="text-indigo-500 transition duration-300 hover:underline" > https://github.com/sct/overseerr/discussions @@ -138,7 +177,7 @@ const SettingsAbout: React.FC = () => { href="https://discord.gg/overseerr" target="_blank" rel="noreferrer" - className="text-indigo-500 hover:underline" + className="text-indigo-500 transition duration-300 hover:underline" > https://discord.gg/overseerr @@ -154,7 +193,7 @@ const SettingsAbout: React.FC = () => { href="https://github.com/sponsors/sct" target="_blank" rel="noreferrer" - className="text-indigo-500 hover:underline" + className="text-indigo-500 transition duration-300 hover:underline" > https://github.com/sponsors/sct @@ -167,7 +206,7 @@ const SettingsAbout: React.FC = () => { href="https://patreon.com/overseerr" target="_blank" rel="noreferrer" - className="text-indigo-500 hover:underline" + className="text-indigo-500 transition duration-300 hover:underline" > https://patreon.com/overseerr diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 9b4c297c..6fd4f737 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -426,12 +426,11 @@ "components.Settings.RadarrModal.validationPortRequired": "You must provide a valid port number", "components.Settings.RadarrModal.validationProfileRequired": "You must select a quality profile", "components.Settings.RadarrModal.validationRootFolderRequired": "You must select a root folder", - "components.Settings.SettingsAbout.Releases.currentversion": "Current Version", + "components.Settings.SettingsAbout.Releases.currentversion": "Current", "components.Settings.SettingsAbout.Releases.latestversion": "Latest", - "components.Settings.SettingsAbout.Releases.releasedataMissing": "Release data unavailable. Is GitHub down?", + "components.Settings.SettingsAbout.Releases.releasedataMissing": "Release data is currently unavailable.", "components.Settings.SettingsAbout.Releases.releases": "Releases", - "components.Settings.SettingsAbout.Releases.runningDevelopMessage": "The latest changes to the develop branch of Overseerr are not shown below. Please see the commit history for this branch on GitHub for details.", - "components.Settings.SettingsAbout.Releases.versionChangelog": "Version Changelog", + "components.Settings.SettingsAbout.Releases.versionChangelog": "{version} Changelog", "components.Settings.SettingsAbout.Releases.viewchangelog": "View Changelog", "components.Settings.SettingsAbout.Releases.viewongithub": "View on GitHub", "components.Settings.SettingsAbout.about": "About", @@ -441,8 +440,9 @@ "components.Settings.SettingsAbout.githubdiscussions": "GitHub Discussions", "components.Settings.SettingsAbout.helppaycoffee": "Help Pay for Coffee", "components.Settings.SettingsAbout.outofdate": "Out of Date", - "components.Settings.SettingsAbout.overseerrinformation": "Overseerr Information", + "components.Settings.SettingsAbout.overseerrinformation": "About Overseerr", "components.Settings.SettingsAbout.preferredmethod": "Preferred", + "components.Settings.SettingsAbout.runningDevelop": "You are running the develop branch of Overseerr, which is only recommended for those contributing to development or assisting with bleeding-edge testing.", "components.Settings.SettingsAbout.supportoverseerr": "Support Overseerr", "components.Settings.SettingsAbout.timezone": "Time Zone", "components.Settings.SettingsAbout.totalmedia": "Total Media", diff --git a/src/styles/globals.css b/src/styles/globals.css index 54385d4b..4970c54b 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -296,6 +296,10 @@ select.short { @apply w-min; } +button > span { + @apply whitespace-nowrap; +} + button.input-action { @apply relative inline-flex items-center px-3 sm:px-3.5 py-2 -ml-px text-sm font-medium leading-5 text-white transition duration-150 ease-in-out bg-indigo-600 border border-gray-500 hover:bg-indigo-500 active:bg-gray-100 active:text-gray-700 last:rounded-r-md; }