diff --git a/src/components/Setting/FontColor/Colors/chosecolor.js b/src/components/Setting/FontColor/Colors/chosecolor.js
index ba58309..a0d2b6e 100644
--- a/src/components/Setting/FontColor/Colors/chosecolor.js
+++ b/src/components/Setting/FontColor/Colors/chosecolor.js
@@ -4,7 +4,7 @@ import '../../../style/chosecolor.scss';
const Chosecolor = (props) => {
- const {color , setcolor} = props;
+ const {setcolor} = props;
const changeColorHandler = (value) => {
setcolor(value)
diff --git a/src/components/Setting/FontSize/fontsize.js b/src/components/Setting/FontSize/fontsize.js
index 0eac8b9..b953c64 100644
--- a/src/components/Setting/FontSize/fontsize.js
+++ b/src/components/Setting/FontSize/fontsize.js
@@ -7,7 +7,7 @@ function ButtonIncrement(props) {
type="button"
outline
onClick={props.onClickFunc}
- style={{ padding: "0px 5px" , color: "#009AA8" }}
+ style={{ padding: "0px 5px", color: "#009AA8" }}
>
+
@@ -20,7 +20,7 @@ function ButtonDecrement(props) {
type="button"
outline
onClick={props.onClickFunc}
- style={{ padding: "0px 5px" , color: "#009AA8" }}
+ style={{ padding: "0px 5px", color: "#009AA8" }}
>
-
@@ -28,22 +28,23 @@ function ButtonDecrement(props) {
}
function Display(props) {
- return ;
+ return ;
}
const Fontsize = (props) => {
- const [countersize, setCounter ] = useState(1)
- const incrementCounter = () => setCounter(countersize + 1);
- let decrementCounter = () => setCounter(countersize - 1);
+ const { bookStyle, setBookStyle } = props;
+ // const [countersize, setCounter ] = useState(1)
+ const incrementCounter = () =>
+ setBookStyle({ ...bookStyle, fontSize: bookStyle.fontSize + 1 });
+ let decrementCounter = () =>
+ setBookStyle({ ...bookStyle, fontSize: bookStyle.fontSize - 1 });
+
- if (countersize <= 1) {
- decrementCounter = () => setCounter(1);
- }
return (
diff --git a/src/components/Setting/FontStyle/Fonts/fonts.js b/src/components/Setting/FontStyle/Fonts/fonts.js
index 0758ba2..676a3b3 100644
--- a/src/components/Setting/FontStyle/Fonts/fonts.js
+++ b/src/components/Setting/FontStyle/Fonts/fonts.js
@@ -1,23 +1,30 @@
-import React from 'react';
-import '../../../style/fonts.scss';
+import React from "react";
+import "../../../style/fonts.scss";
const Fonts = (props) => {
+ const { setBookStyle, bookStyle } = props;
- const {setname} = props;
+ return (
+ <>
+
+ >
+ );
+};
- const fontHandler = (value) =>{
- setname(value)
- }
+export default Fonts;
-
- return (
- <>
-
- >
- )
-}
-
-export default Fonts
+// ()=>setBookStyle({fontFamily: bookStyle.fontFamily === "Nazanin" })
+// ()=>setBookStyle({fontFamily: bookStyle.fontFamily === "Sans" })
diff --git a/src/components/Setting/FontStyle/Fontstyle.js b/src/components/Setting/FontStyle/Fontstyle.js
index b04fdce..a159284 100644
--- a/src/components/Setting/FontStyle/Fontstyle.js
+++ b/src/components/Setting/FontStyle/Fontstyle.js
@@ -1,33 +1,28 @@
-import React , { useState } from 'react';
-import { Dropdown, DropdownToggle, DropdownMenu } from 'reactstrap';
-import '../../../components/style/fontStyle.scss'
-import Fonts from './Fonts/fonts'
+import React, { useState } from "react";
+import { Dropdown, DropdownToggle, DropdownMenu } from "reactstrap";
+import "../../../components/style/fontStyle.scss";
+import Fonts from "./Fonts/fonts";
const Fontstyle = (props) => {
- const {setname ,name} = props;
+ const { bookStyle, setBookStyle } = props;
+ const [dropdownOpen, setDropdownOpen] = useState(false);
+ const toggle = () => setDropdownOpen((prevState) => !prevState);
- const [dropdownOpen, setDropdownOpen] = useState(false);
- const toggle = () => setDropdownOpen(prevState => !prevState)
+ return (
+
+
+
+
+
+
+
+
+
+
+ );
+};
- return (
-
-
-
-
-
-
-
-
-
-
- )
-}
-
-export default Fontstyle
+export default Fontstyle;
diff --git a/src/components/Setting/LineHeight/lineheight.js b/src/components/Setting/LineHeight/lineheight.js
index 9b78b62..02f15cf 100644
--- a/src/components/Setting/LineHeight/lineheight.js
+++ b/src/components/Setting/LineHeight/lineheight.js
@@ -1,5 +1,4 @@
import React, { useState } from "react";
-import FormatLineSpacingRoundedIcon from "@material-ui/icons/FormatLineSpacingRounded";
import lineSpace from "../../image/lineSpace.svg";
import line from "../../image/line.svg";
import "../../../components/style/lineheight.scss";
@@ -34,22 +33,31 @@ function Display(props) {
return ;
}
-const Lineheight = () => {
- const [counterline, setcounterline] = useState(1);
+const Lineheight = (props) => {
+ const { setBookStyle, bookStyle } = props;
+ // const [counterline, setcounterline] = useState(1);
- const incrementCounter = () => setcounterline(counterline + 1);
- let decrementCounter = () => setcounterline(counterline - 1);
+ const incrementCounter = () =>
+ setBookStyle({
+ ...bookStyle,
+ lineHeight: Math.round(bookStyle.lineHeight * 5) / 5 + 0.2,
+ });
+ let decrementCounter = () =>
+ setBookStyle({
+ ...bookStyle,
+ lineHeight: Math.round(bookStyle.lineHeight * 5) / 5 - 0.2,
+ });
- if (counterline <= 1) {
- decrementCounter = () => setcounterline(1);
- }
+ // if (counterline <= 1) {
+ // decrementCounter = () => setcounterline(1);
+ // }
return (
<>
diff --git a/src/components/Setting/setting.js b/src/components/Setting/setting.js
index e1f0419..ca68400 100644
--- a/src/components/Setting/setting.js
+++ b/src/components/Setting/setting.js
@@ -1,30 +1,27 @@
-import React , {useState} from "react";
+import React from "react";
import { Collapse, Card } from "reactstrap";
import Fontstyle from "./FontStyle/Fontstyle";
import Colors from "./FontColor/colors";
import FontSize from "./FontSize/fontsize";
import LineHeight from "./LineHeight/lineheight";
import "../style/setting.scss";
-import OptionDropdown from "../option/Dropdown";
+// import OptionDropdown from "../option/Dropdown";
const Setting = (props) => {
const {
- BookStyle,
- onSelect,
+ // BookStyle,
+ // onSelect,
isOpen,
- valueList,
- defaultValue,
- title,
+ // valueList,
+ // defaultValue,
+ // title,
setIsChecked,
isChecked,
- countersize,
- setCounter,
- counterline,
- setcounterline,
- setname,
- name,
setcolor,
color,
+ bookStyle,
+ setBookStyle,
+ bookOption,
} = props;
return (
<>
@@ -40,12 +37,12 @@ const Setting = (props) => {
/>
@@ -76,13 +76,13 @@ interface Props {
export default Footer;
-const WrapperBtn = styled.div`
- position: fixed;
- left: 0;
- top: 60px;
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
-`;
+// const WrapperBtn = styled.div`
+// position: fixed;
+// left: 0;
+// top: 60px;
+// width: 100%;
+// height: 100%;
+// display: flex;
+// align-items: center;
+// justify-content: space-between;
+// `;
diff --git a/src/containers/Header.tsx b/src/containers/Header.tsx
index 716e16a..c70a41f 100644
--- a/src/containers/Header.tsx
+++ b/src/containers/Header.tsx
@@ -5,24 +5,25 @@ import Wrapper from "components/header/Wrapper";
import Layout, { AutoLayout } from "components/header/Layout";
import Logo from "components/header/Logo";
import Item from "components/footer/Item";
-import Setting from "components/Setting/setting";
-import { Collapse, Button, CardBody, Card } from "reactstrap";
+// import { Collapse, Button, CardBody, Card } from "reactstrap";
const Header = ({
+ isOpen,
+ setIsOpen,
onNavToggle,
- onOptionToggle,
+ // onOptionToggle,
onLearningToggle,
title,
}: Props) => {
- const [isOpen, setIsOpen] = useState(false);
- const toggle = () => setIsOpen(!isOpen);
+
+
return (
<>
-
>
);
};
@@ -89,6 +89,8 @@ interface Props {
onNavToggle: (value?: boolean) => void;
onOptionToggle: (value?: boolean) => void;
onLearningToggle: (value?: boolean) => void;
+ isOpen: any;
+ setIsOpen:any;
// setsettingicon: (value?: boolean) => void;
}
diff --git a/src/containers/Reader.tsx b/src/containers/Reader.tsx
index bba9aa9..8bcfa83 100644
--- a/src/containers/Reader.tsx
+++ b/src/containers/Reader.tsx
@@ -2,7 +2,7 @@ import { useState, useRef } from "react";
import { useSelector, useDispatch } from "react-redux";
import { Provider } from "react-redux";
import { ReactEpubViewer } from "react-epub-viewer";
-import styled from "styled-components";
+// import styled from "styled-components";
// containers
import Header from "containers/Header";
import Footer from "containers/Footer";
@@ -14,7 +14,7 @@ import Snackbar from "containers/commons/Snackbar";
// components
import ViewerWrapper from "components/commons/ViewerWrapper";
import LoadingView from "LoadingView";
-import BookInfo from "components/nav/BookInfo";
+// import BookInfo from "components/nav/BookInfo";
// slices
import store from "slices";
import { updateBook, updateCurrentPage, updateToc } from "slices/book";
@@ -30,10 +30,11 @@ import { ViewerRef } from "types";
import Book, { BookStyle, BookOption } from "types/book";
import Page from "types/page";
import Toc from "types/toc";
-import { title } from "node:process";
+// import { title } from "node:process";
import ArrowBackIosRoundedIcon from "@material-ui/icons/ArrowBackIosRounded";
import ArrowForwardIosRoundedIcon from "@material-ui/icons/ArrowForwardIosRounded";
-import MoveBtn from "components/footer/MoveBtn";
+import Setting from "components/Setting/setting";
+// import MoveBtn from "components/footer/MoveBtn";
const Reader = ({ url, loadingView }: Props) => {
const dispatch = useDispatch();
@@ -92,9 +93,10 @@ const Reader = ({ url, loadingView }: Props) => {
const node =
iframe && iframe.contentWindow && iframe.contentWindow.document;
// node && node.head && node.head.appendChild(new_style_element);
+ console.log(node);
};
const onBookInfoChange = (book: Book) => {
- // loadFont();
+ loadFont();
dispatch(updateBook(book));
};
@@ -160,13 +162,14 @@ const Reader = ({ url, loadingView }: Props) => {
/** ContextMenu off */
const onContextmMenuRemove = () => setIsContextMenu(false);
- const [settingicon, setsettingicon] = useState(false);
+ // const [settingicon, setsettingicon] = useState(false);
- const changeiconsettinghandler = () => {
- setsettingicon(!settingicon);
- };
+ // const changeiconsettinghandler = () => {
+ // setsettingicon(!settingicon);
+ // };
const [CountPage, setCountPage] = useState(0);
+ const [isOpen, setIsOpen] = useState(false);
return (
<>
@@ -176,6 +179,15 @@ const Reader = ({ url, loadingView }: Props) => {
onNavToggle={onNavToggle}
onOptionToggle={onOptionToggle}
onLearningToggle={onLearningToggle}
+ isOpen={isOpen}
+ setIsOpen={setIsOpen}
+ />
+
void;
}
-
-
const Btn = styled.button`
position: relative;
height: 100%;
@@ -259,10 +257,10 @@ const Btn = styled.button`
align-items: center;
justify-content: center;
z-index: 0;
- transition: .3s ${styles.transition};
+ transition: 0.3s ${styles.transition};
outline: none;
&::before {
- content: '';
+ content: "";
position: absolute;
left: 0;
right: 0;
@@ -271,9 +269,9 @@ const Btn = styled.button`
margin: auto;
z-index: -1;
border-radius: 30px;
- transition: .1s ${styles.transition};
+ transition: 0.1s ${styles.transition};
background-color: rgb(0, 154, 168);
- };
+ }
`;
const BtnWrapper = styled.div`
display: flex;