Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runfix: device modal update #16409

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export const PrimaryModalComponent: FC = () => {
<FadingScrollbar className="modal__body">
{message && (
<div className="modal__text" data-uie-name="status-modal-text">
{message && <p id="modal-description-html">{message}</p>}
<div id="modal-description-html">{message}</div>
</div>
)}

Expand Down
28 changes: 13 additions & 15 deletions src/script/components/Modals/PrimaryModal/PrimaryModalState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,22 @@ const updateCurrentModalContent = (type: PrimaryModalType, options: ModalOptions
content.titleText = t('modalAccountNewDevicesHeadline');
content.primaryAction = {...primaryAction, text: t('modalAcknowledgeAction')};
content.secondaryAction = {...secondaryAction, text: t('modalAccountNewDevicesSecondary')};
const deviceList = (data as ClientNotificationData[])
.map(device => {
const deviceDate = new Date(device.time);
const deviceTime = isValid(deviceDate) ? new Date(deviceDate) : new Date();
const formattedDate = formatLocale(deviceTime, 'PP, p');
const deviceModel = `${t('modalAccountNewDevicesFrom')} ${escape(device.model)}`;
return (
<>
<div>${formattedDate} - UTC</div>
<div>${deviceModel}</div>
Comment on lines -169 to -170
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh this was a string before, right? Nice

</>
);
})
.join('');
const deviceList = (data as ClientNotificationData[]).map(device => {
const deviceDate = new Date(device.time);
const deviceTime = isValid(deviceDate) ? new Date(deviceDate) : new Date();
const formattedDate = formatLocale(deviceTime, 'PP, p');
const deviceModel = `${t('modalAccountNewDevicesFrom')} ${escape(device.model)}`;
return (
<>
<div>{formattedDate} - UTC</div>
<div>{deviceModel}</div>
</>
);
});
content.message = (
<>
<div className="modal__content__device-list">{deviceList}</div>
{t('modalAccountNewDevicesMessage')}
<div className="modal__content__device-list">${deviceList}</div>
Comment on lines 176 to -178
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it normal that the order of those 2 elements changed? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its intentional. you can see the previous order of the elements in the screenshot

</>
);
break;
Expand Down