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 * as React from 'react';
|
||||
import { Link as ReactLink } from 'react-router-dom';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
type OwnProps = {
|
||||
type ContactLinkProps = {
|
||||
className?: string;
|
||||
href: string;
|
||||
children?: React.ReactNode;
|
||||
@ -30,7 +30,7 @@ export const ContactLink = ({
|
||||
href,
|
||||
children,
|
||||
onClick,
|
||||
}: OwnProps) => (
|
||||
}: ContactLinkProps) => (
|
||||
<div>
|
||||
<StyledClickable className={className}>
|
||||
<ReactLink target="_blank" onClick={onClick} to={href}>
|
||||
|
||||
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { Link as ReactLink } from 'react-router-dom';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
type OwnProps = {
|
||||
type PrimaryLinkProps = {
|
||||
children: React.ReactNode;
|
||||
href: string;
|
||||
onClick?: () => void;
|
||||
@ -18,7 +18,7 @@ const StyledClickable = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
export const PrimaryLink = ({ href, children, onClick }: OwnProps) => (
|
||||
export const PrimaryLink = ({ href, children, onClick }: PrimaryLinkProps) => (
|
||||
<StyledClickable>
|
||||
<ReactLink onClick={onClick} to={href}>
|
||||
{children}
|
||||
|
||||
@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import { Link as ReactLink } from 'react-router-dom';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
type OwnProps = {
|
||||
type RawLinkProps = {
|
||||
className?: string;
|
||||
href: string;
|
||||
children?: React.ReactNode;
|
||||
@ -19,7 +19,12 @@ const StyledClickable = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
export const RawLink = ({ className, href, children, onClick }: OwnProps) => (
|
||||
export const RawLink = ({
|
||||
className,
|
||||
href,
|
||||
children,
|
||||
onClick,
|
||||
}: RawLinkProps) => (
|
||||
<div>
|
||||
<StyledClickable className={className}>
|
||||
<ReactLink target="_blank" onClick={onClick} to={href}>
|
||||
|
||||
@ -5,7 +5,7 @@ import styled from '@emotion/styled';
|
||||
import { Chip } from '@/ui/chip/components/Chip';
|
||||
import { ChipSize, ChipVariant } from '@/ui/chip/components/Chip';
|
||||
|
||||
type OwnProps = {
|
||||
type RoundedLinkProps = {
|
||||
href: string;
|
||||
children?: React.ReactNode;
|
||||
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
||||
@ -21,7 +21,7 @@ const StyledClickable = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
export const RoundedLink = ({ children, href, onClick }: OwnProps) => (
|
||||
export const RoundedLink = ({ children, href, onClick }: RoundedLinkProps) => (
|
||||
<div>
|
||||
{children !== '' ? (
|
||||
<StyledClickable>
|
||||
|
||||
@ -9,7 +9,7 @@ export enum LinkType {
|
||||
Twitter = 'twitter',
|
||||
}
|
||||
|
||||
type OwnProps = {
|
||||
type SocialLinkProps = {
|
||||
href: string;
|
||||
children?: React.ReactNode;
|
||||
type?: LinkType;
|
||||
@ -26,7 +26,12 @@ const StyledRawLink = styled(RoundedLink)`
|
||||
}
|
||||
`;
|
||||
|
||||
export const SocialLink = ({ children, href, onClick, type }: OwnProps) => {
|
||||
export const SocialLink = ({
|
||||
children,
|
||||
href,
|
||||
onClick,
|
||||
type,
|
||||
}: SocialLinkProps) => {
|
||||
let displayValue = children;
|
||||
|
||||
if (type === 'linkedin') {
|
||||
|
||||
Reference in New Issue
Block a user