Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added Livechat's new theming settings to Appearance page (#32043)
Co-authored-by: Kevin Aleman <11577696+KevLehman@users.noreply.github.com>
- Loading branch information
1 parent
95540f5
commit d1b1ffe
Showing
7 changed files
with
229 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
apps/meteor/client/views/omnichannel/appearance/AppearanceFieldLabel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters