@@ -21,6 +21,7 @@ import { getHTMLFile } from '../reducers/files';
21
21
// Local Imports
22
22
import Editor from '../components/Editor' ;
23
23
import { PlayIcon , MoreIcon } from '../../../common/icons' ;
24
+ import UnsavedChangesDotIcon from '../../../images/unsaved-changes-dot.svg' ;
24
25
25
26
import IconButton from '../../../components/mobile/IconButton' ;
26
27
import Header from '../../../components/mobile/Header' ;
@@ -38,6 +39,16 @@ import Dropdown from '../../../components/Dropdown';
38
39
const isUserOwner = ( { project, user } ) =>
39
40
project . owner && project . owner . id === user . id ;
40
41
42
+ const getTitle = ( title , unsavedChanges = false ) => (
43
+ < span >
44
+ { title }
45
+ < span className = "editor__unsaved-changes" >
46
+ { unsavedChanges &&
47
+ < UnsavedChangesDotIcon role = "img" aria-label = "Sketch has unsaved changes" focusable = "false" /> }
48
+ </ span >
49
+ </ span >
50
+ ) ;
51
+
41
52
const Expander = styled . div `
42
53
height: ${ props => ( props . expanded ? remSize ( 160 ) : remSize ( 27 ) ) } ;
43
54
` ;
@@ -65,7 +76,7 @@ const MobileIDEView = (props) => {
65
76
const {
66
77
preferences, ide, editorAccessibility, project, updateLintMessage, clearLintMessage,
67
78
selectedFile, updateFileContent, files, user, params,
68
- closeEditorOptions, showEditorOptions,
79
+ closeEditorOptions, showEditorOptions, unsavedChanges ,
69
80
startRefreshSketch, stopSketch, expandSidebar, collapseSidebar, clearConsole, console,
70
81
showRuntimeErrorWarning, hideRuntimeErrorWarning, startSketch, getProject, clearPersistedState
71
82
} = props ;
@@ -99,7 +110,7 @@ const MobileIDEView = (props) => {
99
110
return (
100
111
< Screen fullscreen >
101
112
< Header
102
- title = { project . name }
113
+ title = { getTitle ( project . name , unsavedChanges ) }
103
114
subtitle = { selectedFile . name }
104
115
>
105
116
< NavItem >
@@ -273,6 +284,8 @@ MobileIDEView.propTypes = {
273
284
project_id : PropTypes . string ,
274
285
username : PropTypes . string
275
286
} ) . isRequired ,
287
+
288
+ unsavedChanges : PropTypes . bool . isRequired
276
289
} ;
277
290
278
291
function mapStateToProps ( state ) {
0 commit comments