Skip to content

Commit

Permalink
continues gap switch
Browse files Browse the repository at this point in the history
  • Loading branch information
AriaMoradi committed Mar 27, 2021
1 parent a567701 commit 3a1e1e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webUI/react/src/components/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const useStyles = (settings: IReaderSettings) => makeStyles({
backgroundColor: '#525252',
marginBottom: 10,
},
image: {
display: 'block',
marginBottom: settings.continuesPageGap ? '15px' : 0,
},
});

interface IProps {
Expand Down Expand Up @@ -77,6 +81,7 @@ function LazyImage(props: IProps) {

return (
<img
className={classes.image}
ref={ref}
src={imageSrc}
alt={`Page #${index}`}
Expand All @@ -100,6 +105,7 @@ export default function Page(props: IProps) {
<CircularProgress thickness={5} />
</div>
)}
once
>
<LazyImage
src={src}
Expand Down
12 changes: 12 additions & 0 deletions webUI/react/src/components/ReaderNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,13 @@ const useStyles = (settings: IReaderSettings) => makeStyles((theme: Theme) => ({
export interface IReaderSettings{
staticNav: boolean
showPageNumber: boolean
continuesPageGap: boolean
}

export const defaultReaderSettings = () => ({
staticNav: false,
showPageNumber: true,
continuesPageGap: false,
} as IReaderSettings);

interface IProps {
Expand Down Expand Up @@ -279,6 +281,16 @@ export default function ReaderNavBar(props: IProps) {
/>
</ListItemSecondaryAction>
</ListItem>
<ListItem>
<ListItemText primary="Continues Page gap" />
<ListItemSecondaryAction>
<Switch
edge="end"
checked={settings.continuesPageGap}
onChange={(e) => setSettingValue('continuesPageGap', e.target.checked)}
/>
</ListItemSecondaryAction>
</ListItem>
</List>
</Collapse>
<hr />
Expand Down

0 comments on commit 3a1e1e0

Please sign in to comment.