* Fix naming * Fixed cache.evict bug for relation target deletion * Fixed cascade delete activity targets * Working version * Fix * fix * WIP * Fixed optimistic effect target inline cell * Removed openCreateActivityDrawer v1 * Ok for timeline * Removed console.log * Fix update record optimistic effect * Refactored activity queries into useActivities for everything * Fixed bugs * Cleaned * Fix lint --------- Co-authored-by: Charles Bochet <charles@twenty.com>
45 lines
966 B
TypeScript
45 lines
966 B
TypeScript
import styled from '@emotion/styled';
|
|
|
|
import { ActivityEditor } from '@/activities/components/ActivityEditor';
|
|
import { useActivityById } from '@/activities/hooks/useActivityById';
|
|
|
|
const StyledContainer = styled.div`
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
justify-content: space-between;
|
|
overflow-y: auto;
|
|
position: relative;
|
|
`;
|
|
|
|
type RightDrawerActivityProps = {
|
|
activityId: string;
|
|
showComment?: boolean;
|
|
fillTitleFromBody?: boolean;
|
|
};
|
|
|
|
export const RightDrawerActivity = ({
|
|
activityId,
|
|
showComment = true,
|
|
fillTitleFromBody = false,
|
|
}: RightDrawerActivityProps) => {
|
|
const { activity, loading } = useActivityById({
|
|
activityId,
|
|
});
|
|
|
|
if (!activity || loading) {
|
|
return <></>;
|
|
}
|
|
|
|
return (
|
|
<StyledContainer>
|
|
<ActivityEditor
|
|
activity={activity}
|
|
showComment={showComment}
|
|
fillTitleFromBody={fillTitleFromBody}
|
|
/>
|
|
</StyledContainer>
|
|
);
|
|
};
|