diff --git a/build/icon/Icon-128.png b/build/icon/Icon-128.png index b90da61..bd15fc8 100644 Binary files a/build/icon/Icon-128.png and b/build/icon/Icon-128.png differ diff --git a/build/icon/Icon-16.png b/build/icon/Icon-16.png index 8bf30bb..28b2fa0 100644 Binary files a/build/icon/Icon-16.png and b/build/icon/Icon-16.png differ diff --git a/build/icon/Icon-340.png b/build/icon/Icon-340.png new file mode 100644 index 0000000..dc93c35 Binary files /dev/null and b/build/icon/Icon-340.png differ diff --git a/build/icon/Icon-48.png b/build/icon/Icon-48.png index 1b83591..443e368 100644 Binary files a/build/icon/Icon-48.png and b/build/icon/Icon-48.png differ diff --git a/build/icon/Icon-60.png b/build/icon/Icon-60.png index aef57b6..e0a49c1 100644 Binary files a/build/icon/Icon-60.png and b/build/icon/Icon-60.png differ diff --git a/build/icon/Icon.png b/build/icon/Icon.png index c13776e..7809d1b 100644 Binary files a/build/icon/Icon.png and b/build/icon/Icon.png differ diff --git a/build/img/Back.svg b/build/img/Back.svg new file mode 100644 index 0000000..8374b8f --- /dev/null +++ b/build/img/Back.svg @@ -0,0 +1,16 @@ + + + + Back + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/build/main.js b/build/main.js index 7d189f0..5f14a0b 100644 --- a/build/main.js +++ b/build/main.js @@ -30215,8 +30215,6 @@ var _actionsChangedir2 = _interopRequireDefault(_actionsChangedir); var _store = require('store'); -// TODO: Fix history not working when clicking on sdcard - var Breadcrumb = (function (_Component) { _inherits(Breadcrumb, _Component); @@ -30229,71 +30227,80 @@ var Breadcrumb = (function (_Component) { _createClass(Breadcrumb, [{ key: 'render', value: function render() { - var directories = this.props.cwd.split('/').filter(function (a) { - return a; - }); - directories.unshift('sdcard'); + var _this = this; - var els = directories.map(function (dir, index, arr) { - var path = arr.slice(1, index + 1).join('/'); + var els = []; - return _react2['default'].createElement( + if (this.props.search) { + console.log('search'); + els = [_react2['default'].createElement( 'span', - { key: index, onClick: (0, _store.bind)((0, _actionsChangedir2['default'])(path)) }, - _react2['default'].createElement( - 'i', - null, - '/' - ), - dir - ); - }); + { key: '000' }, + 'Search: ', + this.props.search + )]; + } else { + (function () { + var directories = _this.props.cwd.split('/').filter(function (a) { + return a; + }); + var lastDirectories = _this.props.lwd.split('/').filter(function (a) { + return a; + }); + directories.unshift('sdcard'); - var lastDirectories = this.props.lwd.split('/').filter(function (a) { - return a; - }); - if (lastDirectories.length > directories.length - 1) { - lastDirectories.splice(0, directories.length - 1); + var sumLength = directories.length + lastDirectories.length; - var _history = lastDirectories.map(function (dir, index, arr) { - var current = directories.slice(1).concat(arr.slice(0, index + 1)); - var path = current.join('/').replace(/^\//, ''); // remove starting slash + els = els.concat(directories.map(function (dir, index, arr) { + var path = arr.slice(1, index + 1).join('/'); + var style = { zIndex: sumLength - index }; - return _react2['default'].createElement( - 'span', - { key: directories.length + index, className: 'history', onClick: (0, _store.bind)((0, _actionsChangedir2['default'])(path)) }, - _react2['default'].createElement( - 'i', - null, - '/' - ), - dir - ); - }); + return _react2['default'].createElement( + 'span', + { key: index, onClick: (0, _store.bind)((0, _actionsChangedir2['default'])(path)), style: style }, + dir + ); + })); - els = els.concat(_history); + if (lastDirectories.length > directories.length - 1) { + lastDirectories.splice(0, directories.length - 1); + + var _history = lastDirectories.map(function (dir, index, arr) { + var current = directories.slice(1).concat(arr.slice(0, index + 1)); + var path = current.join('/').replace(/^\//, ''); // remove starting slash + var key = directories.length + index; + var style = { zIndex: arr.length - index }; + console.log('history', dir); + + return _react2['default'].createElement( + 'span', + { key: key, className: 'history', onClick: (0, _store.bind)((0, _actionsChangedir2['default'])(path)), style: style }, + dir + ); + }); + + els = els.concat(_history); + } + })(); } return _react2['default'].createElement( 'div', - { className: 'breadcrumb' }, + { className: 'breadcrumb', ref: 'container' }, _react2['default'].createElement( 'div', null, - _react2['default'].createElement('span', { onClick: this.goUp, className: 'icon-up' }), els ) ); } }, { - key: 'goUp', - value: function goUp() { - var current = store.getState().get('cwd'); - var up = current.split('/').slice(0, -1).join('/'); + key: 'componentDidUpdate', + value: function componentDidUpdate() { + var container = _react2['default'].findDOMNode(this.refs.container); + var currents = container.querySelectorAll('span:not(.history)'); - if (up === current) return; - - store.dispatch((0, _actionsChangedir2['default'])(up)); + container.scrollLeft = currents[currents.length - 1].offsetLeft; } }]); @@ -30307,7 +30314,8 @@ exports['default'] = Breadcrumb; function props(state) { return { lwd: state.get('lwd'), // last working directory - cwd: state.get('cwd') + cwd: state.get('cwd'), + search: state.get('search') }; } module.exports = exports['default']; @@ -31081,6 +31089,35 @@ var Navigation = (function (_Component) { ) ) ), + _react2['default'].createElement( + 'p', + null, + 'View' + ), + _react2['default'].createElement( + 'ul', + null, + _react2['default'].createElement( + 'li', + null, + _react2['default'].createElement('input', { id: 'view-list', name: 'view', 'data-value': 'list', type: 'radio', defaultChecked: settings.filter === 'list' }), + _react2['default'].createElement( + 'label', + { htmlFor: 'view-list' }, + 'List' + ) + ), + _react2['default'].createElement( + 'li', + null, + _react2['default'].createElement('input', { id: 'view-grid', name: 'view', 'data-value': 'grid', type: 'radio', defaultChecked: settings.filter === 'grid' }), + _react2['default'].createElement( + 'label', + { htmlFor: 'view-grid' }, + 'Grid' + ) + ) + ), _react2['default'].createElement( 'p', null, @@ -31545,8 +31582,8 @@ var Toolbar = (function (_Component) { return _react2['default'].createElement( 'div', { className: 'toolbar' }, + _react2['default'].createElement('button', { className: 'icon-back tour-item', onClick: this.goUp }), _react2['default'].createElement('button', { className: 'icon-plus tour-item', onClick: this.newFile }), - _react2['default'].createElement('button', { className: 'icon-view tour-item', onClick: this.toggleView }), _react2['default'].createElement('button', { className: 'icon-refresh tour-item', onClick: (0, _store.bind)((0, _actionsFilesView.refresh)()) }), _react2['default'].createElement('button', { className: 'icon-select tour-item', onClick: (0, _store.bind)((0, _actionsFilesView.selectView)('toggle')) }), _react2['default'].createElement('button', { className: 'icon-more tour-item', onClick: this.showMore.bind(this), ref: 'more' }) @@ -31567,6 +31604,16 @@ var Toolbar = (function (_Component) { var transform = 'translate(0, -100%)'; _store2['default'].dispatch((0, _actionsMenu.show)('moreMenu', { style: { left: left, top: top, transform: transform } })); } + }, { + key: 'goUp', + value: function goUp() { + var current = _store2['default'].getState().get('cwd'); + var up = current.split('/').slice(0, -1).join('/'); + + if (up === current) return; + + _store2['default'].dispatch(changedir(up)); + } }, { key: 'newFile', value: function newFile() { @@ -32401,6 +32448,10 @@ exports['default'] = function (state, action) { return action.keywords; } + if (action.type === _actionsTypes.CHANGE_DIRECTORY || action.type === _actionsTypes.REFRESH) { + return ''; + } + return state; }; @@ -32419,7 +32470,7 @@ function search(keywords) { // We don't want to show all the currently visible files from the // first iteration var once = true; - (0, _apiFiles.children)('/', true).then(function showResults(files) { + (0, _apiFiles.children)('', true).then(function showResults(files) { if (!_store2['default'].getState().get('search')) return; var current = once ? [] : _store2['default'].getState().get('files'); @@ -32602,7 +32653,7 @@ var MESSAGES = { 'icon-refresh': 'Refresh File List', 'icon-select': 'Select files for batch actions', 'icon-more': 'Actions used on selected files such as Copy, Delete, Move, …', - 'icon-view': 'Toggle between List and Grid view', + 'icon-back': 'Navigate to top directory', 'drawer': 'Extra options, tools and links are here', 'icon-search': 'Search your storage for a certain file', 'swipe-instruction': 'Swipe from left to right to go to parent folder' diff --git a/build/style.css b/build/style.css index a3b42f1..2fa5f8a 100644 --- a/build/style.css +++ b/build/style.css @@ -65,18 +65,11 @@ .icon-cross svg * { fill: white; } -.icon-up { +.icon-back { display: block; - display: inline-block; - border: 11px solid transparent; - border-right-color: #63b0cd; - border-top-width: 8px; - border-bottom-width: 8px; - border-radius: 3px; - margin-right: 0.5rem; - position: relative; - top: 2px; - right: 0.5rem; + background: url(/img/Back.svg) no-repeat; + width: 15px; + height: 24px; } .regular-medium { font-weight: normal; @@ -508,21 +501,41 @@ nav i { width: 100vw; height: 4.5rem; overflow-x: auto; - padding: 8px; box-sizing: border-box; font-weight: 200; font-size: 1.6rem; + padding-right: 8px; background: #f8f8f8; border-bottom: 1px solid rgba(0, 0, 0, 0.2); overflow-x: scroll; overflow-y: hidden; white-space: nowrap; } -.breadcrumb span { - white-space: nowrap; +.breadcrumb div { + display: flex; + align-items: center; } -.breadcrumb i { - margin: 0 2px; +.breadcrumb span { + position: relative; + display: flex; + align-items: center; + height: 4.5rem; + white-space: nowrap; + padding: 0 5px 0 30px; + background: #f0f0f0; + filter: drop-shadow(1px 0 0 rgba(0, 0, 0, 0.2)); +} +.breadcrumb span:first-of-type { + padding-left: 10px; +} +.breadcrumb span::after { + position: absolute; + right: -46px; + top: 0; + content: ''; + display: block; + border: 23px solid transparent; + border-left-color: #f0f0f0; } .breadcrumb span.history { color: #9b9b93; diff --git a/design/userinterface.sketch b/design/userinterface.sketch index 20e6622..68faaa9 100644 Binary files a/design/userinterface.sketch and b/design/userinterface.sketch differ diff --git a/releases/hawk-1.0.0.zip b/releases/hawk-1.0.0.zip index 889c6d3..8590af2 100644 Binary files a/releases/hawk-1.0.0.zip and b/releases/hawk-1.0.0.zip differ diff --git a/src/icon/Icon-128.png b/src/icon/Icon-128.png index b90da61..bd15fc8 100644 Binary files a/src/icon/Icon-128.png and b/src/icon/Icon-128.png differ diff --git a/src/icon/Icon-16.png b/src/icon/Icon-16.png index 8bf30bb..28b2fa0 100644 Binary files a/src/icon/Icon-16.png and b/src/icon/Icon-16.png differ diff --git a/src/icon/Icon-340.png b/src/icon/Icon-340.png new file mode 100644 index 0000000..dc93c35 Binary files /dev/null and b/src/icon/Icon-340.png differ diff --git a/src/icon/Icon-48.png b/src/icon/Icon-48.png index 1b83591..443e368 100644 Binary files a/src/icon/Icon-48.png and b/src/icon/Icon-48.png differ diff --git a/src/icon/Icon-60.png b/src/icon/Icon-60.png index aef57b6..e0a49c1 100644 Binary files a/src/icon/Icon-60.png and b/src/icon/Icon-60.png differ diff --git a/src/icon/Icon.png b/src/icon/Icon.png index c13776e..7809d1b 100644 Binary files a/src/icon/Icon.png and b/src/icon/Icon.png differ diff --git a/src/img/Back.svg b/src/img/Back.svg new file mode 100644 index 0000000..8374b8f --- /dev/null +++ b/src/img/Back.svg @@ -0,0 +1,16 @@ + + + + Back + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/src/js/components/breadcrumb.js b/src/js/components/breadcrumb.js index a40b4d4..b2cfb64 100644 --- a/src/js/components/breadcrumb.js +++ b/src/js/components/breadcrumb.js @@ -3,64 +3,72 @@ import { connect } from 'react-redux'; import changedir from 'actions/changedir'; import { bind } from 'store'; -// TODO: Fix history not working when clicking on sdcard @connect(props) export default class Breadcrumb extends Component { render() { - let directories = this.props.cwd.split('/').filter(a => a); - directories.unshift('sdcard'); + let els = []; - let els = directories.map((dir, index, arr) => { - let path = arr.slice(1, index + 1).join('/'); + if (this.props.search) { + console.log('search'); + els = [ + Search: {this.props.search} + ] + } else { + let directories = this.props.cwd.split('/').filter(a => a); + let lastDirectories = this.props.lwd.split('/').filter(a => a); + directories.unshift('sdcard'); - return ( - - /{dir} - - ); - }); + let sumLength = directories.length + lastDirectories.length; - let lastDirectories = this.props.lwd.split('/').filter(a => a); - if (lastDirectories.length > directories.length - 1) { - lastDirectories.splice(0, directories.length - 1); - - let history = lastDirectories.map((dir, index, arr) => { - let current = directories.slice(1).concat(arr.slice(0, index + 1)); - let path = current.join('/').replace(/^\//, ''); // remove starting slash + els = els.concat(directories.map((dir, index, arr) => { + let path = arr.slice(1, index + 1).join('/'); + let style = { zIndex: sumLength - index }; return ( - - /{dir} - - ) - }); + {dir} + ); + })); - els = els.concat(history); + if (lastDirectories.length > directories.length - 1) { + lastDirectories.splice(0, directories.length - 1); + + let history = lastDirectories.map((dir, index, arr) => { + let current = directories.slice(1).concat(arr.slice(0, index + 1)); + let path = current.join('/').replace(/^\//, ''); // remove starting slash + let key = directories.length + index; + let style = { zIndex: arr.length - index}; + console.log('history', dir) + + return ( + {dir} + ) + }); + + els = els.concat(history); + } } return ( -
+
- {els}
); } - goUp() { - let current = store.getState().get('cwd'); - let up = current.split('/').slice(0, -1).join('/'); + componentDidUpdate() { + let container = React.findDOMNode(this.refs.container); + let currents = container.querySelectorAll('span:not(.history)'); - if (up === current) return; - - store.dispatch(changedir(up)); + container.scrollLeft = currents[currents.length - 1].offsetLeft; } } function props(state) { return { lwd: state.get('lwd'), // last working directory - cwd: state.get('cwd') + cwd: state.get('cwd'), + search: state.get('search') } } diff --git a/src/js/components/navigation.js b/src/js/components/navigation.js index 3c97ba0..2c7457f 100644 --- a/src/js/components/navigation.js +++ b/src/js/components/navigation.js @@ -40,6 +40,18 @@ export default class Navigation extends Component { +

View

+ +

Tools