Files
twenty_crm/front/src/modules/ui/right-drawer/components/RightDrawerTopBar.tsx
gitstart-twenty 991cadbe48 Move trash icon to the top bar of right drawer (#1014)
* Move trash icon to the top bar of right drawer

Co-authored-by: Matheus <matheus_benini@hotmail.com>

* Fix background

Co-authored-by: Matheus <matheus_benini@hotmail.com>

* Refactor the code

Co-authored-by: Matheus <matheus_benini@hotmail.com>

---------

Co-authored-by: Matheus <matheus_benini@hotmail.com>
2023-08-01 22:10:02 -07:00

45 lines
1.5 KiB
TypeScript

import styled from '@emotion/styled';
import { useRecoilValue } from 'recoil';
import { ActivityActionBar } from '@/activities/right-drawer/components/ActivityActionBar';
import { viewableActivityIdState } from '@/activities/states/viewableActivityIdState';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { RightDrawerTopBarCloseButton } from './RightDrawerTopBarCloseButton';
import { RightDrawerTopBarExpandButton } from './RightDrawerTopBarExpandButton';
const StyledRightDrawerTopBar = styled.div`
align-items: center;
background: ${({ theme }) => theme.background.secondary};
border-bottom: 1px solid ${({ theme }) => theme.border.color.light};
color: ${({ theme }) => theme.font.color.secondary};
display: flex;
flex-direction: row;
font-size: ${({ theme }) => theme.font.size.md};
gap: ${({ theme }) => theme.spacing(1)};
height: 56px;
justify-content: space-between;
padding-left: ${({ theme }) => theme.spacing(2)};
padding-right: ${({ theme }) => theme.spacing(2)};
`;
const TopBarWrapper = styled.div`
display: flex;
`;
export function RightDrawerTopBar() {
const isMobile = useIsMobile();
const activityId = useRecoilValue(viewableActivityIdState);
return (
<StyledRightDrawerTopBar>
<TopBarWrapper>
<RightDrawerTopBarCloseButton />
{!isMobile && <RightDrawerTopBarExpandButton />}
</TopBarWrapper>
<ActivityActionBar activityId={activityId ?? ''} />
</StyledRightDrawerTopBar>
);
}