Skip to content

Commit

Permalink
fix: fix fullscreen transition (#73)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrián Insua Yañez <[email protected]>
  • Loading branch information
AdrianInsua and adrianiy authored Apr 27, 2020
1 parent 22f1c96 commit f897f0d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/components/card/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function Card(props) {
}

const toggleFullScreen = () => {
props.toggleFullScreen(!fullscreen);
setFullscreen(!fullscreen);
};

Expand Down Expand Up @@ -93,7 +92,6 @@ function Card(props) {
return (
<ColumnLayout
className={cls(styles.card, expanded ? styles.expanded : "", fullscreen ? styles.fullscreen : "")}
style={{ marginTop: fullscreen ? 85 - props.idx * 500 : 0 }}
>
<header className="row middle spaced">
<span className={styles.cardTitle}>QUERY</span>
Expand Down
2 changes: 2 additions & 0 deletions src/components/card/Card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
height: 100vh;
z-index: 99;
position: fixed;
top: 0;
margin-top: 0;
max-width: 100%;
}
.card header {
Expand Down
8 changes: 1 addition & 7 deletions src/components/comander/Comander.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function Comander(props) {
const [queries, setQueries] = useState([]);
const [showStored, setShowStored] = useState(false);
const [highlightedSuggestion, setHighlightedSuggestion] = useState(-1);
const [fullscreen, setFullscreen] = useState(false);
const [editor, setEditor] = useState(null);
const schema = useRef(neo4jSchema);
const cm = useRef(null);
Expand Down Expand Up @@ -75,10 +74,6 @@ function Comander(props) {
setQueries(queries.filter(q => q !== query));
}

const toggleFullScreen = (value) => {
setFullscreen(value);
}

useEventListener("keydown", (event) => {
switch (event.keyCode) {
case 40: // ArrowDown
Expand All @@ -98,7 +93,7 @@ function Comander(props) {

return (
<ColumnLayout dist="spaced" className={cls(styles.comanderContainer, "animated", "fadeIn")}>
<RowLayout dist="middle" className={cls(styles.inputContainer, fullscreen ? styles.fullscreen : "")}>
<RowLayout dist="middle" className={styles.inputContainer}>
<CypherCodeMirror
className={styles.input}
options={{ ...codeMirrorSettings, ...{ theme: theme.codemirror } }}
Expand Down Expand Up @@ -141,7 +136,6 @@ function Comander(props) {
queries={queries}
selectQuery={selectQuery}
deleteQuery={deleteQuery}
toggleFullScreen={toggleFullScreen}
/>
</ColumnLayout>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/comander/Comander.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
.inputContainer {
background: var(--p-color);
margin: 0 var(--margin);
/* transition: all linear 300ms; */
box-shadow: var(--box-decoration--shadow);
}
.inputContainer em {
Expand Down

0 comments on commit f897f0d

Please sign in to comment.