Update the frontend to adhere to the custom eslint rule twenty/no-spread-props (#1958)
* Update the frontend to adhere to the custom eslint rule `twenty/no-spread-props` Co-authored-by: v1b3m <vibenjamin6@gmail.com> * Update the frontend to adhere to the custom eslint rule `twenty/no-spread-props` Co-authored-by: v1b3m <vibenjamin6@gmail.com> * resolve bug with data-testid --------- Co-authored-by: v1b3m <vibenjamin6@gmail.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 LogoProps = React.ComponentProps<'div'> & {
|
||||
type LogoProps = {
|
||||
workspaceLogo?: string | null;
|
||||
};
|
||||
|
||||
@ -47,19 +47,17 @@ const StyledMainLogo = styled.div<StyledMainLogoProps>`
|
||||
width: 100%;
|
||||
`;
|
||||
|
||||
export const Logo = ({ workspaceLogo, ...props }: LogoProps) => {
|
||||
export const Logo = ({ workspaceLogo }: LogoProps) => {
|
||||
if (!workspaceLogo) {
|
||||
return (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledContainer {...props}>
|
||||
<StyledContainer>
|
||||
<StyledMainLogo logo="/icons/android/android-launchericon-192-192.png" />
|
||||
</StyledContainer>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledContainer {...props}>
|
||||
<StyledContainer>
|
||||
<StyledMainLogo logo={getImageAbsoluteURIOrBase64(workspaceLogo)} />
|
||||
<StyledTwentyLogoContainer>
|
||||
<StyledTwentyLogo src="/icons/android/android-launchericon-192-192.png" />
|
||||
|
||||
@ -8,11 +8,10 @@ const StyledContent = styled(UIModal.Content)`
|
||||
width: calc(400px - ${({ theme }) => theme.spacing(10 * 2)});
|
||||
`;
|
||||
|
||||
type AuthModalProps = React.ComponentProps<'div'>;
|
||||
type AuthModalProps = { children: React.ReactNode };
|
||||
|
||||
export const AuthModal = ({ children, ...restProps }: AuthModalProps) => (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<UIModal isOpen={true} {...restProps}>
|
||||
export const AuthModal = ({ children }: AuthModalProps) => (
|
||||
<UIModal isOpen={true}>
|
||||
<StyledContent>{children}</StyledContent>
|
||||
</UIModal>
|
||||
);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
type FooterNoteProps = React.ComponentProps<'div'>;
|
||||
type FooterNoteProps = { children: React.ReactNode };
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
align-items: center;
|
||||
@ -11,7 +11,6 @@ const StyledContainer = styled.div`
|
||||
text-align: center;
|
||||
`;
|
||||
|
||||
export const FooterNote = (props: FooterNoteProps) => (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledContainer {...props} />
|
||||
export const FooterNote = ({ children }: FooterNoteProps) => (
|
||||
<StyledContainer>{children}</StyledContainer>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user