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

@ -50,11 +50,11 @@ const StyledMainContainer = styled.div`
}
`;
type OwnProps = {
type DefaultLayoutProps = {
children: React.ReactNode;
};
export const DefaultLayout = ({ children }: OwnProps) => {
export const DefaultLayout = ({ children }: DefaultLayoutProps) => {
const onboardingStatus = useOnboardingStatus();
return (

View File

@ -1,11 +1,11 @@
import { IconButton } from '@/ui/button/components/IconButton';
import { IconPlus } from '@/ui/icon';
type OwnProps = {
type PageAddButtonProps = {
onClick: () => void;
};
export const PageAddButton = ({ onClick }: OwnProps) => (
export const PageAddButton = ({ onClick }: PageAddButtonProps) => (
<IconButton
Icon={IconPlus}
dataTestId="add-button"

View File

@ -1,11 +1,11 @@
import { PAGE_BAR_MIN_HEIGHT } from './PageHeader';
import { RightDrawerContainer } from './RightDrawerContainer';
type OwnProps = {
type PageBodyProps = {
children: JSX.Element | JSX.Element[];
};
export const PageBody = ({ children }: OwnProps) => (
export const PageBody = ({ children }: PageBodyProps) => (
<RightDrawerContainer topMargin={PAGE_BAR_MIN_HEIGHT + 16 + 16}>
{children}
</RightDrawerContainer>

View File

@ -1,6 +1,6 @@
import styled from '@emotion/styled';
type OwnProps = {
type PageContainerProps = {
children: JSX.Element | JSX.Element[];
};
@ -10,6 +10,6 @@ const StyledContainer = styled.div`
width: 100%;
`;
export const PageContainer = ({ children }: OwnProps) => (
export const PageContainer = ({ children }: PageContainerProps) => (
<StyledContainer>{children}</StyledContainer>
);

View File

@ -1,12 +1,15 @@
import { IconButton } from '@/ui/button/components/IconButton';
import { IconHeart } from '@/ui/icon';
type OwnProps = {
type PageFavoriteButtonProps = {
isFavorite: boolean;
onClick: () => void;
};
export const PageFavoriteButton = ({ isFavorite, onClick }: OwnProps) => (
export const PageFavoriteButton = ({
isFavorite,
onClick,
}: PageFavoriteButtonProps) => (
<IconButton
Icon={IconHeart}
size="medium"

View File

@ -1,11 +1,13 @@
import { TableHotkeyScope } from '@/ui/data-table/types/TableHotkeyScope';
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
type OwnProps = {
type PageHotkeysEffectProps = {
onAddButtonClick?: () => void;
};
export const PageHotkeysEffect = ({ onAddButtonClick }: OwnProps) => {
export const PageHotkeysEffect = ({
onAddButtonClick,
}: PageHotkeysEffectProps) => {
useScopedHotkeys('c', () => onAddButtonClick?.(), TableHotkeyScope.Table, [
onAddButtonClick,
]);

View File

@ -4,7 +4,7 @@ import { RightDrawer } from '@/ui/right-drawer/components/RightDrawer';
import { PagePanel } from './PagePanel';
type OwnProps = {
type RightDrawerContainerProps = {
children: JSX.Element | JSX.Element[];
topMargin?: number;
};
@ -33,7 +33,10 @@ const StyledLeftContainer = styled.div<LeftContainerProps>`
width: 100%;
`;
export const RightDrawerContainer = ({ children, topMargin }: OwnProps) => (
export const RightDrawerContainer = ({
children,
topMargin,
}: RightDrawerContainerProps) => (
<StyledMainContainer topMargin={topMargin ?? 0}>
<StyledLeftContainer>
<PagePanel>{children}</PagePanel>

View File

@ -35,7 +35,7 @@ const StyledTabListContainer = styled.div`
height: 40px;
`;
type OwnProps = {
type ShowPageRightContainerProps = {
entity: ActivityTargetableEntity;
timeline?: boolean;
tasks?: boolean;
@ -49,7 +49,7 @@ export const ShowPageRightContainer = ({
tasks,
notes,
emails,
}: OwnProps) => {
}: ShowPageRightContainerProps) => {
const TASK_TABS = [
{
id: 'timeline',

View File

@ -11,7 +11,7 @@ import {
import { OverflowingTextWithTooltip } from '../../../tooltip/OverflowingTextWithTooltip';
type OwnProps = {
type ShowPageSummaryCardProps = {
id?: string;
logoOrAvatar?: string;
title: string;
@ -81,7 +81,7 @@ export const ShowPageSummaryCard = ({
avatarType,
renderTitleEditComponent,
onUploadPicture,
}: OwnProps) => {
}: ShowPageSummaryCardProps) => {
const beautifiedCreatedAt =
date !== '' ? beautifyPastDateRelativeToNow(date) : '';
const exactCreatedAt = date !== '' ? beautifyExactDateTime(date) : '';