Fix 0.32 bis (#8346)

Various UI fixes according to discussions with Design team
This commit is contained in:
Charles Bochet
2024-11-05 18:14:44 +01:00
committed by GitHub
parent 3793f6c451
commit 88ba057b2c
12 changed files with 50 additions and 18 deletions

View File

@ -1,8 +1,10 @@
import styled from '@emotion/styled';
import { Button, IconHelpCircle } from 'twenty-ui';
import { Button, IconHelpCircle, LightIconButton } from 'twenty-ui';
import { SupportButtonSkeletonLoader } from '@/support/components/SupportButtonSkeletonLoader';
import { useSupportChat } from '@/support/hooks/useSupportChat';
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
import { useRecoilValue } from 'recoil';
const StyledButtonContainer = styled.div`
display: flex;
@ -11,11 +13,18 @@ const StyledButtonContainer = styled.div`
export const SupportButton = () => {
const { loading, isFrontChatLoaded } = useSupportChat();
const isNavigationDrawerExpanded = useRecoilValue(
isNavigationDrawerExpandedState,
);
if (loading) {
return <SupportButtonSkeletonLoader />;
}
return isFrontChatLoaded ? (
if (!isFrontChatLoaded) {
return;
}
return isNavigationDrawerExpanded ? (
<StyledButtonContainer>
<Button
variant="tertiary"
@ -24,5 +33,7 @@ export const SupportButton = () => {
Icon={IconHelpCircle}
/>
</StyledButtonContainer>
) : null;
) : (
<LightIconButton Icon={IconHelpCircle} />
);
};