diff --git a/webapp/src/component/activity/references/AnyReference.tsx b/webapp/src/component/activity/references/AnyReference.tsx index 295d71f664..7e12bd220c 100644 --- a/webapp/src/component/activity/references/AnyReference.tsx +++ b/webapp/src/component/activity/references/AnyReference.tsx @@ -9,7 +9,7 @@ import { ContentStorageReference } from './ContentStorageReference'; import { WebhookConfigReference } from './WebhookConfigReference'; import { TaskReference } from './TaskReference'; -const StyledReferences = styled(Box)` +export const StyledReferences = styled(Box)` display: flex; gap: 3px; white-space: nowrap; diff --git a/webapp/src/component/activity/types/getBatchLanguageIdChange.tsx b/webapp/src/component/activity/types/getBatchLanguageIdChange.tsx index 60e72358cb..c004f33f9b 100644 --- a/webapp/src/component/activity/types/getBatchLanguageIdChange.tsx +++ b/webapp/src/component/activity/types/getBatchLanguageIdChange.tsx @@ -1,27 +1,7 @@ -import { DiffValue } from '../types'; -import { styled } from '@mui/material'; import { useProjectLanguages } from 'tg.hooks/useProjectLanguages'; import { CircledLanguageIcon } from 'tg.component/languages/CircledLanguageIcon'; - -const StyledContainer = styled('span')` - display: div; -`; - -const StyledLanguage = styled('span')` - gap: 4px; - background: ${({ theme }) => theme.palette.emphasis[100]}; - border-radius: 4px; - border: 1px solid ${({ theme }) => theme.palette.emphasis[200]}; - padding: 0px 4px; - & + & { - margin-left: 4px; - } -`; - -const StyledName = styled('span')` - overflow: hidden; - text-overflow: ellipsis; -`; +import { DiffValue } from '../types'; +import { StyledReferences } from '../references/AnyReference'; type Props = { input: DiffValue; @@ -31,21 +11,14 @@ const LanguageIdsComponent: React.FC = ({ input }) => { const allLangs = useProjectLanguages(); const langId = input.new; const language = allLangs.find((lang) => lang.id === langId); - if (langId) { + if (language) { return ( - - - {language?.name && {language.name}} - - - + + + {language.name} + + + ); } else { return null; diff --git a/webapp/src/component/activity/types/getBatchLanguageIdsChange.tsx b/webapp/src/component/activity/types/getBatchLanguageIdsChange.tsx index 63e87e4395..8c90b5f26c 100644 --- a/webapp/src/component/activity/types/getBatchLanguageIdsChange.tsx +++ b/webapp/src/component/activity/types/getBatchLanguageIdsChange.tsx @@ -1,27 +1,7 @@ -import { DiffValue } from '../types'; -import { styled } from '@mui/material'; import { useProjectLanguages } from 'tg.hooks/useProjectLanguages'; import { CircledLanguageIcon } from 'tg.component/languages/CircledLanguageIcon'; - -const StyledContainer = styled('span')` - display: div; -`; - -const StyledLanguage = styled('span')` - gap: 4px; - background: ${({ theme }) => theme.palette.emphasis[100]}; - border-radius: 4px; - border: 1px solid ${({ theme }) => theme.palette.emphasis[200]}; - padding: 0px 4px; - & + & { - margin-left: 4px; - } -`; - -const StyledName = styled('span')` - overflow: hidden; - text-overflow: ellipsis; -`; +import { DiffValue } from '../types'; +import { StyledReferences } from '../references/AnyReference'; type Props = { input: DiffValue; @@ -32,24 +12,19 @@ const LanguageIdsComponent: React.FC = ({ input }) => { const newInput = input.new; if (newInput) { return ( - + {input.new?.map((langId) => { const language = allLangs.find((lang) => lang.id === langId); return ( - - {language?.name && {language.name}} - - + + {language && ( + {language.name} + )} + + ); })} - + ); } else { return null; diff --git a/webapp/src/component/activity/types/getBatchNamespaceChange.tsx b/webapp/src/component/activity/types/getBatchNamespaceChange.tsx index 0d0a534b9e..1c3f018bfa 100644 --- a/webapp/src/component/activity/types/getBatchNamespaceChange.tsx +++ b/webapp/src/component/activity/types/getBatchNamespaceChange.tsx @@ -1,17 +1,5 @@ +import { StyledReferences } from '../references/AnyReference'; import { DiffValue } from '../types'; -import { styled } from '@mui/material'; - -const StyledContainer = styled('span')` - word-break: break-word; -`; - -const StyledNamespace = styled('span')` - background: ${({ theme }) => theme.palette.emphasis[100]}; - max-height: 1.5em; - padding: 0px 4px; - border-radius: 4px; - border: 1px solid ${({ theme }) => theme.palette.emphasis[200]}; -`; type Props = { input: DiffValue; @@ -21,9 +9,9 @@ const NamespaceComponent: React.FC = ({ input }) => { const newInput = input.new?.data?.name || input.new; if (newInput) { return ( - - {newInput} - + + {newInput} + ); } else { return null;