Skip to content

Commit

Permalink
chore: rename StyledI18nSubText to I18nSubText
Browse files Browse the repository at this point in the history
because it is not directly a styled.<something> element
  • Loading branch information
Bilb committed Jan 6, 2025
1 parent 3764233 commit 94e0928
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tools/localization/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_localization_regex_list(string):
fr"i18n\('{key}'(, {{[\S\s.]*}})?\)",
fr"i18n\.(stripped|inEnglish|getRawMessage)\('{key}'(, {{[\S\s.]*}})?\)",
fr"window\?\.i18n\?\.\('{key}'(, {{[\S\s.]*}})?\)",
fr"<StyledI18nSubText[\S\s.]*token=[\S\s.]*{key}[\S\s.]*"
fr"<I18nSubText[\S\s.]*token=[\S\s.]*{key}[\S\s.]*"
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const StyledI18nSubTextContainer = styled('div')`
padding-inline: var(--margins-lg);
`;

export const StyledI18nSubText = ({
export const I18nSubText = ({
className,
dataTestId,
localizerProps,
Expand Down
4 changes: 2 additions & 2 deletions ts/components/dialog/OpenUrlModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { OpenUrlModalState, updateOpenUrlModal } from '../../state/ducks/modalDi
import { SessionWrapperModal } from '../SessionWrapperModal';
import { SessionButton, SessionButtonColor, SessionButtonType } from '../basic/SessionButton';
import { SpacerMD } from '../basic/Text';
import { StyledI18nSubText } from '../basic/StyledI18nSubText';
import { I18nSubText } from '../basic/I18nSubText';
import { StyledModalDescriptionContainer } from './shared/ModalDescriptionContainer';

const StyledScrollDescriptionContainer = styled(StyledModalDescriptionContainer)`
Expand Down Expand Up @@ -47,7 +47,7 @@ export function OpenUrlModal(props: OpenUrlModalState) {
>
<div className="session-modal__centered">
<StyledScrollDescriptionContainer>
<StyledI18nSubText
<I18nSubText
localizerProps={{ token: 'urlOpenDescription', asTag: 'span', args: { url } }}
dataTestId="modal-description"
/>
Expand Down
7 changes: 2 additions & 5 deletions ts/components/dialog/QuitModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Flex } from '../basic/Flex';
import { SessionButton, SessionButtonColor, SessionButtonType } from '../basic/SessionButton';
import { SpacerLG, SpacerSM } from '../basic/Text';
import { SessionConfirmDialogProps } from './SessionConfirm';
import { StyledI18nSubText } from '../basic/StyledI18nSubText';
import { I18nSubText } from '../basic/I18nSubText';

const modalStyle: CSSProperties = {
maxWidth: '300px',
Expand Down Expand Up @@ -85,10 +85,7 @@ export const QuitModal = (props: SessionConfirmDialogProps) => {
style={modalStyle}
>
<SpacerLG />
<StyledI18nSubText
localizerProps={i18nMessage}
dataTestId="modal-description"
></StyledI18nSubText>
<I18nSubText localizerProps={i18nMessage} dataTestId="modal-description"></I18nSubText>
<SpacerLG />
</Flex>
) : null}
Expand Down
4 changes: 2 additions & 2 deletions ts/components/dialog/SessionConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SpacerLG } from '../basic/Text';
import { SessionSpinner } from '../loading';
import type { LocalizerComponentPropsObject } from '../../types/localizer';

import { StyledI18nSubText } from '../basic/StyledI18nSubText';
import { I18nSubText } from '../basic/I18nSubText';

export interface SessionConfirmDialogProps {
i18nMessage?: LocalizerComponentPropsObject;
Expand Down Expand Up @@ -132,7 +132,7 @@ export const SessionConfirm = (props: SessionConfirmDialogProps) => {

<div className="session-modal__centered">
{i18nMessage ? (
<StyledI18nSubText localizerProps={i18nMessage} dataTestId="modal-description" />
<I18nSubText localizerProps={i18nMessage} dataTestId="modal-description" />
) : null}
{radioOptions && chosenOption !== '' ? (
<SessionRadioGroup
Expand Down

0 comments on commit 94e0928

Please sign in to comment.