Files
twenty/front/src/modules/activities/right-drawer/components/RightDrawerActivity.tsx
T
gitstart-twenty 00a3c8ca2b Change to using arrow functions (#1603)
* Change to using arrow functions

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

* Add lint rule

---------

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2023-09-15 18:41:10 -07:00

52 lines
1.0 KiB
TypeScript

import React from 'react';
import styled from '@emotion/styled';
import { ActivityEditor } from '@/activities/components/ActivityEditor';
import { useGetActivityQuery } from '~/generated/graphql';
import '@blocknote/core/style.css';
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 OwnProps = {
activityId: string;
showComment?: boolean;
autoFillTitle?: boolean;
};
export const RightDrawerActivity = ({
activityId,
showComment = true,
autoFillTitle = false,
}: OwnProps) => {
const { data } = useGetActivityQuery({
variables: {
activityId: activityId ?? '',
},
skip: !activityId,
});
const activity = data?.findManyActivities[0];
if (!activity) {
return <></>;
}
return (
<StyledContainer>
<ActivityEditor
activity={activity}
showComment={showComment}
autoFillTitle={autoFillTitle}
/>
</StyledContainer>
);
};