Skip to content

Commit

Permalink
fix: fix scroll on notes page
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcl-io committed Apr 22, 2021
1 parent e4aabe9 commit d02a42b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/containers/Note/NotePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ const NotePage = ({ note }: Props) => {
}, [note]);

return (
<div
id={`note-page-${note.noteItem.id}`}
className={classes.container}
style={{ height: '100vh', overflowX: 'auto' }}
>
<div id={`note-page-${note.noteItem.id}`} className={classes.container}>
<TopBar note={note} saved={saved} />

<div
Expand Down Expand Up @@ -137,7 +133,6 @@ const NotePage = ({ note }: Props) => {

const useStyles = makeStyles((theme) => ({
container: {
backgroundColor: theme.palette.background.default,
width: 1000,
margin: '0 auto',
},
Expand Down
14 changes: 12 additions & 2 deletions src/containers/Note/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { makeStyles } from '@material-ui/core';
import { defer } from 'lodash';
import { useEffect, useState } from 'react';
import { useStoreState } from '../../store/typedHooks';
import { ActiveNote } from '../../types/activeNote';
import NotePage from './NotePage';

const Note = () => {
const classes = useStyles();

const [notes, setNotes] = useState<ActiveNote[]>([]);

const activeNote = useStoreState((s) => s.activeNote);
Expand Down Expand Up @@ -38,7 +41,7 @@ const Note = () => {
}, [activeNote]);

return (
<>
<div className={classes.container}>
{notes.map((note) => (
<div
key={note.noteItem.id}
Expand All @@ -47,8 +50,15 @@ const Note = () => {
<NotePage note={note} />
</div>
))}
</>
</div>
);
};

const useStyles = makeStyles((theme) => ({
container: {
height: '100vh',
overflowX: 'auto',
},
}));

export default Note;

0 comments on commit d02a42b

Please sign in to comment.