From 15f24f92b2c60d1a4ed758a841e6919114d3d16b Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Mon, 15 Oct 2018 15:06:52 +0530 Subject: [PATCH] minor fixes and docs --- src/components/SidePane.jsx | 1 + src/components/app.jsx | 10 +++++++++- src/index.html | 6 +++--- src/style.css | 6 +++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/SidePane.jsx b/src/components/SidePane.jsx index ab59dd3..8a0cd06 100644 --- a/src/components/SidePane.jsx +++ b/src/components/SidePane.jsx @@ -214,6 +214,7 @@ export class SidePane extends Component { } dropHandler(e) { e.preventDefault(); + // Object with `children` key is to simulate a folder structure for root folder this.props.onFileDrop(e.dataTransfer.getData('text/plain'), { children: this.props.files }); diff --git a/src/components/app.jsx b/src/components/app.jsx index 1e3a6df..a220b02 100644 --- a/src/components/app.jsx +++ b/src/components/app.jsx @@ -1283,9 +1283,17 @@ export default class App extends Component { }); } + getRootClasses() { + const classes = []; + if (this.state.currentItem && this.state.currentItem.files) { + classes.push('is-file-mode'); + } + return classes.join(' '); + } + render() { return ( -
+
- - - <%= htmlWebpackPlugin.options.ssr({ + + + <%= htmlWebpackPlugin.options.ssr({ url: '/' }) %> diff --git a/src/style.css b/src/style.css index 6aa9f45..54b5fea 100644 --- a/src/style.css +++ b/src/style.css @@ -387,7 +387,7 @@ body:not(.light-version).overlay-visible .main-container { width: auto; } -.is-project .content-wrap { +.is-file-mode .content-wrap { flex-direction: row; } @@ -455,7 +455,7 @@ body:not(.light-version).overlay-visible .main-container { height: auto; width: 33%; } -.is-project .code-wrap { +.is-file-mode .code-wrap { flex-basis: 100%; } @@ -1673,7 +1673,7 @@ body:not(.is-app) .show-when-app { display: none; } -.is-project .hide-in-file-mode { +.is-file-mode .hide-in-file-mode { display: none !important; } @media screen and (max-width: 600px) {