Changes in / [74b8c52:d654c74]
- Location:
- reactapp
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/package-lock.json
r74b8c52 rd654c74 24 24 "react-scripts": "5.0.1", 25 25 "styled-components": "^5.3.5", 26 "transliteration": "^2.3.5", 26 27 "web-vitals": "^2.1.4" 27 28 } … … 15705 15706 } 15706 15707 }, 15708 "node_modules/transliteration": { 15709 "version": "2.3.5", 15710 "resolved": "https://registry.npmjs.org/transliteration/-/transliteration-2.3.5.tgz", 15711 "integrity": "sha512-HAGI4Lq4Q9dZ3Utu2phaWgtm3vB6PkLUFqWAScg/UW+1eZ/Tg6Exo4oC0/3VUol/w4BlefLhUUSVBr/9/ZGQOw==", 15712 "dependencies": { 15713 "yargs": "^17.5.1" 15714 }, 15715 "bin": { 15716 "slugify": "dist/bin/slugify", 15717 "transliterate": "dist/bin/transliterate" 15718 }, 15719 "engines": { 15720 "node": ">=6.0.0" 15721 } 15722 }, 15723 "node_modules/transliteration/node_modules/yargs": { 15724 "version": "17.5.1", 15725 "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", 15726 "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", 15727 "dependencies": { 15728 "cliui": "^7.0.2", 15729 "escalade": "^3.1.1", 15730 "get-caller-file": "^2.0.5", 15731 "require-directory": "^2.1.1", 15732 "string-width": "^4.2.3", 15733 "y18n": "^5.0.5", 15734 "yargs-parser": "^21.0.0" 15735 }, 15736 "engines": { 15737 "node": ">=12" 15738 } 15739 }, 15740 "node_modules/transliteration/node_modules/yargs-parser": { 15741 "version": "21.0.1", 15742 "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", 15743 "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", 15744 "engines": { 15745 "node": ">=12" 15746 } 15747 }, 15707 15748 "node_modules/tryer": { 15708 15749 "version": "1.0.1", … … 28021 28062 } 28022 28063 }, 28064 "transliteration": { 28065 "version": "2.3.5", 28066 "resolved": "https://registry.npmjs.org/transliteration/-/transliteration-2.3.5.tgz", 28067 "integrity": "sha512-HAGI4Lq4Q9dZ3Utu2phaWgtm3vB6PkLUFqWAScg/UW+1eZ/Tg6Exo4oC0/3VUol/w4BlefLhUUSVBr/9/ZGQOw==", 28068 "requires": { 28069 "yargs": "^17.5.1" 28070 }, 28071 "dependencies": { 28072 "yargs": { 28073 "version": "17.5.1", 28074 "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", 28075 "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", 28076 "requires": { 28077 "cliui": "^7.0.2", 28078 "escalade": "^3.1.1", 28079 "get-caller-file": "^2.0.5", 28080 "require-directory": "^2.1.1", 28081 "string-width": "^4.2.3", 28082 "y18n": "^5.0.5", 28083 "yargs-parser": "^21.0.0" 28084 } 28085 }, 28086 "yargs-parser": { 28087 "version": "21.0.1", 28088 "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", 28089 "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" 28090 } 28091 } 28092 }, 28023 28093 "tryer": { 28024 28094 "version": "1.0.1", -
reactapp/package.json
r74b8c52 rd654c74 19 19 "react-scripts": "5.0.1", 20 20 "styled-components": "^5.3.5", 21 "transliteration": "^2.3.5", 21 22 "web-vitals": "^2.1.4" 22 23 }, -
reactapp/src/App.js
r74b8c52 rd654c74 1 1 import { Outlet } from "react-router-dom"; 2 2 import { MainWrapper, MainTitle } from "./Components/Main.style"; 3 import Search from "./Components/Search.js"; 3 4 4 5 export default function App() { … … 15 16 } 16 17 </style> 17 <MainTitle>profesori.mk</MainTitle> 18 <MainTitle>profesori.mk</MainTitle> <Search /> 18 19 <Outlet /> 19 20 </MainWrapper> -
reactapp/src/Components/Main.style.js
r74b8c52 rd654c74 17 17 text-decoration: underline 3px; 18 18 margin-bottom: 30px; 19 width: fit-content; 20 float: left; 19 21 `; -
reactapp/src/Components/ProfessorCard.style.js
r74b8c52 rd654c74 6 6 padding: 10px; 7 7 margin-bottom: 30px; 8 margin-top: 140px; 8 9 `; 9 10 -
reactapp/src/Components/Search.js
r74b8c52 rd654c74 1 import React, { useEffect, useState } from "react"; 2 import JSOG from "jsog"; 3 import { transliterate } from "../Util/transliterate"; 4 import { 5 SearchDropdownResultSmall, 6 SearchDropdownTextSmall, 7 SearchDropdownSmall, 8 SearchDropdownResultLinkSmall, 9 SearchSmall, 10 } from "./Search.style"; 11 function Search() { 12 const [query, setQuery] = useState(""); 13 const [professors, setProfessors] = useState([]); 14 15 useEffect(() => { 16 const url = `http://192.168.0.17:8080/public/professors/nameContains/${transliterate( 17 query 18 )}`; 19 20 const fetchData = async () => { 21 try { 22 const response = await fetch(url); 23 var cyclicGraph = await response.json(); 24 var jsogStructure = JSOG.encode(cyclicGraph); // has { '@ref': 'ID' } links instead of cycles 25 cyclicGraph = JSOG.decode(jsogStructure); 26 setProfessors(cyclicGraph); 27 //setLoaded(true); 28 } catch (error) { 29 console.log("Error", error); 30 } 31 }; 32 33 if (query.length > 2) fetchData(); 34 }, [query]); 35 36 return ( 37 <div 38 style={{ 39 position: "relative", 40 width: "fit-content", 41 float: "right", 42 }} 43 > 44 <SearchSmall 45 placeholder="Пребарувај..." 46 onChange={(e) => setQuery(e.target.value)} 47 /> 48 <SearchDropdownSmall 49 display={query.length > 2 && professors.length > 0 ? "block" : "none"} 50 > 51 {query.length > 2 && 52 professors.slice(0, 7).map((professor) => ( 53 <SearchDropdownResultSmall key={professor.professorId}> 54 <SearchDropdownResultLinkSmall 55 href={"/professor/" + professor.professorId} 56 > 57 <SearchDropdownTextSmall weight="bold" size="medium"> 58 {professor.professorName} 59 </SearchDropdownTextSmall> 60 <SearchDropdownTextSmall weight="normal" size="smaller"> 61 {professor.faculty.facultyName} 62 </SearchDropdownTextSmall> 63 </SearchDropdownResultLinkSmall> 64 </SearchDropdownResultSmall> 65 ))} 66 </SearchDropdownSmall> 67 </div> 68 ); 69 } 70 71 export default Search; -
reactapp/src/Pages/Professor.js
r74b8c52 rd654c74 3 3 import JSOG from "jsog"; 4 4 import OpinionTree from "../Components/OpinionTree"; 5 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";6 import {7 solid,8 regular,9 brands,10 } from "@fortawesome/fontawesome-svg-core/import.macro";11 5 12 6 import { … … 70 64 return ( 71 65 <div> 72 <p >loading</p>66 <p style={{ marginTop: "140px" }}>се вчитува...</p> 73 67 <Outlet /> 74 68 </div>
Note:
See TracChangeset
for help on using the changeset viewer.