TWNTY-3825 - ESLint rule: const naming (#4171)
* ESLint rule: const naming Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev> * refactor: Reverts changes on `twenty-server` Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev> Co-authored-by: v1b3m <vibenjamin6@gmail.com> --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: KlingerMatheus <klinger.matheus@gitstart.dev>
This commit is contained in:
committed by
GitHub
parent
a108d36040
commit
f543191552
@ -4,12 +4,10 @@ import styled from '@emotion/styled';
|
||||
import { motion, useMotionValue, useTransform } from 'framer-motion';
|
||||
import { animate } from 'framer-motion';
|
||||
|
||||
import {
|
||||
Background,
|
||||
DarkBackground,
|
||||
DarkMovingImage,
|
||||
MovingImage,
|
||||
} from '@/ui/layout/animated-placeholder/constants/AnimatedImages';
|
||||
import { BACKGROUND } from '@/ui/layout/animated-placeholder/constants/Background';
|
||||
import { DARK_BACKGROUND } from '@/ui/layout/animated-placeholder/constants/DarkBackground';
|
||||
import { DARK_MOVING_IMAGE } from '@/ui/layout/animated-placeholder/constants/DarkMovingImage';
|
||||
import { MOVING_IMAGE } from '@/ui/layout/animated-placeholder/constants/MovingImage';
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
display: flex;
|
||||
@ -39,7 +37,7 @@ const StyledMovingImage = styled(motion.img)<StyledImageProps>`
|
||||
`;
|
||||
|
||||
interface AnimatedPlaceholderProps {
|
||||
type: keyof typeof Background | keyof typeof MovingImage;
|
||||
type: keyof typeof BACKGROUND | keyof typeof MOVING_IMAGE;
|
||||
}
|
||||
|
||||
const AnimatedPlaceholder = ({ type }: AnimatedPlaceholderProps) => {
|
||||
@ -89,12 +87,14 @@ const AnimatedPlaceholder = ({ type }: AnimatedPlaceholderProps) => {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<StyledBackgroundImage
|
||||
src={theme.name === 'dark' ? DarkBackground[type] : Background[type]}
|
||||
src={theme.name === 'dark' ? DARK_BACKGROUND[type] : BACKGROUND[type]}
|
||||
alt="Background"
|
||||
type={type}
|
||||
/>
|
||||
<StyledMovingImage
|
||||
src={theme.name === 'dark' ? DarkMovingImage[type] : MovingImage[type]}
|
||||
src={
|
||||
theme.name === 'dark' ? DARK_MOVING_IMAGE[type] : MOVING_IMAGE[type]
|
||||
}
|
||||
alt="Moving"
|
||||
style={{ translateX, translateY }}
|
||||
transition={{ type: 'spring', stiffness: 100, damping: 10 }}
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
export const Background: Record<string, string> = {
|
||||
noFile: '/images/placeholders/background/no_file_bg.png',
|
||||
noNote: '/images/placeholders/background/no_note_bg.png',
|
||||
noRecord: '/images/placeholders/background/no_record_bg.png',
|
||||
noMatchRecord: '/images/placeholders/background/no_match_record_bg.png',
|
||||
noTask: '/images/placeholders/background/no_task_bg.png',
|
||||
errorIndex: '/images/placeholders/background/error_index_bg.png',
|
||||
emptyTimeline: '/images/placeholders/background/empty_timeline_bg.png',
|
||||
loadingMessages: '/images/placeholders/background/loading_messages_bg.png',
|
||||
loadingAccounts: '/images/placeholders/background/loading_accounts_bg.png',
|
||||
emptyInbox: '/images/placeholders/background/empty_inbox_bg.png',
|
||||
error404: '/images/placeholders/background/404_bg.png',
|
||||
error500: '/images/placeholders/background/500_bg.png',
|
||||
};
|
||||
|
||||
export const MovingImage: Record<string, string> = {
|
||||
noFile: '/images/placeholders/moving-image/no_file.png',
|
||||
noNote: '/images/placeholders/moving-image/no_note.png',
|
||||
noRecord: '/images/placeholders/moving-image/no_record.png',
|
||||
noMatchRecord: '/images/placeholders/moving-image/no_match_record.png',
|
||||
noTask: '/images/placeholders/moving-image/no_task.png',
|
||||
errorIndex: '/images/placeholders/moving-image/error_index.png',
|
||||
emptyTimeline: '/images/placeholders/moving-image/empty_timeline.png',
|
||||
loadingMessages: '/images/placeholders/moving-image/loading_messages.png',
|
||||
loadingAccounts: '/images/placeholders/moving-image/loading_accounts.png',
|
||||
emptyInbox: '/images/placeholders/moving-image/empty_inbox.png',
|
||||
error404: '/images/placeholders/moving-image/404.png',
|
||||
error500: '/images/placeholders/moving-image/500.png',
|
||||
};
|
||||
|
||||
export const DarkBackground: Record<string, string> = {
|
||||
noFile: '/images/placeholders/dark-background/no_file_bg.png',
|
||||
noNote: '/images/placeholders/dark-background/no_note_bg.png',
|
||||
noRecord: '/images/placeholders/dark-background/no_record_bg.png',
|
||||
noMatchRecord: '/images/placeholders/dark-background/no_match_record_bg.png',
|
||||
noTask: '/images/placeholders/dark-background/no_task_bg.png',
|
||||
errorIndex: '/images/placeholders/dark-background/error_index_bg.png',
|
||||
emptyTimeline: '/images/placeholders/dark-background/empty_timeline_bg.png',
|
||||
emptyInbox: '/images/placeholders/dark-background/empty_inbox_bg.png',
|
||||
error404: '/images/placeholders/dark-background/404_bg.png',
|
||||
error500: '/images/placeholders/dark-background/500_bg.png',
|
||||
loadingMessages: '/images/placeholders/background/loading_messages_bg.png',
|
||||
loadingAccounts: '/images/placeholders/background/loading_accounts_bg.png',
|
||||
};
|
||||
|
||||
export const DarkMovingImage: Record<string, string> = {
|
||||
noFile: '/images/placeholders/dark-moving-image/no_file.png',
|
||||
noNote: '/images/placeholders/dark-moving-image/no_note.png',
|
||||
noRecord: '/images/placeholders/dark-moving-image/no_record.png',
|
||||
noMatchRecord: '/images/placeholders/dark-moving-image/no_match_record.png',
|
||||
noTask: '/images/placeholders/dark-moving-image/no_task.png',
|
||||
errorIndex: '/images/placeholders/dark-moving-image/error_index.png',
|
||||
emptyTimeline: '/images/placeholders/dark-moving-image/empty_timeline.png',
|
||||
emptyInbox: '/images/placeholders/dark-moving-image/empty_inbox.png',
|
||||
error404: '/images/placeholders/dark-moving-image/404.png',
|
||||
error500: '/images/placeholders/dark-moving-image/500.png',
|
||||
loadingMessages: '/images/placeholders/moving-image/loading_messages.png',
|
||||
loadingAccounts: '/images/placeholders/moving-image/loading_accounts.png',
|
||||
};
|
||||
@ -0,0 +1,14 @@
|
||||
export const BACKGROUND: Record<string, string> = {
|
||||
noFile: '/images/placeholders/background/no_file_bg.png',
|
||||
noNote: '/images/placeholders/background/no_note_bg.png',
|
||||
noRecord: '/images/placeholders/background/no_record_bg.png',
|
||||
noMatchRecord: '/images/placeholders/background/no_match_record_bg.png',
|
||||
noTask: '/images/placeholders/background/no_task_bg.png',
|
||||
errorIndex: '/images/placeholders/background/error_index_bg.png',
|
||||
emptyTimeline: '/images/placeholders/background/empty_timeline_bg.png',
|
||||
loadingMessages: '/images/placeholders/background/loading_messages_bg.png',
|
||||
loadingAccounts: '/images/placeholders/background/loading_accounts_bg.png',
|
||||
emptyInbox: '/images/placeholders/background/empty_inbox_bg.png',
|
||||
error404: '/images/placeholders/background/404_bg.png',
|
||||
error500: '/images/placeholders/background/500_bg.png',
|
||||
};
|
||||
@ -0,0 +1,14 @@
|
||||
export const DARK_BACKGROUND: Record<string, string> = {
|
||||
noFile: '/images/placeholders/dark-background/no_file_bg.png',
|
||||
noNote: '/images/placeholders/dark-background/no_note_bg.png',
|
||||
noRecord: '/images/placeholders/dark-background/no_record_bg.png',
|
||||
noMatchRecord: '/images/placeholders/dark-background/no_match_record_bg.png',
|
||||
noTask: '/images/placeholders/dark-background/no_task_bg.png',
|
||||
errorIndex: '/images/placeholders/dark-background/error_index_bg.png',
|
||||
emptyTimeline: '/images/placeholders/dark-background/empty_timeline_bg.png',
|
||||
emptyInbox: '/images/placeholders/dark-background/empty_inbox_bg.png',
|
||||
error404: '/images/placeholders/dark-background/404_bg.png',
|
||||
error500: '/images/placeholders/dark-background/500_bg.png',
|
||||
loadingMessages: '/images/placeholders/background/loading_messages_bg.png',
|
||||
loadingAccounts: '/images/placeholders/background/loading_accounts_bg.png',
|
||||
};
|
||||
@ -0,0 +1,14 @@
|
||||
export const DARK_MOVING_IMAGE: Record<string, string> = {
|
||||
noFile: '/images/placeholders/dark-moving-image/no_file.png',
|
||||
noNote: '/images/placeholders/dark-moving-image/no_note.png',
|
||||
noRecord: '/images/placeholders/dark-moving-image/no_record.png',
|
||||
noMatchRecord: '/images/placeholders/dark-moving-image/no_match_record.png',
|
||||
noTask: '/images/placeholders/dark-moving-image/no_task.png',
|
||||
errorIndex: '/images/placeholders/dark-moving-image/error_index.png',
|
||||
emptyTimeline: '/images/placeholders/dark-moving-image/empty_timeline.png',
|
||||
emptyInbox: '/images/placeholders/dark-moving-image/empty_inbox.png',
|
||||
error404: '/images/placeholders/dark-moving-image/404.png',
|
||||
error500: '/images/placeholders/dark-moving-image/500.png',
|
||||
loadingMessages: '/images/placeholders/moving-image/loading_messages.png',
|
||||
loadingAccounts: '/images/placeholders/moving-image/loading_accounts.png',
|
||||
};
|
||||
@ -0,0 +1,14 @@
|
||||
export const MOVING_IMAGE: Record<string, string> = {
|
||||
noFile: '/images/placeholders/moving-image/no_file.png',
|
||||
noNote: '/images/placeholders/moving-image/no_note.png',
|
||||
noRecord: '/images/placeholders/moving-image/no_record.png',
|
||||
noMatchRecord: '/images/placeholders/moving-image/no_match_record.png',
|
||||
noTask: '/images/placeholders/moving-image/no_task.png',
|
||||
errorIndex: '/images/placeholders/moving-image/error_index.png',
|
||||
emptyTimeline: '/images/placeholders/moving-image/empty_timeline.png',
|
||||
loadingMessages: '/images/placeholders/moving-image/loading_messages.png',
|
||||
loadingAccounts: '/images/placeholders/moving-image/loading_accounts.png',
|
||||
emptyInbox: '/images/placeholders/moving-image/empty_inbox.png',
|
||||
error404: '/images/placeholders/moving-image/404.png',
|
||||
error500: '/images/placeholders/moving-image/500.png',
|
||||
};
|
||||
@ -1,11 +1,11 @@
|
||||
import { forwardRef, InputHTMLAttributes } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { rgba } from '@/ui/theme/constants/colors';
|
||||
import { textInputStyle } from '@/ui/theme/constants/effects';
|
||||
import { RGBA } from '@/ui/theme/constants/Rgba';
|
||||
import { TEXT_INPUT_STYLE } from '@/ui/theme/constants/TextInputStyle';
|
||||
|
||||
const StyledInput = styled.input`
|
||||
${textInputStyle}
|
||||
${TEXT_INPUT_STYLE}
|
||||
|
||||
border: 1px solid ${({ theme }) => theme.border.color.medium};
|
||||
border-radius: ${({ theme }) => theme.border.radius.sm};
|
||||
@ -17,7 +17,7 @@ const StyledInput = styled.input`
|
||||
|
||||
&:focus {
|
||||
border-color: ${({ theme }) => theme.color.blue};
|
||||
box-shadow: 0px 0px 0px 3px ${({ theme }) => rgba(theme.color.blue, 0.1)};
|
||||
box-shadow: 0px 0px 0px 3px ${({ theme }) => RGBA(theme.color.blue, 0.1)};
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { forwardRef, InputHTMLAttributes } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { textInputStyle } from '@/ui/theme/constants/effects';
|
||||
import { TEXT_INPUT_STYLE } from '@/ui/theme/constants/TextInputStyle';
|
||||
|
||||
const StyledDropdownMenuSearchInputContainer = styled.div`
|
||||
--vertical-padding: ${({ theme }) => theme.spacing(1)};
|
||||
@ -17,7 +17,7 @@ const StyledDropdownMenuSearchInputContainer = styled.div`
|
||||
`;
|
||||
|
||||
const StyledInput = styled.input`
|
||||
${textInputStyle}
|
||||
${TEXT_INPUT_STYLE}
|
||||
|
||||
font-size: ${({ theme }) => theme.font.size.sm};
|
||||
width: 100%;
|
||||
|
||||
@ -13,10 +13,10 @@ import { KeyboardShortcutMenu } from '@/keyboard-shortcut-menu/components/Keyboa
|
||||
import { AppNavigationDrawer } from '@/navigation/components/AppNavigationDrawer';
|
||||
import { MobileNavigationBar } from '@/navigation/components/MobileNavigationBar';
|
||||
import { useIsSettingsPage } from '@/navigation/hooks/useIsSettingsPage';
|
||||
import { objectSettingsWidth } from '@/settings/data-model/constants/objectSettings';
|
||||
import { OBJECT_SETTINGS_WIDTH } from '@/settings/data-model/constants/ObjectSettings';
|
||||
import { SignInBackgroundMockPage } from '@/sign-in-background-mock/components/SignInBackgroundMockPage';
|
||||
import { AppPath } from '@/types/AppPath';
|
||||
import { desktopNavDrawerWidths } from '@/ui/navigation/navigation-drawer/constants';
|
||||
import { DESKTOP_NAV_DRAWER_WIDTHS } from '@/ui/navigation/navigation-drawer/constants/DesktopNavDrawerWidths';
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
import { useScreenSize } from '@/ui/utilities/screen-size/hooks/useScreenSize';
|
||||
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
|
||||
@ -100,7 +100,9 @@ export const DefaultLayout = ({ children }: DefaultLayoutProps) => {
|
||||
marginLeft:
|
||||
isSettingsPage && !isMobile
|
||||
? (widowsWidth -
|
||||
(objectSettingsWidth + desktopNavDrawerWidths.menu + 64)) /
|
||||
(OBJECT_SETTINGS_WIDTH +
|
||||
DESKTOP_NAV_DRAWER_WIDTHS.menu +
|
||||
64)) /
|
||||
2
|
||||
: 0,
|
||||
}}
|
||||
|
||||
@ -11,7 +11,7 @@ import { OverflowingTextWithTooltip } from '@/ui/display/tooltip/OverflowingText
|
||||
import { IconButton } from '@/ui/input/button/components/IconButton';
|
||||
import { NavigationDrawerCollapseButton } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerCollapseButton';
|
||||
import { isNavigationDrawerOpenState } from '@/ui/navigation/states/isNavigationDrawerOpenState';
|
||||
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/theme';
|
||||
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/MobileViewport';
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
|
||||
export const PAGE_BAR_MIN_HEIGHT = 40;
|
||||
|
||||
@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { RightDrawer } from '@/ui/layout/right-drawer/components/RightDrawer';
|
||||
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/theme';
|
||||
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/MobileViewport';
|
||||
|
||||
import { PagePanel } from './PagePanel';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user