From 74a298cb3c0a09e005ca1394e46604f7ee6ad2fb Mon Sep 17 00:00:00 2001 From: Travis Vachon Date: Thu, 2 Feb 2023 12:22:21 +0800 Subject: [PATCH] fix: fix w3console styling (#320) I broke the w3console styling by failing to include some of the new stylesheets from the react components. Fix that, and introduce an omnibus CSS file called `all.css` to make this easier in the future. Also tweak the Authenticator component to accept a top-level CSS class - I didn't end up using this, but implemented it while debugging and I think it's good to leave in. --- examples/react/w3console/src/app.tsx | 4 +--- packages/react/src/Authenticator.tsx | 9 +++++++-- packages/react/src/styles/all.css | 5 +++++ 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 packages/react/src/styles/all.css diff --git a/examples/react/w3console/src/app.tsx b/examples/react/w3console/src/app.tsx index b2792e95..1b29e367 100644 --- a/examples/react/w3console/src/app.tsx +++ b/examples/react/w3console/src/app.tsx @@ -7,9 +7,7 @@ import { useKeyring } from '@w3ui/react-keyring' import { useUploadsList } from '@w3ui/react-uploads-list' import { ShareIcon } from '@heroicons/react/20/solid' import md5 from 'blueimp-md5' -import '@w3ui/react/src/styles/uploader.css' -import '@w3ui/react/src/styles/space-finder.css' -import '@w3ui/react/src/styles/uploads-list.css' +import '@w3ui/react/src/styles/all.css' import { SpaceShare } from './share' function SpaceRegistrar (): JSX.Element { diff --git a/packages/react/src/Authenticator.tsx b/packages/react/src/Authenticator.tsx index d5d86dfc..ceef34c7 100644 --- a/packages/react/src/Authenticator.tsx +++ b/packages/react/src/Authenticator.tsx @@ -41,9 +41,14 @@ export function AuthenticationEnsurer ({ children }: { children: JSX.Element | J } } -export function Authenticator ({ children }: { children: JSX.Element | JSX.Element[] }): JSX.Element { +interface AuthenticatorProps { + children: JSX.Element | JSX.Element[] + className?: string +} + +export function Authenticator ({ children, className = '' }: AuthenticatorProps): JSX.Element { return ( - + {children} diff --git a/packages/react/src/styles/all.css b/packages/react/src/styles/all.css new file mode 100644 index 00000000..884a2ab8 --- /dev/null +++ b/packages/react/src/styles/all.css @@ -0,0 +1,5 @@ +@import url(authenticator.css); +@import url(space-creator.css); +@import url(space-finder.css); +@import url(uploader.css); +@import url(uploads-list.css);