From 822ae9eec711a92b61c8ea5bd7b157aee7d601f7 Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Tue, 25 Jan 2022 21:09:41 +0900 Subject: [PATCH] style: add new tailwind prettier plugin (#2465) --- .vscode/extensions.json | 5 +- package.json | 3 +- src/components/Common/Alert/index.tsx | 10 +-- .../Common/ButtonWithDropdown/index.tsx | 10 +-- src/components/Common/ConfirmButton/index.tsx | 4 +- src/components/Common/Header/index.tsx | 6 +- src/components/Common/ImageFader/index.tsx | 4 +- src/components/Common/List/index.tsx | 4 +- src/components/Common/ListView/index.tsx | 2 +- .../Common/LoadingSpinner/index.tsx | 8 +- src/components/Common/Modal/index.tsx | 12 +-- src/components/Common/SettingsTabs/index.tsx | 4 +- src/components/Common/SlideOver/index.tsx | 10 +-- src/components/Common/Table/index.tsx | 2 +- src/components/CompanyCard/index.tsx | 10 +-- .../Discover/DiscoverNetwork/index.tsx | 2 +- .../Discover/DiscoverStudio/index.tsx | 2 +- src/components/DownloadBlock/index.tsx | 8 +- src/components/ExternalLinkBlock/index.tsx | 14 +-- src/components/GenreCard/index.tsx | 16 ++-- src/components/IssueBlock/index.tsx | 14 +-- .../IssueDetails/IssueComment/index.tsx | 24 ++--- .../IssueDetails/IssueDescription/index.tsx | 14 +-- src/components/IssueDetails/index.tsx | 14 +-- src/components/IssueList/IssueItem/index.tsx | 34 +++---- src/components/IssueList/index.tsx | 26 +++--- .../IssueModal/CreateIssueModal/index.tsx | 22 ++--- .../Layout/LanguagePicker/index.tsx | 8 +- src/components/Layout/Notifications/index.tsx | 4 +- src/components/Layout/SearchInput/index.tsx | 12 +-- src/components/Layout/Sidebar/index.tsx | 40 ++++----- src/components/Layout/UserDropdown/index.tsx | 14 +-- src/components/Layout/VersionStatus/index.tsx | 14 +-- src/components/Layout/index.tsx | 22 ++--- src/components/LoadingBar/index.tsx | 4 +- src/components/Login/LocalLogin.tsx | 8 +- src/components/Login/index.tsx | 20 ++--- src/components/ManageSlideOver/index.tsx | 26 +++--- .../MediaSlider/ShowMoreCard/index.tsx | 12 +-- src/components/MovieDetails/index.tsx | 34 +++---- .../NotificationType/index.tsx | 6 +- src/components/PermissionOption/index.tsx | 6 +- src/components/PersonCard/index.tsx | 16 ++-- src/components/PersonDetails/index.tsx | 12 +-- src/components/QuotaSelector/index.tsx | 4 +- src/components/RegionSelector/index.tsx | 30 +++---- src/components/RequestBlock/index.tsx | 22 ++--- src/components/RequestCard/index.tsx | 40 ++++----- .../RequestList/RequestItem/index.tsx | 48 +++++----- src/components/RequestList/index.tsx | 26 +++--- .../RequestModal/AdvancedRequester/index.tsx | 52 +++++------ .../RequestModal/CollectionRequestModal.tsx | 26 +++--- .../RequestModal/QuotaDisplay/index.tsx | 10 +-- .../RequestModal/SearchByNameModal/index.tsx | 12 +-- .../RequestModal/TvRequestModal.tsx | 30 +++---- .../ResetPassword/RequestResetLink.tsx | 22 ++--- src/components/ResetPassword/index.tsx | 28 +++--- src/components/Settings/LibraryItem.tsx | 26 +++--- .../Notifications/NotificationsDiscord.tsx | 4 +- .../Notifications/NotificationsEmail.tsx | 4 +- .../NotificationsGotify/index.tsx | 4 +- .../NotificationsLunaSea/index.tsx | 4 +- .../NotificationsPushbullet/index.tsx | 4 +- .../NotificationsPushover/index.tsx | 4 +- .../NotificationsSlack/index.tsx | 4 +- .../Notifications/NotificationsTelegram.tsx | 4 +- .../NotificationsWebPush/index.tsx | 4 +- .../NotificationsWebhook/index.tsx | 4 +- .../Settings/SettingsAbout/Releases/index.tsx | 10 +-- .../Settings/SettingsAbout/index.tsx | 12 +-- .../Settings/SettingsJobsCache/index.tsx | 6 +- .../Settings/SettingsLogs/index.tsx | 34 +++---- src/components/Settings/SettingsMain.tsx | 2 +- .../Settings/SettingsNotifications.tsx | 20 ++--- src/components/Settings/SettingsPlex.tsx | 22 ++--- src/components/Settings/SettingsServices.tsx | 42 ++++----- .../Settings/SettingsUsers/index.tsx | 2 +- src/components/Setup/LoginWithPlex.tsx | 4 +- src/components/Setup/SetupSteps.tsx | 16 ++-- src/components/Setup/index.tsx | 14 +-- src/components/Slider/index.tsx | 8 +- src/components/StatusBadge/index.tsx | 6 +- src/components/TitleCard/index.tsx | 40 ++++----- src/components/Toast/index.tsx | 20 ++--- src/components/ToastContainer/index.tsx | 2 +- src/components/TvDetails/index.tsx | 20 ++--- src/components/UserList/PlexImportModal.tsx | 24 ++--- src/components/UserList/index.tsx | 26 +++--- .../UserProfile/ProfileHeader/index.tsx | 12 +-- .../UserGeneralSettings/index.tsx | 10 +-- .../UserNotificationsDiscord.tsx | 2 +- .../UserNotificationsEmail.tsx | 2 +- .../UserNotificationsPushbullet.tsx | 2 +- .../UserNotificationsPushover.tsx | 2 +- .../UserNotificationsTelegram.tsx | 2 +- .../UserNotificationsWebPush.tsx | 2 +- .../UserNotificationSettings/index.tsx | 12 +-- .../UserSettings/UserPasswordChange/index.tsx | 4 +- .../UserSettings/UserPermissions/index.tsx | 2 +- src/components/UserProfile/index.tsx | 28 +++--- src/pages/404.tsx | 4 +- src/pages/_error.tsx | 4 +- src/styles/globals.css | 90 +++++++++---------- yarn.lock | 5 ++ 104 files changed, 737 insertions(+), 734 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index fb896f97e..80a16c644 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -19,9 +19,6 @@ "stylelint.vscode-stylelint", - "bradlc.vscode-tailwindcss", - - // https://marketplace.visualstudio.com/items?itemName=heybourn.headwind - "heybourn.headwind" + "bradlc.vscode-tailwindcss" ] } diff --git a/package.json b/package.json index 2c03bfd65..6549a770a 100644 --- a/package.json +++ b/package.json @@ -131,6 +131,7 @@ "nodemon": "^2.0.15", "postcss": "^8.4.5", "prettier": "^2.5.1", + "prettier-plugin-tailwindcss": "^0.1.3", "semantic-release": "^19.0.2", "semantic-release-docker-buildx": "^1.0.1", "tailwindcss": "^3.0.15", @@ -150,7 +151,7 @@ "prettier --write", "eslint" ], - "**/*.{json,md}": [ + "**/*.{json,md,css}": [ "prettier --write" ] }, diff --git a/src/components/Common/Alert/index.tsx b/src/components/Common/Alert/index.tsx index cddcf992d..e9789c706 100644 --- a/src/components/Common/Alert/index.tsx +++ b/src/components/Common/Alert/index.tsx @@ -15,7 +15,7 @@ const Alert: React.FC = ({ title, children, type }) => { bgColor: 'bg-yellow-600', titleColor: 'text-yellow-100', textColor: 'text-yellow-300', - svg: , + svg: , }; switch (type) { @@ -24,7 +24,7 @@ const Alert: React.FC = ({ title, children, type }) => { bgColor: 'bg-indigo-600', titleColor: 'text-indigo-100', textColor: 'text-indigo-300', - svg: , + svg: , }; break; case 'error': @@ -32,13 +32,13 @@ const Alert: React.FC = ({ title, children, type }) => { bgColor: 'bg-red-600', titleColor: 'text-red-100', textColor: 'text-red-300', - svg: , + svg: , }; break; } return ( -
+
{design.svg}
@@ -48,7 +48,7 @@ const Alert: React.FC = ({ title, children, type }) => {
)} {children && ( -
+
{children}
)} diff --git a/src/components/Common/ButtonWithDropdown/index.tsx b/src/components/Common/ButtonWithDropdown/index.tsx index 944c9d8bb..6edb4a11f 100644 --- a/src/components/Common/ButtonWithDropdown/index.tsx +++ b/src/components/Common/ButtonWithDropdown/index.tsx @@ -32,7 +32,7 @@ const DropdownItem: React.FC = ({ } return ( {children} @@ -84,7 +84,7 @@ const ButtonWithDropdown: React.FC = ({ {children && ( - +
diff --git a/src/components/Common/Table/index.tsx b/src/components/Common/Table/index.tsx index 65b1549f7..9e0cb0ca5 100644 --- a/src/components/Common/Table/index.tsx +++ b/src/components/Common/Table/index.tsx @@ -3,7 +3,7 @@ import { withProperties } from '../../../utils/typeHelpers'; const TBody: React.FC = ({ children }) => { return ( - {children} + {children} ); }; diff --git a/src/components/CompanyCard/index.tsx b/src/components/CompanyCard/index.tsx index 396f6e85e..b6383a77a 100644 --- a/src/components/CompanyCard/index.tsx +++ b/src/components/CompanyCard/index.tsx @@ -13,10 +13,10 @@ const CompanyCard: React.FC = ({ image, url, name }) => { return ( { setHovered(true); @@ -33,10 +33,10 @@ const CompanyCard: React.FC = ({ image, url, name }) => { {name}
diff --git a/src/components/Discover/DiscoverNetwork/index.tsx b/src/components/Discover/DiscoverNetwork/index.tsx index c2e96421b..247c5ece7 100644 --- a/src/components/Discover/DiscoverNetwork/index.tsx +++ b/src/components/Discover/DiscoverNetwork/index.tsx @@ -47,7 +47,7 @@ const DiscoverTvNetwork: React.FC = () => {
{firstResultData?.network.logoPath ? ( -
+
{firstResultData.network.name} {
{firstResultData?.studio.logoPath ? ( -
+
{firstResultData.studio.name} = ({ return (
-
+
{downloadItem.title}
-
+
= ({ }%`, }} /> -
+
{downloadItem.size ? Math.round( diff --git a/src/components/ExternalLinkBlock/index.tsx b/src/components/ExternalLinkBlock/index.tsx index 1b1f06ed2..05f8c3bc0 100644 --- a/src/components/ExternalLinkBlock/index.tsx +++ b/src/components/ExternalLinkBlock/index.tsx @@ -28,11 +28,11 @@ const ExternalLinkBlock: React.FC = ({ const { locale } = useLocale(); return ( -
+
{plexUrl && ( @@ -42,7 +42,7 @@ const ExternalLinkBlock: React.FC = ({ {tmdbId && ( @@ -52,7 +52,7 @@ const ExternalLinkBlock: React.FC = ({ {tvdbId && mediaType === MediaType.TV && ( @@ -62,7 +62,7 @@ const ExternalLinkBlock: React.FC = ({ {imdbId && ( @@ -72,7 +72,7 @@ const ExternalLinkBlock: React.FC = ({ {rtUrl && ( @@ -84,7 +84,7 @@ const ExternalLinkBlock: React.FC = ({ href={`https://trakt.tv/search/tmdb/${tmdbId}?id_type=${ mediaType === 'movie' ? 'movie' : 'show' }`} - className="w-8 transition duration-300 opacity-50 hover:opacity-100" + className="w-8 opacity-50 transition duration-300 hover:opacity-100" target="_blank" rel="noreferrer" > diff --git a/src/components/GenreCard/index.tsx b/src/components/GenreCard/index.tsx index fad201a5c..85d888a33 100644 --- a/src/components/GenreCard/index.tsx +++ b/src/components/GenreCard/index.tsx @@ -21,13 +21,13 @@ const GenreCard: React.FC = ({ return ( { setHovered(true); }} @@ -42,11 +42,11 @@ const GenreCard: React.FC = ({ >
-
+
{name}
@@ -57,7 +57,7 @@ const GenreCard: React.FC = ({ const GenreCardPlaceholder: React.FC = () => { return (
); }; diff --git a/src/components/IssueBlock/index.tsx b/src/components/IssueBlock/index.tsx index 318827814..3367a2c27 100644 --- a/src/components/IssueBlock/index.tsx +++ b/src/components/IssueBlock/index.tsx @@ -30,15 +30,15 @@ const IssueBlock: React.FC = ({ issue }) => { return (
-
+
- + {intl.formatMessage(issueOption.name)}
-
- +
+ = ({ issue }) => {
-
- +
+ {intl.formatDate(issue.createdAt, { year: 'numeric', @@ -64,7 +64,7 @@ const IssueBlock: React.FC = ({ issue }) => {
-
+
{values.problemSeason > 0 && ( -
+
+
{issueOptions.map((setting, index) => ( = ({ ? 'rounded-bl-md rounded-br-md' : '', checked - ? 'bg-indigo-600 border-indigo-500 z-10' + ? 'z-10 border-indigo-500 bg-indigo-600' : 'border-gray-500', - 'relative border p-4 flex cursor-pointer focus:outline-none' + 'relative flex cursor-pointer border p-4 focus:outline-none' ) } > @@ -278,16 +278,16 @@ const CreateIssueModal: React.FC = ({
+
= ({ ))}
-
+
{ leaveTo="transform opacity-0 scale-95" >
-
+
-
- +
+
+
0 ? '1.75rem' : '' }} - className="block w-full py-2 pl-10 text-white placeholder-gray-300 bg-gray-900 border border-gray-600 rounded-full bg-opacity-80 focus:bg-opacity-100 focus:border-gray-500 hover:border-gray-500 focus:outline-none focus:ring-0 focus:placeholder-gray-400 sm:text-base" + className="block w-full rounded-full border border-gray-600 bg-gray-900 bg-opacity-80 py-2 pl-10 text-white placeholder-gray-300 hover:border-gray-500 focus:border-gray-500 focus:bg-opacity-100 focus:placeholder-gray-400 focus:outline-none focus:ring-0 sm:text-base" placeholder={intl.formatMessage(messages.searchPlaceholder)} type="search" value={searchValue} @@ -44,10 +44,10 @@ const SearchInput: React.FC = () => { /> {searchValue.length > 0 && ( )}
diff --git a/src/components/Layout/Sidebar/index.tsx b/src/components/Layout/Sidebar/index.tsx index 92495db6b..45716eeb5 100644 --- a/src/components/Layout/Sidebar/index.tsx +++ b/src/components/Layout/Sidebar/index.tsx @@ -42,20 +42,20 @@ const SidebarLinks: SidebarLinkProps[] = [ { href: '/', messagesKey: 'dashboard', - svgIcon: , + svgIcon: , activeRegExp: /^\/(discover\/?(movies|tv)?)?$/, }, { href: '/requests', messagesKey: 'requests', - svgIcon: , + svgIcon: , activeRegExp: /^\/requests/, }, { href: '/issues', messagesKey: 'issues', svgIcon: ( - + ), activeRegExp: /^\/issues/, requiredPermission: [ @@ -68,14 +68,14 @@ const SidebarLinks: SidebarLinkProps[] = [ { href: '/users', messagesKey: 'users', - svgIcon: , + svgIcon: , activeRegExp: /^\/users/, requiredPermission: Permission.MANAGE_USERS, }, { href: '/settings', messagesKey: 'settings', - svgIcon: , + svgIcon: , activeRegExp: /^\/settings/, requiredPermission: Permission.MANAGE_SETTINGS, }, @@ -114,28 +114,28 @@ const Sidebar: React.FC = ({ open, setClosed }) => { leaveTo="-translate-x-full" > <> -
-
+
+
-
+ -
-
+
{/* */}
@@ -194,17 +194,17 @@ const Sidebar: React.FC = ({ open, setClosed }) => {
-
-
-
-
+
+
+
+ -