feat: added Livechat's new theming settings to Appearance page (#32043)
Co-authored-by: Kevin Aleman <11577696+KevLehman@users.noreply.github.com>pull/32061/head^2
parent
95540f58de
commit
d1b1ffe9e5
@ -0,0 +1,13 @@ |
||||
--- |
||||
"@rocket.chat/meteor": minor |
||||
"@rocket.chat/rest-typings": minor |
||||
--- |
||||
|
||||
**Added Livechat's new theming settings to Appearance page (available for Premium workspaces)** |
||||
|
||||
Newly added settings are: |
||||
- `Livechat widget position on the screen`: Changes the widget position between left or right of the viewport |
||||
- `Livechat background`: Changes the message list background. Receives the same value as the CSS's background property. |
||||
- `Hide system messages`: Changes the visibility of system messages displayed on the widget. |
||||
- `Hide "powered by Rocket.Chat"`: Changes the visibility of Rocket.Chat's watermark on the widget. |
||||
|
||||
@ -0,0 +1,32 @@ |
||||
import { FieldLabel as BaseFieldLabel, Box, Tag } from '@rocket.chat/fuselage'; |
||||
import { useTranslation } from '@rocket.chat/ui-contexts'; |
||||
import type { ComponentProps } from 'react'; |
||||
import React from 'react'; |
||||
|
||||
import { useHasLicenseModule } from '../../../../ee/client/hooks/useHasLicenseModule'; |
||||
|
||||
type FieldLabelProps = ComponentProps<typeof BaseFieldLabel> & { |
||||
premium?: boolean; |
||||
children: string; |
||||
}; |
||||
|
||||
const FieldLabel = ({ children: label, premium = false }: FieldLabelProps) => { |
||||
const t = useTranslation(); |
||||
const hasLicense = useHasLicenseModule('livechat-enterprise'); |
||||
const shouldDisableEnterprise = premium && !hasLicense; |
||||
|
||||
if (!shouldDisableEnterprise) { |
||||
return <BaseFieldLabel>{label}</BaseFieldLabel>; |
||||
} |
||||
|
||||
return ( |
||||
<BaseFieldLabel> |
||||
<Box is='span' mie={4}> |
||||
{label} |
||||
</Box> |
||||
<Tag variant='primary'>{t('Premium')}</Tag> |
||||
</BaseFieldLabel> |
||||
); |
||||
}; |
||||
|
||||
export default FieldLabel; |
||||
Loading…
Reference in new issue