From c28913dbc649391c3a56802fa258e96fe03feb8c Mon Sep 17 00:00:00 2001 From: Aditya Mitra <55396651+aditya-mitra@users.noreply.github.com> Date: Sun, 26 May 2024 07:37:00 +0530 Subject: [PATCH] remove duplicate tailwind config and use single config (#10237) * remove duplicate tailwind config and use single config * format files --------- Co-authored-by: Daniel Belmes <3631206+DanielBelmes@users.noreply.github.com> Co-authored-by: Daniel Belmes --- .../client-core/src/admin/adminRoutes.tsx | 8 +- .../admin/components/avatar/AvatarTable.tsx | 4 +- .../admin/components/channel/ChannelTable.tsx | 4 +- .../components/instance/InstanceTable.tsx | 4 +- .../admin/components/invites/InviteTable.tsx | 2 +- .../components/locations/LocationTable.tsx | 4 +- .../project/AddEditProjectModal.tsx | 2 +- .../admin/components/project/ProjectTable.tsx | 12 +-- .../components/project/UpdateEngineModal.tsx | 4 +- .../components/recordings/RecordingsTable.tsx | 2 +- .../components/resources/ResourceTable.tsx | 8 +- .../admin/components/server/ServerTable.tsx | 2 +- .../src/admin/components/server/index.tsx | 6 +- .../settings/tabs/authentication.tsx | 6 +- .../admin/components/settings/tabs/aws.tsx | 2 +- .../admin/components/settings/tabs/client.tsx | 2 +- .../admin/components/settings/tabs/email.tsx | 2 +- .../admin/components/settings/tabs/helm.tsx | 2 +- .../components/settings/tabs/project.tsx | 2 +- .../admin/components/settings/tabs/server.tsx | 2 +- .../src/admin/components/user/UserTable.tsx | 4 +- packages/client-core/tailwind.config.js | 76 ------------------- packages/client/src/pages/_app_tw.tsx | 2 +- packages/client/tailwind.config.js | 53 +------------ .../primitives/tailwind/Accordion/index.tsx | 4 +- .../src/primitives/tailwind/Input/index.tsx | 8 +- .../src/primitives/tailwind/Label/index.tsx | 2 +- .../src/primitives/tailwind/Modal/index.tsx | 6 +- .../tailwind/MultiEmailInput/index.tsx | 4 +- .../primitives/tailwind/MultiSelect/index.tsx | 16 ++-- .../primitives/tailwind/Progress/index.tsx | 2 +- .../src/primitives/tailwind/Radio/index.tsx | 4 +- .../src/primitives/tailwind/Select/index.tsx | 6 +- .../src/primitives/tailwind/Table/index.tsx | 8 +- .../ui/src/primitives/tailwind/Tabs/index.tsx | 4 +- .../src/primitives/tailwind/Toggle/index.tsx | 2 +- .../tailwind.config.js => tailwind.config.js | 1 - 37 files changed, 79 insertions(+), 203 deletions(-) delete mode 100644 packages/client-core/tailwind.config.js rename packages/ui/tailwind.config.js => tailwind.config.js (99%) diff --git a/packages/client-core/src/admin/adminRoutes.tsx b/packages/client-core/src/admin/adminRoutes.tsx index 4fc8c5fa31..1c6f9e6452 100644 --- a/packages/client-core/src/admin/adminRoutes.tsx +++ b/packages/client-core/src/admin/adminRoutes.tsx @@ -55,7 +55,7 @@ const AdminTopBar = () => { } return ( -
+
iR Engine Logo
) diff --git a/packages/client-core/src/admin/components/channel/ChannelTable.tsx b/packages/client-core/src/admin/components/channel/ChannelTable.tsx index fcebbbfa4a..1cd20d61ff 100644 --- a/packages/client-core/src/admin/components/channel/ChannelTable.tsx +++ b/packages/client-core/src/admin/components/channel/ChannelTable.tsx @@ -100,7 +100,7 @@ export default function ChannelTable({ title={t('admin:components.common.view')} onClick={() => PopoverState.showPopupover()} > - +
) diff --git a/packages/client-core/src/admin/components/instance/InstanceTable.tsx b/packages/client-core/src/admin/components/instance/InstanceTable.tsx index a925cc6c18..41c55c6ef6 100644 --- a/packages/client-core/src/admin/components/instance/InstanceTable.tsx +++ b/packages/client-core/src/admin/components/instance/InstanceTable.tsx @@ -94,7 +94,7 @@ export default function InstanceTable({ search }: { search: string }) { {t('admin:components.instance.actions.view')}
) diff --git a/packages/client-core/src/admin/components/invites/InviteTable.tsx b/packages/client-core/src/admin/components/invites/InviteTable.tsx index 10cd6f63e5..b80ebace21 100644 --- a/packages/client-core/src/admin/components/invites/InviteTable.tsx +++ b/packages/client-core/src/admin/components/invites/InviteTable.tsx @@ -115,7 +115,7 @@ export default function InviteTable({ ) diff --git a/packages/client-core/src/admin/components/project/AddEditProjectModal.tsx b/packages/client-core/src/admin/components/project/AddEditProjectModal.tsx index 7aececa106..cde67234ab 100644 --- a/packages/client-core/src/admin/components/project/AddEditProjectModal.tsx +++ b/packages/client-core/src/admin/components/project/AddEditProjectModal.tsx @@ -522,7 +522,7 @@ export default function AddEditProjectModal({ projectUpdateStatus.value?.selectedSHA.length > 0 && projectUpdateStatus.value?.commitData.length > 0 && !matchesEngineVersion && ( -
+
diff --git a/packages/client-core/src/admin/components/project/ProjectTable.tsx b/packages/client-core/src/admin/components/project/ProjectTable.tsx index e2f6b5ca16..cd7f0639f2 100644 --- a/packages/client-core/src/admin/components/project/ProjectTable.tsx +++ b/packages/client-core/src/admin/components/project/ProjectTable.tsx @@ -107,7 +107,7 @@ export default function ProjectTable() { */}
) diff --git a/packages/client-core/src/admin/components/server/ServerTable.tsx b/packages/client-core/src/admin/components/server/ServerTable.tsx index 5795cb9219..7663191f09 100644 --- a/packages/client-core/src/admin/components/server/ServerTable.tsx +++ b/packages/client-core/src/admin/components/server/ServerTable.tsx @@ -123,7 +123,7 @@ export default function ServerTable({ ) }} > - +
) diff --git a/packages/client-core/src/admin/components/server/index.tsx b/packages/client-core/src/admin/components/server/index.tsx index 9e0dd5be0f..b23742f7ba 100644 --- a/packages/client-core/src/admin/components/server/index.tsx +++ b/packages/client-core/src/admin/components/server/index.tsx @@ -86,14 +86,14 @@ export default function Servers() { {serverInfoQuery.data.map((info) => (
serverType.set(info.id)} > {info.label} inf.status === 'Running').length}/${info.pods.length}`} />
diff --git a/packages/client-core/src/admin/components/settings/tabs/authentication.tsx b/packages/client-core/src/admin/components/settings/tabs/authentication.tsx index 9ae888916c..0cbadafae8 100644 --- a/packages/client-core/src/admin/components/settings/tabs/authentication.tsx +++ b/packages/client-core/src/admin/components/settings/tabs/authentication.tsx @@ -242,7 +242,7 @@ const AuthenticationTab = forwardRef(({ open }: { open: boolean }, ref: React.Mu /> -
+
{holdAuth?.discord?.value && ( @@ -330,7 +330,7 @@ const AuthenticationTab = forwardRef(({ open }: { open: boolean }, ref: React.Mu )} {(holdAuth?.discord?.value || holdAuth?.linkedin?.value || holdAuth?.facebook?.value) && ( -
+
)} {holdAuth?.google?.value && ( @@ -419,7 +419,7 @@ const AuthenticationTab = forwardRef(({ open }: { open: boolean }, ref: React.Mu
- diff --git a/packages/client-core/src/admin/components/settings/tabs/aws.tsx b/packages/client-core/src/admin/components/settings/tabs/aws.tsx index 9192058412..db150c43d9 100644 --- a/packages/client-core/src/admin/components/settings/tabs/aws.tsx +++ b/packages/client-core/src/admin/components/settings/tabs/aws.tsx @@ -248,7 +248,7 @@ const AwsTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableRefObj
-
- diff --git a/packages/client-core/src/admin/components/settings/tabs/project.tsx b/packages/client-core/src/admin/components/settings/tabs/project.tsx index 19cfc8a324..02a9bfdb8b 100644 --- a/packages/client-core/src/admin/components/settings/tabs/project.tsx +++ b/packages/client-core/src/admin/components/settings/tabs/project.tsx @@ -156,7 +156,7 @@ const ProjectTab = forwardRef(({ open }: { open: boolean }, ref: React.MutableRe
) diff --git a/packages/client-core/tailwind.config.js b/packages/client-core/tailwind.config.js deleted file mode 100644 index e2f69ce99c..0000000000 --- a/packages/client-core/tailwind.config.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -CPAL-1.0 License - -The contents of this file are subject to the Common Public Attribution License -Version 1.0. (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at -https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. -The License is based on the Mozilla Public License Version 1.1, but Sections 14 -and 15 have been added to cover use of software over a computer network and -provide for limited attribution for the Original Developer. In addition, -Exhibit A has been modified to be consistent with Exhibit B. - -Software distributed under the License is distributed on an "AS IS" basis, -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the -specific language governing rights and limitations under the License. - -The Original Code is Ethereal Engine. - -The Original Developer is the Initial Developer. The Initial Developer of the -Original Code is the Ethereal Engine team. - -All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 -Ethereal Engine. All Rights Reserved. -*/ - -/** @type {import('tailwindcss').Config} */ - -module.exports = { - mode: 'jit', - content: ['../**/*.{ts,tsx}'], - darkMode: ['class', '[data-theme="dark"]'], - important: true, // important in prod is must be - theme: { - extend: { - backgroundImage: { - 'gradient-onboarding': 'linear-gradient(180deg, #0A0A0A 0%, #262626 100%)', - 'text-gradient-onboarding': 'linear-gradient(275deg, #4195FB 4.98%, #4E9CFB 61.64%, #A5CDFD 97.96%)', - 'button-gradient-onboarding': 'linear-gradient(96deg, #375DAF 57.63%, #6481C1 100%)' - }, - textColor: { - theme: { - primary: 'var(--text-primary)', - secondary: 'var(--text-secondary)', - highlight: 'var(--text-highlight)', - iconGreen: 'var(--icon-green)', - iconRed: 'var(--icon-red)' - } - }, - backgroundColor: { - theme: { - primary: 'var(--bg-primary)', - secondary: 'var(--bg-secondary)', - highlight: 'var(--bg-highlight)', - surfaceInput: 'var(--bg-surface-input)', - 'surface-main': 'var(--bg-surface-main)', - 'table-secondary': 'var(--bg-table-secondary)', - 'blue-secondary': 'var(--bg-blue-secondary)', - buttonTertiary: 'var(--bg-button-tertiary)', - bannerInformative: 'var(--bg-banner-informative)', - tagGreen: 'var(--bg-tag-green)', - tagLime: 'var(--bg-tag-lime)', - tagRed: 'var(--bg-tag-red)', - tagYellow: 'var(--bg-tag-yellow)' - } - }, - borderColor: { - theme: { - primary: 'var(--border-primary)' - } - }, - colors: { - 'blue-primary': '#375DAF' - } - } - } -} diff --git a/packages/client/src/pages/_app_tw.tsx b/packages/client/src/pages/_app_tw.tsx index db5b4b5e78..46f71f452d 100755 --- a/packages/client/src/pages/_app_tw.tsx +++ b/packages/client/src/pages/_app_tw.tsx @@ -75,7 +75,7 @@ const AppPage = () => { }, [selfUser.id]) if (!/auth\/oauth/.test(location.pathname) && !isLoggedIn.value) { - return + return } return ( diff --git a/packages/client/tailwind.config.js b/packages/client/tailwind.config.js index 5644f61934..a55239af2c 100644 --- a/packages/client/tailwind.config.js +++ b/packages/client/tailwind.config.js @@ -23,55 +23,8 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20 Ethereal Engine. All Rights Reserved. */ -/** @type {import('tailwindcss').Config} */ +import tailwindConfig from '../../tailwind.config' module.exports = { - mode: 'jit', - content: ['../**/*.{ts,tsx}'], - darkMode: ['class', '[data-theme="dark"]'], - important: true, // important in prod is must be - theme: { - extend: { - backgroundImage: { - 'gradient-onboarding': 'linear-gradient(180deg, #0A0A0A 0%, #262626 100%)', - 'text-gradient-onboarding': 'linear-gradient(275deg, #4195FB 4.98%, #4E9CFB 61.64%, #A5CDFD 97.96%)', - 'button-gradient-onboarding': 'linear-gradient(96deg, #375DAF 57.63%, #6481C1 100%)' - }, - textColor: { - theme: { - primary: 'var(--text-primary)', - secondary: 'var(--text-secondary)', - highlight: 'var(--text-highlight)', - iconGreen: 'var(--icon-green)', - iconRed: 'var(--icon-red)' - } - }, - backgroundColor: { - theme: { - primary: 'var(--bg-primary)', - secondary: 'var(--bg-secondary)', - highlight: 'var(--bg-highlight)', - surfaceInput: 'var(--bg-surface-input)', - 'surface-main': 'var(--bg-surface-main)', - 'table-secondary': 'var(--bg-table-secondary)', - 'blue-secondary': 'var(--bg-blue-secondary)', - buttonTertiary: 'var(--bg-button-tertiary)', - bannerInformative: 'var(--bg-banner-informative)', - tagGreen: 'var(--bg-tag-green)', - tagLime: 'var(--bg-tag-lime)', - tagRed: 'var(--bg-tag-red)', - tagYellow: 'var(--bg-tag-yellow)', - selection: 'var(--selection)' - } - }, - borderColor: { - theme: { - primary: 'var(--border-primary)' - } - }, - colors: { - 'blue-primary': '#375DAF' - } - } - } -} + ...tailwindConfig +} \ No newline at end of file diff --git a/packages/ui/src/primitives/tailwind/Accordion/index.tsx b/packages/ui/src/primitives/tailwind/Accordion/index.tsx index d147ab38d5..8d5c5b3eba 100644 --- a/packages/ui/src/primitives/tailwind/Accordion/index.tsx +++ b/packages/ui/src/primitives/tailwind/Accordion/index.tsx @@ -59,7 +59,7 @@ const Accordion = forwardRef( }: AccordionProps, ref: React.MutableRefObject ): JSX.Element => { - const twClassName = twMerge('bg-theme-surface-main w-full rounded-2xl p-6 ', className) + const twClassName = twMerge('w-full rounded-2xl bg-theme-surface-main p-6 ', className) const twClassNameTitle = twMerge('flex flex-row items-center', titleClassName) const openState = useHookstate(false) @@ -70,7 +70,7 @@ const Accordion = forwardRef( return (
{ openState.set((v) => !v) }} diff --git a/packages/ui/src/primitives/tailwind/Input/index.tsx b/packages/ui/src/primitives/tailwind/Input/index.tsx index ea869be00c..102cb59849 100644 --- a/packages/ui/src/primitives/tailwind/Input/index.tsx +++ b/packages/ui/src/primitives/tailwind/Input/index.tsx @@ -79,8 +79,8 @@ const Input = forwardRef( const twClassname = twMerge( 'text-base font-normal tracking-tight', - 'textshadow-sm border-theme-primary bg-theme-surfaceInput flex h-9 w-full rounded-lg border px-3.5 py-5 transition-colors', - 'file:bg-theme-surfaceInput file:border-0 file:text-sm file:font-medium', + 'textshadow-sm flex h-9 w-full rounded-lg border border-theme-primary bg-theme-surfaceInput px-3.5 py-5 transition-colors', + 'file:border-0 file:bg-theme-surfaceInput file:text-sm file:font-medium', 'dark:[color-scheme:dark]', 'focus-visible:ring-ring placeholder:text-gray-400 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50', variant !== 'outlined' ? '' : 'focus-visible:ring-1', @@ -128,9 +128,9 @@ const Input = forwardRef(
{endComponent}
)}
- {description &&

{description}

} + {description &&

{description}

} {error && ( -

+

{error}

)} diff --git a/packages/ui/src/primitives/tailwind/Label/index.tsx b/packages/ui/src/primitives/tailwind/Label/index.tsx index 79f29b48b8..a6d8793c1b 100644 --- a/packages/ui/src/primitives/tailwind/Label/index.tsx +++ b/packages/ui/src/primitives/tailwind/Label/index.tsx @@ -34,7 +34,7 @@ const Label = ({ className, children, ...props }: LabelProps) => { return (