Skip to content

Commit f46ddd2

Browse files
committed
fix css issues for lightspeed on RHDH
1 parent de82dff commit f46ddd2

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedDrawerProvider.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ import { ChatbotDisplayMode, ChatbotModal } from '@patternfly/chatbot';
2929
import { LightspeedChatContainer } from './LightspeedChatContainer';
3030
import { LightspeedDrawerContext } from './LightspeedDrawerContext';
3131

32-
const useStyles = makeStyles(() => ({
32+
const useStyles = makeStyles(theme => ({
3333
chatbotModal: {
34+
boxShadow:
35+
'0 14px 20px -7px rgba(0, 0, 0, 0.22), 0 32px 50px 6px rgba(0, 0, 0, 0.16), 0 12px 60px 12px rgba(0, 0, 0, 0.14) !important',
36+
bottom: `calc(${theme?.spacing?.(2) ?? '16px'} + 5em)`,
37+
right: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,
3438
// When docked drawer is open, adjust modal position
3539
'body.docked-drawer-open &': {
3640
transition: 'margin-right 0.3s ease',
@@ -128,6 +132,10 @@ export const LightspeedDrawerProvider = ({ children }: PropsWithChildren) => {
128132
// Set display mode with route handling for embedded/fullscreen
129133
const setDisplayMode = useCallback(
130134
(mode: ChatbotDisplayMode, conversationId?: string) => {
135+
if (mode === displayModeState) {
136+
return;
137+
}
138+
131139
setDisplayModeState(mode);
132140

133141
// Navigate to fullscreen route with conversation ID if available
@@ -145,7 +153,7 @@ export const LightspeedDrawerProvider = ({ children }: PropsWithChildren) => {
145153
setIsOpen(true);
146154
}
147155
},
148-
[navigate, isLightspeedRoute, currentConversationIdState],
156+
[navigate, isLightspeedRoute, currentConversationIdState, displayModeState],
149157
);
150158

151159
// Only render ChatbotModal for overlay mode

workspaces/lightspeed/plugins/lightspeed/src/components/LightspeedFAB.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ import { useLightspeedDrawerContext } from '../hooks/useLightspeedDrawerContext'
2424
import { LightspeedFABIcon } from './LightspeedIcon';
2525

2626
const useStyles = makeStyles(theme => ({
27+
fab: {
28+
opacity: '1 !important',
29+
backgroundColor: `${theme?.palette?.primary?.main ?? '#1976d2'} !important`,
30+
color: `${theme?.palette?.primary?.contrastText ?? '#fff'} !important`,
31+
boxShadow: `${
32+
theme?.shadows?.[6] ??
33+
'0px 3px 5px -1px rgba(0,0,0,0.2), 0px 6px 10px 0px rgba(0,0,0,0.14), 0px 1px 18px 0px rgba(0,0,0,0.12)'
34+
} !important`,
35+
'&:hover': {
36+
backgroundColor: `${theme?.palette?.primary?.dark ?? '#1565c0'} !important`,
37+
boxShadow: `${
38+
theme?.shadows?.[8] ??
39+
'0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)'
40+
} !important`,
41+
},
42+
},
2743
'fab-button': {
2844
bottom: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,
2945
right: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,
@@ -70,6 +86,7 @@ export const LightspeedFAB = () => {
7086
size="small"
7187
onClick={toggleChatbot}
7288
aria-label={isChatbotActive ? 'lightspeed-open' : 'lightspeed-close'}
89+
className={fabButton.fab}
7390
sx={{ borderRadius: '100% !important' }}
7491
>
7592
{isChatbotActive ? <Close fontSize="small" /> : <LightspeedFABIcon />}

0 commit comments

Comments
 (0)