Skip to content

Commit

Permalink
replace deprecated color tokens (#28164)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti authored Feb 27, 2023
1 parent 1ecde12 commit 7b76376
Show file tree
Hide file tree
Showing 29 changed files with 43 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { AsyncStatePhase } from '../../../lib/asyncState/AsyncStatePhase';
import { useOmnichannelRoomIcon } from './context/OmnichannelRoomIconContext';

export const colors = {
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
busy: 'status-font-on-danger',
away: 'status-font-on-warning',
online: 'status-font-on-success',
offline: 'annotation',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import type { ComponentProps, ReactElement } from 'react';
import React from 'react';

const colors = {
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
busy: 'status-font-on-danger',
away: 'status-font-on-warning',
online: 'status-font-on-success',
offline: 'annotation',
};

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/dataView/Growth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Growth = ({ children, ...props }: GrowthProps): ReactElement | null => {
}

return (
<Box is='span' color={children < 0 ? 'on-danger' : 'on-success'} {...props}>
<Box is='span' color={children < 0 ? 'status-font-on-danger' : 'status-font-on-success'} {...props}>
{children < 0 ? <NegativeGrowthSymbol /> : <PositiveGrowthSymbol />}
{String(Math.abs(children))}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const MessageContentBody = ({ mentions, channels, md, searchText }: MessageConte
padding-inline-start: 0;
}
a {
color: ${Palette.statusColor['status-font-on-info']};
color: ${Palette.text['font-info']};
&:hover {
text-decoration: underline;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type ReadReceiptIndicatorProps = {

const ReadReceiptIndicator = ({ unread }: ReadReceiptIndicatorProps): ReactElement | null => (
<Box position='absolute' insetBlockStart={2} insetInlineEnd={8}>
<Icon name='check' size='x16' color={unread ? 'annotation' : 'on-info'} />
<Icon name='check' size='x16' color={unread ? 'annotation' : 'info'} />
</Box>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const ThreadMessagePreview = ({ message, sequential, ...props }: ThreadMessagePr
{translated && (
<>
{' '}
<MessageStatusIndicatorItem name='language' color='font-on-info' title={t('Translated')} />
<MessageStatusIndicatorItem name='language' color='info' title={t('Translated')} />
</>
)}
</>
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/client/hooks/useRoomIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import React from 'react';
import { ReactiveUserStatus } from '../components/UserStatus';

export const colors = {
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
busy: 'status-font-on-danger',
away: 'status-font-on-warning',
online: 'status-font-on-success',
offline: 'annotation',
};

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/sidebar/header/UserDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const UserDropdown = ({ user, onClose }: UserDropdownProps): ReactElement => {
{presenceDisabled && (
<Box fontScale='p2' mi='x12' mb='x4'>
<Box mbe='x4'>{t('User_status_disabled')}</Box>
<Box is='a' color='status-font-on-info' onClick={handleStatusDisabledModal}>
<Box is='a' color='info' onClick={handleStatusDisabledModal}>
{t('Learn_more')}
</Box>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MyDataModal: FC<MyDataModalProps> = ({ onCancel, title, text, ...props })
return (
<Modal {...props}>
<Modal.Header>
<Modal.Icon color='on-success' name='circle-check' />
<Modal.Icon color='status-font-on-success' name='circle-check' />
<Modal.Title>{title}</Modal.Title>
<Modal.Close onClick={onCancel} />
</Modal.Header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const useOverviewData = (): [eventCount: ReactNode, userCount: ReactNode, server
}

if (result.isError) {
return [<Box color='on-danger'>Error</Box>, <Box color='on-danger'>Error</Box>, <Box color='on-danger'>Error</Box>];
return [
<Box color='status-font-on-danger'>Error</Box>,
<Box color='status-font-on-danger'>Error</Box>,
<Box color='status-font-on-danger'>Error</Box>,
];
}

const { data } = result.data;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/admin/viewLogs/ServerLogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const ServerLogs = (): ReactElement => {
paddingBlock='x8'
fontScale='c1'
borderRadius='full'
color='on-info'
color='info'
backgroundColor='surface'
onClick={handleClick}
textAlign='center'
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/marketplace/AppMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function AppMenu({ app, isAppDetailsPage, ...props }) {
isAppEnabled && {
disable: {
label: (
<Box color='on-warning'>
<Box color='status-font-on-warning'>
<Icon name='ban' size='x16' marginInlineEnd='x4' />
{t('Disable')}
</Box>
Expand Down Expand Up @@ -425,7 +425,7 @@ function AppMenu({ app, isAppDetailsPage, ...props }) {
isAdminUser && {
uninstall: {
label: (
<Box color='on-danger'>
<Box color='status-font-on-danger'>
<Icon name='trash' size='x16' marginInlineEnd='x4' />
{t('Uninstall')}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/marketplace/AppUpdateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const AppUpdateModal: FC<AppUpdateModalProps> = ({ confirm, cancel, ...props })
return (
<Modal {...props}>
<Modal.Header>
<Modal.Icon color='on-danger' name='info-circled' />
<Modal.Icon color='status-font-on-danger' name='info-circled' />
<Modal.Title>{t('Apps_Manual_Update_Modal_Title')}</Modal.Title>
<Modal.Close onClick={handleCloseButtonClick} />
</Modal.Header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const AppPermissionsList = ({ appPermissions }: { appPermissions: AppPermission[
<Fragment key={permission.name}>
<li>{handleAppPermissions(permission.name)}</li>
{permission.required && (
<Box is='span' color='on-danger'>
<Box is='span' color='status-font-on-danger'>
({t('required')})
</Box>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CategoryDropDownAnchor = forwardRef<HTMLInputElement, { selectedCategories
bg='light'
fontWeight={700}
fontSize='micro'
color='on-info'
color='info'
pi='x6'
display='flex'
alignItems='center'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const RemoveAllClosed: FC<{
...(canRemove && {
removeClosed: {
label: (
<Box color='on-danger' data-qa='current-chats-options-removeAllClosed'>
<Box color='status-font-on-danger' data-qa='current-chats-options-removeAllClosed'>
<Icon name='trash' size='x16' marginInlineEnd='x4' />
{t('Delete_all_closed_chats')}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/Header/icons/Translate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Translate: FC<TranslateProps> = ({ room: { autoTranslateLanguage, autoTran
const autoTranslateEnabled = useSetting('AutoTranslate_Enabled');
const encryptedLabel = t('Translated');
return autoTranslateEnabled && autoTranslate && autoTranslateLanguage ? (
<Header.State title={encryptedLabel} icon='language' color='on-info' />
<Header.State title={encryptedLabel} icon='language' color='info' />
) : null;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const MenuItem = ({ _id, name, url, onClickDelete }) => {
...(onClickDelete && {
delete: {
label: (
<Box display='flex' alignItems='center' color='on-danger'>
<Box display='flex' alignItems='center' color='status-font-on-danger'>
<Icon mie='x4' name='trash' size='x16' />
{t('Delete')}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const useRemoveUserAction = (user: Pick<IUser, '_id' | 'username'>, rid:
roomCanRemove && userCanRemove
? {
label: (
<Box color='on-danger'>
<Box color='status-font-on-danger'>
<Icon mie='x4' name='cross' size='x20' />
{room?.teamMain ? t('Remove_from_team') : t('Remove_from_room')}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ChannelDesertionTableRow = ({ room, onChange, selected, lastOwnerWarning }
<Margins inline='x8'>
<Icon name={room.t === 'p' ? 'hashtag-lock' : 'hashtag'} />
{fname ?? name}
{isLastOwner && <Icon size='x16' name='info-circled' color='on-danger' title={lastOwnerWarning} />}
{isLastOwner && <Icon size='x16' name='info-circled' color='status-font-on-danger' title={lastOwnerWarning} />}
</Margins>
</TableCell>
<TableCell align='end' withTruncatedText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const SecondStep: FC<SecondStepsProps> = ({ onClose, onCancel, onConfirm, delete
<GenericModal
{...props}
variant='warning'
icon={<Icon name='modal-warning' size={24} color='on-warning' />}
icon={<Icon name='modal-warning' size={24} color='status-font-on-warning' />}
cancelText={rooms?.length > 0 ? t('Back') : t('Cancel')}
confirmText={t('Convert')}
title={t('Confirmation')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ConfirmationModal: FC<ConfirmationModalProps> = ({ onClose, onConfirmActio
return (
<Modal>
<Modal.Header>
<Modal.Icon name='modal-warning' color='on-warning'></Modal.Icon>
<Modal.Icon name='modal-warning' color='status-font-on-warning'></Modal.Icon>
<Modal.Title>{t('Confirmation')}</Modal.Title>
<Modal.Close onClick={onClose} />
</Modal.Header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const RoomActions = ({ room, reload }) => {
labelButton: t('Delete'),
content: (
<>
<Box is='span' size='14px' color='on-danger' fontWeight='600'>
<Box is='span' size='14px' color='status-font-on-danger' fontWeight='600'>
{t('Team_Delete_Channel_modal_content_danger')}
</Box>
<Box is='span' size='14px'>
Expand Down Expand Up @@ -141,7 +141,7 @@ const RoomActions = ({ room, reload }) => {
<CheckBox checked={room.teamDefault} />
</Option>
) : (
<Box color='on-danger'>
<Box color='status-font-on-danger'>
<Option {...props} label={label} icon={icon} />
</Box>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const StepTwo = ({
confirmText={t('Continue')}
>
<Box withRichContent mbe='x16'>
<Box is='span' color='on-danger' fontWeight='bold'>
<Box is='span' color='status-font-on-danger' fontWeight='bold'>
{t('Team_Delete_Channel_modal_content_danger')}
</Box>{' '}
{t('Teams_delete_team_Warning')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const RemoveUsersSecondStep = ({ onClose, onCancel, onConfirm, deletedRooms = {}
return (
<GenericModal
variant='danger'
icon={<Icon name='modal-warning' size={24} color='on-warning' />}
icon={<Icon name='modal-warning' size={24} color='status-font-on-warning' />}
cancelText={rooms?.length > 0 ? t('Back') : t('Cancel')}
confirmText={t('Remove')}
title={t('Confirmation')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const CannedResponseForm: FC<{
<Field.Label w='full'>
<Box w='full' display='flex' flexDirection='row' justifyContent='space-between'>
{t('Message')}
<Box className={clickable} color='on-info' onClick={onPreview}>
<Box className={clickable} color='info' onClick={onPreview}>
{previewState ? t('Editor') : t('Preview')}
</Box>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ const SeatsCapUsage = ({ limit, members }: SeatsCapUsageProps): ReactElement =>
return (
<Box display='flex' flexDirection='column' minWidth='x180'>
<Box
color={reachedLimit ? 'on-danger' : 'default'}
color={reachedLimit ? 'status-font-on-danger' : 'default'}
display='flex'
flexDirection='row'
justifyContent='space-between'
fontScale='c1'
mb='x8'
>
<div role='status'>{t('Seats_Available', { seatsLeft })}</div>
<Box color={reachedLimit ? 'on-danger' : 'hint'}>{`${members}/${limit}`}</Box>
<Box color={reachedLimit ? 'status-font-on-danger' : 'hint'}>{`${members}/${limit}`}</Box>
</Box>
<ProgressBar percentage={percentage} variant={closeToLimit ? 'danger' : 'success'} />
</Box>
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/ee/client/voip/modals/DeviceSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ const DeviceSettingsModal = (): ReactElement => {
</Modal.Header>
<Modal.Content fontScale='p2'>
{!setSinkIdAvailable && (
<Box color='on-danger' display='flex' flexDirection='column'>
<Box color='status-font-on-danger' display='flex' flexDirection='column'>
{t('Device_Changes_Not_Available')}
<Box is='a' href='https://rocket.chat/download' target='_blank' rel='noopener noreferrer'>
{t('Download_Destkop_App')}
</Box>
</Box>
)}
{!isDeviceManagementEnabled && (
<Box color='on-danger' display='flex' flexDirection='column'>
<Box color='status-font-on-danger' display='flex' flexDirection='column'>
{t('Device_Changes_Not_Available_Insecure_Context')}
</Box>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/livechat/src/components/Composer/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ storiesOf('Components/Composer', module)
<SmileIcon width='20' />
</ComposerAction>
<ComposerAction text='Send' onClick={action('click send')}>
<SendIcon color='on-info' width='20' />
<SendIcon color='info' width='20' />
</ComposerAction>
</ComposerActions>
}
Expand Down

0 comments on commit 7b76376

Please sign in to comment.