Chore(front): Create a custom eslint rule for Props naming (#1904)

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
This commit is contained in:
gitstart-twenty
2023-10-09 17:31:13 +03:00
committed by GitHub
parent 84ed9edefe
commit 77a1840611
170 changed files with 700 additions and 342 deletions

View File

@ -18,7 +18,7 @@ import {
import { ACTIVITY_UPDATE_FRAGMENT } from '../graphql/fragments/activityUpdateFragment';
import { GET_ACTIVITIES } from '../graphql/queries/getActivities';
export type OwnProps = {
export type ActivityAssigneePickerProps = {
activity: Pick<Activity, 'id'> & {
accountOwner?: Pick<User, 'id' | 'displayName'> | null;
};
@ -34,7 +34,7 @@ export const ActivityAssigneePicker = ({
activity,
onSubmit,
onCancel,
}: OwnProps) => {
}: ActivityAssigneePickerProps) => {
const [relationPickerSearchFilter] = useRecoilScopedState(
relationPickerSearchFilterScopedState,
);

View File

@ -14,12 +14,15 @@ const StyledBlockNoteStyledContainer = styled.div`
width: 100%;
`;
type OwnProps = {
type ActivityBodyEditorProps = {
activity: Pick<Activity, 'id' | 'body'>;
onChange?: (activityBody: string) => void;
};
export const ActivityBodyEditor = ({ activity, onChange }: OwnProps) => {
export const ActivityBodyEditor = ({
activity,
onChange,
}: ActivityBodyEditorProps) => {
const [updateActivityMutation] = useUpdateActivityMutation();
const client = useApolloClient();

View File

@ -16,7 +16,7 @@ import { Comment } from '../comment/Comment';
import { GET_ACTIVITY } from '../graphql/queries/getActivity';
import { CommentForDrawer } from '../types/CommentForDrawer';
type OwnProps = {
type ActivityCommentsProps = {
activity: Pick<Activity, 'id'> & {
comments: Array<CommentForDrawer>;
};
@ -62,7 +62,7 @@ const StyledThreadCommentTitle = styled.div`
export const ActivityComments = ({
activity,
scrollableContainerRef,
}: OwnProps) => {
}: ActivityCommentsProps) => {
const [createCommentMutation] = useCreateCommentMutation();
const currentUser = useRecoilValue(currentUserState);

View File

@ -60,7 +60,7 @@ const StyledTopContainer = styled.div`
padding: 24px 24px 24px 48px;
`;
type OwnProps = {
type ActivityEditorProps = {
activity: Pick<
Activity,
'id' | 'title' | 'body' | 'type' | 'completedAt' | 'dueAt'
@ -82,7 +82,7 @@ export const ActivityEditor = ({
activity,
showComment = true,
autoFillTitle = false,
}: OwnProps) => {
}: ActivityEditorProps) => {
const [hasUserManuallySetTitle, setHasUserManuallySetTitle] =
useState<boolean>(false);

View File

@ -44,7 +44,7 @@ const StyledCheckboxContainer = styled.div`
justify-content: center;
`;
type OwnProps = {
type ActivityTitleProps = {
title: string;
type: ActivityType;
completed: boolean;
@ -58,7 +58,7 @@ export const ActivityTitle = ({
type,
onTitleChange,
onCompletionChange,
}: OwnProps) => (
}: ActivityTitleProps) => (
<StyledContainer>
{type === ActivityType.Task && (
<StyledCheckboxContainer onClick={() => onCompletionChange(!completed)}>

View File

@ -9,11 +9,13 @@ import {
import { IconCheckbox, IconNotes } from '@/ui/icon';
import { Activity, ActivityType } from '~/generated/graphql';
type OwnProps = {
type ActivityTypeDropdownProps = {
activity: Pick<Activity, 'type'>;
};
export const ActivityTypeDropdown = ({ activity }: OwnProps) => {
export const ActivityTypeDropdown = ({
activity,
}: ActivityTypeDropdownProps) => {
const theme = useTheme();
return (
<Chip