From 9b907cbb0dd9a8e15ca16bd6aa8c1f71e77302bb Mon Sep 17 00:00:00 2001 From: Firesieht Date: Sun, 28 Aug 2022 05:05:05 +0300 Subject: [PATCH] fix bugs --- .eslintrc.json | 1 - package.json | 2 +- pages/api/consts.ts | 2 +- pages/download.tsx | 5 ++++ pages/files.tsx | 41 ++++++++++++++++------------- pages/view/[id].tsx | 9 ++++--- public/images/libreoficcem.svg | 46 +++++++++++++++++++++++++++++++++ public/images/myoffice.png | 24 ----------------- public/images/myoficce.png | Bin 3995 -> 0 bytes public/images/myoficcem.svg | 18 +++++++++++++ public/images/wordm.svg | 13 ++++++++++ styles/Home.module.css | 15 ++++++++++- 12 files changed, 126 insertions(+), 50 deletions(-) create mode 100644 public/images/libreoficcem.svg delete mode 100644 public/images/myoffice.png delete mode 100644 public/images/myoficce.png create mode 100644 public/images/myoficcem.svg create mode 100644 public/images/wordm.svg diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..2c63c08 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,2 @@ { - "extends": "next/core-web-vitals" } diff --git a/package.json b/package.json index 629fb2e..4d0a778 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build", + "build": "next build && next export", "start": "next start", "lint": "next lint" }, diff --git a/pages/api/consts.ts b/pages/api/consts.ts index 1d7fcb7..bd9ac2e 100644 --- a/pages/api/consts.ts +++ b/pages/api/consts.ts @@ -1 +1 @@ -export const host = "http://192.168.9.207:8000" \ No newline at end of file +export const host = "https://5bf1-89-223-81-202.eu.ngrok.io" \ No newline at end of file diff --git a/pages/download.tsx b/pages/download.tsx index fe62e2c..ee97b84 100644 --- a/pages/download.tsx +++ b/pages/download.tsx @@ -40,6 +40,11 @@ const Upload: NextPage = () => { +
+ + + +
diff --git a/pages/files.tsx b/pages/files.tsx index 5a0a6b4..155e4fd 100644 --- a/pages/files.tsx +++ b/pages/files.tsx @@ -19,22 +19,32 @@ import 'react-circular-progressbar/dist/styles.css'; const Home: NextPage = () => { const [correct, setCorrect] = useState(true) const [err, setErr] = useState(true) - const [sort, setSort] = useState("alphabet") - - - - let files = JSON.parse(localStorage.getItem("files") as string) - const [file, setFile] = useState(files[0]) + const [files, setFiles] = useState([]) + const [file, setFile] = useState({}) const [data,setData] = useState("") let i = 1; let cards = new Array() let correctClasses = 0 - const getData = () =>{ + let select = new Array() + +const getData = () =>{ + let localFiles = JSON.parse(localStorage == undefined? "":localStorage.getItem("files") as string) + setFiles(localFiles) + setFile(localFiles[0]) if (data == ""){ - axios.get(host+"/api/site/docx/" + file.uuid).then(res => { + axios.get(host+"/api/site/docx/" + (localFiles[0] as any).uuid).then(res => { setData(res.data) }) } + + files.forEach((value : any) => { + select.push( + { + name: value.file.slice(48, value.uuid.lenght), + value: value + } as SelectItemIE + ) +}); } const onFileChange = (newFile:any) =>{ setData("") @@ -60,18 +70,13 @@ const Home: NextPage = () => { > ) i++ + + } + + } - let select = new Array() - files.forEach((value : any) => { - select.push( - { - name: value.file.slice(48, value.uuid.lenght), - value: value - } as SelectItemIE - ) - }); return (
@@ -91,7 +96,7 @@ const Home: NextPage = () => {
- + setErr(!err)}>Есть замечания setCorrect(!correct)}>Без замечаний
diff --git a/pages/view/[id].tsx b/pages/view/[id].tsx index 911c9dc..0087bac 100644 --- a/pages/view/[id].tsx +++ b/pages/view/[id].tsx @@ -15,19 +15,20 @@ import { useRouter } from 'next/router' const View: NextPage = () => { - let router = useRouter() - let uuid = router.query.id as string + let router = useRouter() + let uuid = router.query.id as string const [data,setData] = useState("") let i = 1; let cards = new Array() - + const [text, setText] = useState("") const getData = () =>{ if (data == ""){ axios.get(host+"/api/site/docx/" + uuid).then(res => { setData(res.data) }) } + setText(localStorage.getItem(uuid)?.slice(48,localStorage.getItem(uuid)?.length) as string) } setTimeout(getData, 2000); if (data != ""){ @@ -61,7 +62,7 @@ const View: NextPage = () => {
- {localStorage.getItem(uuid)?.slice(48,localStorage.getItem(uuid)?.length)} + {text}
{data == ""? :cards} diff --git a/public/images/libreoficcem.svg b/public/images/libreoficcem.svg new file mode 100644 index 0000000..6f9234e --- /dev/null +++ b/public/images/libreoficcem.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/myoffice.png b/public/images/myoffice.png deleted file mode 100644 index 9039eed..0000000 --- a/public/images/myoffice.png +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/images/myoficce.png b/public/images/myoficce.png deleted file mode 100644 index 57bd7c79c53847812c402b0df5c1eb9794502ffa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3995 zcmV;M4`lF(P)tKcu27X4|oi||)yArj&r zwtmEDq_j2hhhKY3^dGoe1fwy+RA?#vptoI?cDH-yc;0i~GjnEk=FZ)ZF7)<3$?2Jy zbLPz1JI_4t`<^prDv*P<2jzC*;U2ZwuTpPbovA6{@S7%|4hbRMJwR}-Ap~ZDx=N#n zup4)aA#~8TNUSa`BId0fVzwV*2CRKazS^onYSzh!b3@EGEHQ1l*+@~$?olq7fSQ<2lA55VtObNj z%sM(~8+i23^)Je5YlKu}ixe3f4bIJWMKrMb$_Bbrj>Z&3)PSIz>N!bpnHO;#*)Vy; z?WtsrONZD^5ugiIbkJ7Nq*S7`xwIykW+qNTOhYCjUj+?Zy|RHtA|a&7r(!b3WYswn zRUePihI%q3YI3H+Qi^xGFB4R4C$jIcHKsqnQb!Ng2HxTo)sO!dwy9U)Q=9@3YF3tOh{u=8-|ct(NsV~3Kx?yiivqO z5%U;Q#57TO5^*Pfqz4`0XaY(@TH<76$Z5!|a?dO3Ve5fe2NwmJlQLFFrH&0lKu-}d z(&jdD)KVrn5fer+-#o5{jbdU7c)||<*r0}EagRw!kvpj+ZK<4iNX=>|L$lLE2knny zQfi{H$yS7v(gZe=f|CZDZJRqLToYL3zG~vC6^fWA46kiOZA>;a!O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1-|F9bfuiM1BI4Ao|hsL*sqKOo>&bX z(_OKoWwmt32yWAooQS#c+jn5}>e2Wm==*%aid(TZ`_@}=|{~K@R^(0ioLD!*!wt`X06}Q$E zX*QzOSN!A1+;hyjW6GT&q{y0l&rj7$ng2>M+?1Wvt}j_sq?mO~PHsd8ZHF`i&W;4i zP7k-Nm=-)>p8CQ@QWRe#R!=*#1N-0Lm0u#Gm?05TJoQwF4%!a+ba;EDs){zNQv1H% z%wdV?ywMYz?Af7y<@mYLV-NpwpLpVlo#>!#@qg)S--hh1>=OV0002ovPDHLkV1n?A BqH+KL diff --git a/public/images/myoficcem.svg b/public/images/myoficcem.svg new file mode 100644 index 0000000..7f74b3a --- /dev/null +++ b/public/images/myoficcem.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/public/images/wordm.svg b/public/images/wordm.svg new file mode 100644 index 0000000..986d21f --- /dev/null +++ b/public/images/wordm.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/styles/Home.module.css b/styles/Home.module.css index 9d7650a..5403bc2 100644 --- a/styles/Home.module.css +++ b/styles/Home.module.css @@ -221,11 +221,17 @@ /* main/black */ color: #000000; } - +.programsM{ + display: none; +} @media screen and (max-width: 1000px) { .h1{ font-size: 24px; } + .downloadText{ + font-size: 14px !important; + } + .main{ padding:0px 25px; padding-top: 150px; @@ -246,7 +252,14 @@ display: none; } .programs{ + display: none; + } + .programsM{ flex-wrap: wrap; + display: flex; + gap:25px; + height: 24px; + align-items: center; } .profileWrapper{ flex-wrap: wrap;