@@ -21,6 +21,7 @@ import { getHTMLFile } from '../reducers/files';
2121// Local Imports
2222import Editor from '../components/Editor' ;
2323import { PlayIcon , MoreIcon } from '../../../common/icons' ;
24+ import UnsavedChangesDotIcon from '../../../images/unsaved-changes-dot.svg' ;
2425
2526import IconButton from '../../../components/mobile/IconButton' ;
2627import Header from '../../../components/mobile/Header' ;
@@ -38,6 +39,16 @@ import Dropdown from '../../../components/Dropdown';
3839const isUserOwner = ( { project, user } ) =>
3940 project . owner && project . owner . id === user . id ;
4041
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+
4152const Expander = styled . div `
4253 height: ${ props => ( props . expanded ? remSize ( 160 ) : remSize ( 27 ) ) } ;
4354` ;
@@ -65,7 +76,7 @@ const MobileIDEView = (props) => {
6576 const {
6677 preferences, ide, editorAccessibility, project, updateLintMessage, clearLintMessage,
6778 selectedFile, updateFileContent, files, user, params,
68- closeEditorOptions, showEditorOptions,
79+ closeEditorOptions, showEditorOptions, unsavedChanges ,
6980 startRefreshSketch, stopSketch, expandSidebar, collapseSidebar, clearConsole, console,
7081 showRuntimeErrorWarning, hideRuntimeErrorWarning, startSketch, getProject, clearPersistedState
7182 } = props ;
@@ -99,7 +110,7 @@ const MobileIDEView = (props) => {
99110 return (
100111 < Screen fullscreen >
101112 < Header
102- title = { project . name }
113+ title = { getTitle ( project . name , unsavedChanges ) }
103114 subtitle = { selectedFile . name }
104115 >
105116 < NavItem >
@@ -273,6 +284,8 @@ MobileIDEView.propTypes = {
273284 project_id : PropTypes . string ,
274285 username : PropTypes . string
275286 } ) . isRequired ,
287+
288+ unsavedChanges : PropTypes . bool . isRequired
276289} ;
277290
278291function mapStateToProps ( state ) {
0 commit comments