chore(twenty-front): migrate auth, activities, AI, pages and small modules from Emotion to Linaria (PR 2-3/10) (#18328)
## Summary - Migrate ~200 files from `@emotion/styled` / `@emotion/react` to `@linaria/react` + `themeCssVariables`, continuing the zero-runtime CSS-in-JS migration (PR 2-3 of the [migration plan](docs/emotion-to-linaria-migration-plan.md)) - Modules covered: **auth** (19), **activities** (53), **ai** (30), **pages** (70), **action-menu** (3), **object-metadata** (4), **onboarding** (2), **workspace** (2), **file** (3), **error-handler** (2), **front-components** (1), **geo-map** (1), **loading** (5), **testing** (5), plus a `style` prop addition to `TableRow` - Handles `styled(FunctionComponent)<Props>` incompatibility with Linaria by using CSS custom properties via `style` + `var()` references ## Test plan - [x] `npx nx lint:diff-with-main twenty-front` passes - [x] `npx nx typecheck twenty-front` passes - [ ] Visual spot-check of auth, onboarding, settings, activities, and AI chat screens - [ ] No remaining `@emotion/styled` or `@emotion/react` imports in migrated files Made with [Cursor](https://cursor.com)
This commit is contained in:
+5
-4
@@ -1,19 +1,20 @@
|
||||
import { AppErrorDisplay } from '@/error-handler/components/internal/AppErrorDisplay';
|
||||
import { type AppErrorDisplayProps } from '@/error-handler/types/AppErrorDisplayProps';
|
||||
import { PageBody } from '@/ui/layout/page/components/PageBody';
|
||||
import styled from '@emotion/styled';
|
||||
import { styled } from '@linaria/react';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { themeCssVariables } from 'twenty-ui/theme-constants';
|
||||
|
||||
type AppFullScreenErrorFallbackProps = AppErrorDisplayProps;
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
background: ${({ theme }) => theme.background.noisy};
|
||||
background: ${themeCssVariables.background.noisy};
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
padding-top: ${({ theme }) => theme.spacing(3)};
|
||||
padding-left: ${({ theme }) => theme.spacing(3)};
|
||||
padding-top: ${themeCssVariables.spacing[3]};
|
||||
padding-left: ${themeCssVariables.spacing[3]};
|
||||
`;
|
||||
|
||||
export const AppFullScreenErrorFallback = ({
|
||||
|
||||
+10
-9
@@ -1,9 +1,10 @@
|
||||
import { type AppErrorDisplayProps } from '@/error-handler/types/AppErrorDisplayProps';
|
||||
import styled from '@emotion/styled';
|
||||
import { styled } from '@linaria/react';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { motion } from 'framer-motion';
|
||||
import { IconReload } from 'twenty-ui/display';
|
||||
import { THEME_DARK } from 'twenty-ui/theme';
|
||||
import { themeCssVariables } from 'twenty-ui/theme-constants';
|
||||
|
||||
type AppRootErrorFallbackProps = AppErrorDisplayProps;
|
||||
|
||||
@@ -17,8 +18,8 @@ const StyledContainer = styled.div`
|
||||
`;
|
||||
|
||||
const StyledPanel = styled.div`
|
||||
background: ${({ theme }) => theme.grayScale.gray1};
|
||||
border: 1px solid ${({ theme }) => theme.grayScale.gray5};
|
||||
background: ${themeCssVariables.grayScale.gray1};
|
||||
border: 1px solid ${themeCssVariables.grayScale.gray5};
|
||||
border-radius: 8px;
|
||||
height: 100%;
|
||||
overflow-x: auto;
|
||||
@@ -66,13 +67,13 @@ const StyledEmptyTextContainer = styled.div`
|
||||
`;
|
||||
|
||||
const StyledEmptyTitle = styled.div`
|
||||
color: ${({ theme }) => theme.grayScale.gray12};
|
||||
color: ${themeCssVariables.grayScale.gray12};
|
||||
font-size: 1.23rem;
|
||||
font-weight: 600;
|
||||
`;
|
||||
|
||||
const StyledEmptySubTitle = styled.div`
|
||||
color: ${({ theme }) => theme.grayScale.gray11};
|
||||
color: ${themeCssVariables.grayScale.gray11};
|
||||
font-size: 0.92rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
@@ -83,9 +84,9 @@ const StyledEmptySubTitle = styled.div`
|
||||
|
||||
const StyledButton = styled.button`
|
||||
align-items: center;
|
||||
background: ${({ theme }) => theme.grayScale.gray1};
|
||||
border: 1px solid ${({ theme }) => theme.grayScale.gray5};
|
||||
color: ${({ theme }) => theme.grayScale.gray12};
|
||||
background: ${themeCssVariables.grayScale.gray1};
|
||||
border: 1px solid ${themeCssVariables.grayScale.gray5};
|
||||
color: ${themeCssVariables.grayScale.gray12};
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
@@ -94,7 +95,7 @@ const StyledButton = styled.button`
|
||||
`;
|
||||
|
||||
const StyledIcon = styled(IconReload)`
|
||||
color: ${({ theme }) => theme.grayScale.gray12};
|
||||
color: ${themeCssVariables.grayScale.gray12};
|
||||
margin-right: 8px;
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user