We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 953b772 commit be50580Copy full SHA for be50580
client/modules/IDE/components/UnsavedChangesIndicator.jsx
@@ -0,0 +1,23 @@
1
+import React from 'react';
2
+import { useTranslation } from 'react-i18next';
3
+import { useSelector } from 'react-redux';
4
+import UnsavedChangesDotIcon from '../../../images/unsaved-changes-dot.svg';
5
+
6
+export default function UnsavedChangesIndicator() {
7
+ const { t } = useTranslation();
8
+ const hasUnsavedChanges = useSelector((state) => state.ide.unsavedChanges);
9
10
+ if (!hasUnsavedChanges) {
11
+ return null;
12
+ }
13
14
+ return (
15
+ <span className="editor__unsaved-changes">
16
+ <UnsavedChangesDotIcon
17
+ role="img"
18
+ aria-label={t('Editor.UnsavedChangesARIA')}
19
+ focusable="false"
20
+ />
21
+ </span>
22
+ );
23
+}
0 commit comments