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:
@ -2,7 +2,7 @@ import styled from '@emotion/styled';
|
||||
|
||||
import { getImageAbsoluteURIOrBase64 } from '@/users/utils/getProfilePictureAbsoluteURI';
|
||||
|
||||
type Props = React.ComponentProps<'div'> & {
|
||||
type LogoProps = React.ComponentProps<'div'> & {
|
||||
workspaceLogo?: string | null;
|
||||
};
|
||||
|
||||
@ -47,7 +47,7 @@ const StyledMainLogo = styled.div<StyledMainLogoProps>`
|
||||
width: 100%;
|
||||
`;
|
||||
|
||||
export const Logo = ({ workspaceLogo, ...props }: Props) => {
|
||||
export const Logo = ({ workspaceLogo, ...props }: LogoProps) => {
|
||||
if (!workspaceLogo) {
|
||||
return (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
|
||||
@ -8,9 +8,9 @@ const StyledContent = styled(UIModal.Content)`
|
||||
width: calc(400px - ${({ theme }) => theme.spacing(10 * 2)});
|
||||
`;
|
||||
|
||||
type Props = React.ComponentProps<'div'>;
|
||||
type AuthModalProps = React.ComponentProps<'div'>;
|
||||
|
||||
export const AuthModal = ({ children, ...restProps }: Props) => (
|
||||
export const AuthModal = ({ children, ...restProps }: AuthModalProps) => (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<UIModal isOpen={true} {...restProps}>
|
||||
<StyledContent>{children}</StyledContent>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { JSX, ReactNode } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
type OwnProps = {
|
||||
type SubTitleProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
@ -9,6 +9,6 @@ const StyledSubTitle = styled.div`
|
||||
color: ${({ theme }) => theme.font.color.secondary};
|
||||
`;
|
||||
|
||||
export const SubTitle = ({ children }: OwnProps): JSX.Element => (
|
||||
export const SubTitle = ({ children }: SubTitleProps): JSX.Element => (
|
||||
<StyledSubTitle>{children}</StyledSubTitle>
|
||||
);
|
||||
|
||||
@ -3,7 +3,7 @@ import styled from '@emotion/styled';
|
||||
|
||||
import { AnimatedEaseIn } from '@/ui/utilities/animation/components/AnimatedEaseIn';
|
||||
|
||||
type Props = React.PropsWithChildren & {
|
||||
type TitleProps = React.PropsWithChildren & {
|
||||
animate?: boolean;
|
||||
};
|
||||
|
||||
@ -15,7 +15,7 @@ const StyledTitle = styled.div`
|
||||
margin-top: ${({ theme }) => theme.spacing(4)};
|
||||
`;
|
||||
|
||||
export const Title = ({ children, animate = false }: Props) => {
|
||||
export const Title = ({ children, animate = false }: TitleProps) => {
|
||||
if (animate) {
|
||||
return (
|
||||
<StyledTitle>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
type Props = React.ComponentProps<'div'>;
|
||||
type FooterNoteProps = React.ComponentProps<'div'>;
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
align-items: center;
|
||||
@ -11,5 +11,7 @@ const StyledContainer = styled.div`
|
||||
text-align: center;
|
||||
`;
|
||||
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
export const FooterNote = (props: Props) => <StyledContainer {...props} />;
|
||||
export const FooterNote = (props: FooterNoteProps) => (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledContainer {...props} />
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user