From 2eaf2721976544cd096dd6c0c511c802f671352d Mon Sep 17 00:00:00 2001 From: "s.teleshev" Date: Mon, 18 Dec 2023 22:17:57 +0100 Subject: [PATCH] CB-4417 module styles for AuthProvidersList --- .../AuthProviders/AuthProvidersList.m.css | 25 +++++ .../AuthProviders/AuthProvidersList.tsx | 96 ++++++++----------- 2 files changed, 63 insertions(+), 58 deletions(-) create mode 100644 webapp/packages/plugin-user-profile/src/UserProfileForm/AuthProviders/AuthProvidersList.m.css diff --git a/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthProviders/AuthProvidersList.m.css b/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthProviders/AuthProvidersList.m.css new file mode 100644 index 0000000000..dfe45ec4ab --- /dev/null +++ b/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthProviders/AuthProvidersList.m.css @@ -0,0 +1,25 @@ +.container { + display: flex; + flex-direction: column; + overflow: auto; +} + +.list { + overflow: auto; +} + +.cell { + composes: theme-border-color-secondary from global; + border-bottom: 1px solid; + padding: 0 16px; +} + +.iconOrImage { + width: 100%; + height: 100%; +} + +.providerLoginIcon { + width: 24px; + height: 24px; +} diff --git a/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthProviders/AuthProvidersList.tsx b/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthProviders/AuthProvidersList.tsx index 7be62cb45d..e36d89b81a 100644 --- a/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthProviders/AuthProvidersList.tsx +++ b/webapp/packages/plugin-user-profile/src/UserProfileForm/AuthProviders/AuthProvidersList.tsx @@ -6,36 +6,13 @@ * you may not use this file except in compliance with the License. */ import { observer } from 'mobx-react-lite'; -import styled, { css } from 'reshadow'; import { AuthProvidersResource } from '@cloudbeaver/core-authentication'; -import { Cell, getComputed, IconOrImage, Link, Loader, useResource, useStyles, useTranslate } from '@cloudbeaver/core-blocks'; +import { Cell, getComputed, IconOrImage, Link, Loader, s, useResource, useS, useTranslate } from '@cloudbeaver/core-blocks'; import { resourceKeyList } from '@cloudbeaver/core-resource'; import type { UserInfo } from '@cloudbeaver/core-sdk'; -const styles = css` - container { - display: flex; - flex-direction: column; - overflow: auto; - } - list { - overflow: auto; - } - Cell { - composes: theme-border-color-secondary from global; - border-bottom: 1px solid; - padding: 0 16px; - } - IconOrImage { - width: 100%; - height: 100%; - } - provider-login-icon { - width: 24px; - height: 24px; - } -`; +import styles from './AuthProvidersList.m.css'; interface Props { user: UserInfo; @@ -46,43 +23,46 @@ interface Props { export const AuthProvidersList = observer(function AuthProvidersList({ user, providers, className }) { const providersResource = useResource(AuthProvidersList, AuthProvidersResource, resourceKeyList(providers)); const translate = useTranslate(); - const style = useStyles(styles); + const style = useS(styles); const activeProviders = getComputed(() => user.authTokens.map(token => token.authProvider)); - return styled(style)( - + return ( +
- {() => - styled(style)( - - {providersResource.data.map(provider => { - if (!provider) { - return null; - } + {() => ( +
+ {providersResource.data.map(provider => { + if (!provider) { + return null; + } - const title = `${provider.label}\n${provider.description || ''}`; - return ( - - : undefined} - after={ - activeProviders.includes(provider.id) ? ( - - - - ) : undefined - } - description={provider.description} - > - {provider.label} - - - ); - })} - , - ) - } + const title = `${provider.label}\n${provider.description || ''}`; + return ( + + : undefined} + after={ + activeProviders.includes(provider.id) ? ( +
+ +
+ ) : undefined + } + description={provider.description} + > + {provider.label} +
+ + ); + })} +
+ )}
- , +
); });