minor fix - email thread reply button stylings/corrections (#7168)

fixes #7155
This commit is contained in:
nitin
2024-09-23 14:34:04 +05:30
committed by GitHub
parent 8d496902b7
commit aa7b3107f4
2 changed files with 55 additions and 48 deletions

View File

@ -13,33 +13,38 @@ import { Button } from '@/ui/input/button/components/Button';
import { RIGHT_DRAWER_CLICK_OUTSIDE_LISTENER_ID } from '@/ui/layout/right-drawer/constants/RightDrawerClickOutsideListener'; import { RIGHT_DRAWER_CLICK_OUTSIDE_LISTENER_ID } from '@/ui/layout/right-drawer/constants/RightDrawerClickOutsideListener';
import { messageThreadState } from '@/ui/layout/right-drawer/states/messageThreadState'; import { messageThreadState } from '@/ui/layout/right-drawer/states/messageThreadState';
import { useClickOutsideListener } from '@/ui/utilities/pointer-event/hooks/useClickOutsideListener'; import { useClickOutsideListener } from '@/ui/utilities/pointer-event/hooks/useClickOutsideListener';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { IconArrowBackUp } from 'twenty-ui'; import { IconArrowBackUp } from 'twenty-ui';
const StyledWrapper = styled.div`
display: flex;
flex-direction: column;
height: 100%;
`;
const StyledContainer = styled.div` const StyledContainer = styled.div`
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 1;
height: 85%; height: 85%;
justify-content: flex-start;
overflow-y: auto; overflow-y: auto;
position: relative;
`; `;
const StyledButtonContainer = styled.div` const StyledButtonContainer = styled.div<{ isMobile: boolean }>`
background: ${({ theme }) => theme.background.secondary}; background: ${({ theme }) => theme.background.secondary};
bottom: 0; border-top: 1px solid ${({ theme }) => theme.border.color.light};
display: flex; display: flex;
height: 110px; justify-content: flex-end;
left: 0; height: ${({ isMobile }) => (isMobile ? '100px' : '50px')};
padding-left: ${({ theme }) => theme.spacing(7)}; padding: ${({ theme }) => theme.spacing(2)};
padding-top: ${({ theme }) => theme.spacing(5)}; width: 100%;
position: fixed; box-sizing: border-box;
right: 0;
`; `;
export const RightDrawerEmailThread = () => { export const RightDrawerEmailThread = () => {
const setMessageThread = useSetRecoilState(messageThreadState); const setMessageThread = useSetRecoilState(messageThreadState);
const isMobile = useIsMobile();
const { const {
thread, thread,
messages, messages,
@ -118,6 +123,7 @@ export const RightDrawerEmailThread = () => {
return null; return null;
} }
return ( return (
<StyledWrapper>
<StyledContainer> <StyledContainer>
{threadLoading ? ( {threadLoading ? (
<EmailLoader loadingText="Loading thread" /> <EmailLoader loadingText="Loading thread" />
@ -149,16 +155,17 @@ export const RightDrawerEmailThread = () => {
/> />
</> </>
)} )}
{canReply && !messageChannelLoading ? ( </StyledContainer>
<StyledButtonContainer> {canReply && !messageChannelLoading && (
<StyledButtonContainer isMobile={isMobile}>
<Button <Button
onClick={handleReplyClick} onClick={handleReplyClick}
title="Reply (View in Gmail)" title="Reply"
Icon={IconArrowBackUp} Icon={IconArrowBackUp}
disabled={!canReply} disabled={!canReply}
></Button> />
</StyledButtonContainer> </StyledButtonContainer>
) : null} )}
</StyledContainer> </StyledWrapper>
); );
}; };

View File

@ -32,7 +32,7 @@ const StyledContainer = styled(motion.div)`
background: ${({ theme }) => theme.background.primary}; background: ${({ theme }) => theme.background.primary};
border-left: 1px solid ${({ theme }) => theme.border.color.medium}; border-left: 1px solid ${({ theme }) => theme.border.color.medium};
box-shadow: ${({ theme }) => theme.boxShadow.strong}; box-shadow: ${({ theme }) => theme.boxShadow.strong};
height: 100%; height: 100dvh;
overflow-x: hidden; overflow-x: hidden;
position: fixed; position: fixed;