Skip to content

Commit

Permalink
Merge pull request #40 from nkg447/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nkg447 committed Nov 13, 2019
2 parents 1d3f6fe + 6ec35e1 commit 82a84a4
Show file tree
Hide file tree
Showing 25 changed files with 340 additions and 127 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ __snapshots__
package.json
.travis.yml

*.js
*.js
*.css
18 changes: 17 additions & 1 deletion app/actions/fileManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export const Types = {
ADD_FILE_TO_RESULT_LIST: 'ADD_FILE_TO_RESULT_LIST',
ADD_FOLDER_TO_RESULT_LIST: 'ADD_FOLDER_TO_RESULT_LIST',
REFRESH_SEARCH_RESULTS: 'REFRESH_SEARCH_RESULTS',
NAVIGATE_ADDRESS: 'NAVIGATE_ADDRESS'
NAVIGATE_ADDRESS: 'NAVIGATE_ADDRESS',
FILES_TO_COPY: 'FILES_TO_COPY',
FILES_TO_CUT: 'FILES_TO_CUT'
};

export function changeAddress(address: String) {
Expand All @@ -24,6 +26,20 @@ export function navigateAddress(toAddress: String) {
};
}

export function filesToCopy(files: String[]) {
return {
type: Types.FILES_TO_COPY,
payload: files
};
}

export function filesToCut(files: String[]) {
return {
type: Types.FILES_TO_CUT,
payload: files
};
}

export function changeSearchState() {
return {
type: Types.SEARCH_STATE_TOGGLE
Expand Down
2 changes: 1 addition & 1 deletion app/app.global.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
@import '~@fortawesome/fontawesome-free/css/all.css';

*{
* {
border: 0;
margin: 0;
box-sizing: border-box;
Expand Down
5 changes: 1 addition & 4 deletions app/components/__template/Counter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import styles from './Counter.css';

type Props = {
Expand All @@ -24,9 +23,7 @@ export default class Counter extends Component<Props> {
} = this.props;
return (
<div>
<div className={styles.backButton} data-tid="backButton">

</div>
<div className={styles.backButton} data-tid="backButton"></div>
<div className={`counter ${styles.counter}`} data-tid="counter">
{counter}
</div>
Expand Down
43 changes: 31 additions & 12 deletions app/components/contextMenu/contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,38 @@ import React from 'react';
import ContextMenuItem from './contextMenuItem';

export default props => {
const { bounds, onOpen, onDelete, isTrashDir, ...otherProps } = props;
const {
bounds,
onOpen,
onDelete,
onCopy,
onCut,
onPaste,
onRefresh,
isTrashDir,
...otherProps
} = props;
const { x, y, file } = bounds;
return (
<div
style={{ ...styles.container, top: bounds.y, left: bounds.x }}
{...otherProps}
>
<ContextMenuItem onClick={onOpen}>Open</ContextMenuItem>
<ContextMenuItem onClick={onDelete}>
{isTrashDir ? 'Delete from Trash' : 'Move to Trash'}
</ContextMenuItem>
{isTrashDir ? (
<ContextMenuItem>Restore from Trash</ContextMenuItem>
) : null}
<div style={{ ...styles.container, top: y, left: x }} {...otherProps}>
{file ? (
<>
<ContextMenuItem onClick={onOpen}>Open</ContextMenuItem>
<ContextMenuItem onClick={onCopy}>Copy</ContextMenuItem>
<ContextMenuItem onClick={onCut}>Cut</ContextMenuItem>
<ContextMenuItem onClick={onDelete}>
{isTrashDir ? 'Delete from Trash' : 'Move to Trash'}
</ContextMenuItem>
{isTrashDir ? (
<ContextMenuItem>Restore from Trash</ContextMenuItem>
) : null}
</>
) : (
<>
<ContextMenuItem onClick={onRefresh}>Refresh</ContextMenuItem>
<ContextMenuItem onClick={onPaste}>Paste</ContextMenuItem>
</>
)}
</div>
);
};
Expand Down
8 changes: 6 additions & 2 deletions app/components/contextMenu/contextMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ import React from 'react';

export default props => {
const { children, ...otherProps } = props;
return <button {...otherProps} style={styles.container}>{children}</button>;
return (
<button {...otherProps} style={styles.container}>
{children}
</button>
);
};

const styles = {
container: {
container: {
padding: '0.5rem',
borderBottom: '1px solid lightgray'
}
Expand Down
14 changes: 8 additions & 6 deletions app/components/fileItem/FileItem.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React, { Component } from 'react';
import styles from './FileItem.css';
import { connect } from 'react-redux';
import Colors from '../../theme/Color';
const mime = require('mime-types');
const path = require('path');
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { createSelectable } from 'react-selectable-fast';
import {
Expand All @@ -17,6 +13,11 @@ import {
faFileCsv,
faFileVideo
} from '@fortawesome/free-solid-svg-icons';
import Colors from '../../theme/Color';
import styles from './FileItem.css';

const mime = require('mime-types');
const path = require('path');

const programmingLanguages = [
'java',
Expand Down Expand Up @@ -53,6 +54,7 @@ export default createSelectable(props => {
isSelected,
isSelecting,
selectableRef,
selected,
...otherProps
} = props;
const isDirectory = file.isDirectory();
Expand All @@ -72,7 +74,7 @@ export default createSelectable(props => {
icon={isDirectory ? faFolder : addressToIcon(file.name)}
style={iconStyle}
color={
isSelected || isSelecting ? Colors.selectedFileIcon : Colors.fileIcon
selected || isSelecting ? Colors.selectedFileIcon : Colors.fileIcon
}
/>
);
Expand All @@ -81,7 +83,7 @@ export default createSelectable(props => {
<div
ref={selectableRef}
className={
isSelected || isSelecting ? styles.selectedContainer : styles.container
selected || isSelecting ? styles.selectedContainer : styles.container
}
style={containerStyle}
{...otherProps}
Expand Down
14 changes: 9 additions & 5 deletions app/components/search/Search.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import React from 'react';
import connect from 'react-redux';
import styles from './search.css';
import searchFiles from "../../utils/searchFilesWithName"
import searchFiles from '../../utils/searchFilesWithName';

function onChange(event){
function onChange(event) {
props.keyUp(event.target.value);
}

export default function Search(props){
export default function Search(props) {
return (
<input onChange={onChange} className={styles.search} placeholder={'Search..'} />
)
<input
onChange={onChange}
className={styles.search}
placeholder="Search.."
/>
);
}
4 changes: 2 additions & 2 deletions app/components/search/search.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
:local(.search){
:local(.search) {
border-radius: 1000px;
border: 2px solid #74b1be;
background: inherit;
padding: 4px 10px ;
padding: 4px 10px;
outline: none;
color: #74b1be;
}
7 changes: 4 additions & 3 deletions app/components/selectingRect/selectingRect.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ export default props => {
...styles.container,
top: y,
left: x,
height: height,
width: width
height,
width
}}
></div>
);
} else return null;
}
return null;
};

const styles = {
Expand Down
2 changes: 1 addition & 1 deletion app/components/sidebar/ListItem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styles from './ListItem.css';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import styles from './ListItem.css';

export default props => {
const { item, active, text, ...otherProps } = props;
Expand Down
4 changes: 2 additions & 2 deletions app/components/sidebar/SidebarTop.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import styles from './SidebarTop.css';
import Colors from '../../theme/Color';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faChevronRight,
faChevronLeft
} from '@fortawesome/free-solid-svg-icons';
import styles from './SidebarTop.css';
import Colors from '../../theme/Color';

export default props => {
const { navigateAddress, currentStackIndex, navigationStack } = props;
Expand Down
3 changes: 2 additions & 1 deletion app/containers/content/Content.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
width: 100%;
display: flex;
flex-direction: column;

/* overflow: auto; */
}
}
Loading

0 comments on commit 82a84a4

Please sign in to comment.