Skip to content

Commit

Permalink
fix(eslint): Fix some eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
FranklinWaller committed Apr 27, 2020
1 parent 8e60441 commit 5142aa3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions src/dummy.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('dummy', () => {
it('should exit with one', () => {
expect(1).toBe(1);
});
});
2 changes: 0 additions & 2 deletions src/js/apps/Explorer/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ import ListItemText from '@material-ui/core/ListItemText';
import Collapse from '@material-ui/core/Collapse';
import ExpandLess from '@material-ui/icons/ExpandLess';
import ExpandMore from '@material-ui/icons/ExpandMore';
import Dirent from 'memfs/lib/Dirent';
import InstanceBag from '../../InstanceBag';
import Folder from './components/Folder';
import File from './components/File';
import AppHeader from '../../components/molecules/AppHeader';
import Dropzone from '../../components/molecules/Dropzone';
import Kernel from '../../../vendor/kernel';
import BackgroundTerminal from '../../background/BackgroundTerminal';
import { getDirectoryListing, Listing } from '../../services/FileService';

Expand Down
14 changes: 9 additions & 5 deletions src/js/apps/Explorer/components/Folder/Folder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@ interface Props {
onClick: (folder: Listing) => void;
}

export default function Folder(props: Props) {
const { folder } = props;
export default function Folder({
folder,
path,
onClick,
}: Props) {
const [icon, setIcon] = React.useState('');
const [name, setName] = React.useState(folder.name);

React.useEffect(() => {
async function processFile() {
// This is a special folder with an "extension"
const folderName: any = props.folder.name;
const folderName: any = folder.name;
const folderExtension = getFileExtension(folderName);

if (folderExtension === WAPP_EXTENSION) {
const wappInfo = await getWappInformation(`${props.path}/${folderName}`);
const wappInfo = await getWappInformation(`${path}/${folderName}`);


// We should read the wapp for an icon
Expand All @@ -44,11 +47,12 @@ export default function Folder(props: Props) {
}

processFile();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return (
<div className={styles.folder}>
<div className={styles.iconWrapper} onClick={() => props.onClick(props.folder)}>
<div className={styles.iconWrapper} onClick={() => onClick(folder)}>
{icon === '' && <FolderIcon className={styles.icon} />}
{icon !== '' && <img alt="Folder" className={styles.appIcon} src={icon} />}
</div>
Expand Down
1 change: 0 additions & 1 deletion src/js/layout/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { connect } from 'react-redux';
import { Route } from 'react-router';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import Paper from 'material-ui/Paper';
import classnames from 'classnames';
import styles from './DefaultLayout.module.scss';
import logo from '../../img/PlayOSLogoSide_white.svg';
import ChoosePage from '../pages/ChoosePage';
Expand Down
2 changes: 1 addition & 1 deletion src/vendor/kernel
Submodule kernel updated 1 files
+1 −1 core/FileSystem.ts

0 comments on commit 5142aa3

Please sign in to comment.