Changes in / [d654c74:74b8c52]
- Location:
- reactapp
- Files:
-
- 3 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/package-lock.json
rd654c74 r74b8c52 24 24 "react-scripts": "5.0.1", 25 25 "styled-components": "^5.3.5", 26 "transliteration": "^2.3.5",27 26 "web-vitals": "^2.1.4" 28 27 } … … 15706 15705 } 15707 15706 }, 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 },15748 15707 "node_modules/tryer": { 15749 15708 "version": "1.0.1", … … 28062 28021 } 28063 28022 }, 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 },28093 28023 "tryer": { 28094 28024 "version": "1.0.1", -
reactapp/package.json
rd654c74 r74b8c52 19 19 "react-scripts": "5.0.1", 20 20 "styled-components": "^5.3.5", 21 "transliteration": "^2.3.5",22 21 "web-vitals": "^2.1.4" 23 22 }, -
reactapp/src/App.js
rd654c74 r74b8c52 1 1 import { Outlet } from "react-router-dom"; 2 2 import { MainWrapper, MainTitle } from "./Components/Main.style"; 3 import Search from "./Components/Search.js";4 3 5 4 export default function App() { … … 16 15 } 17 16 </style> 18 <MainTitle>profesori.mk</MainTitle> <Search />17 <MainTitle>profesori.mk</MainTitle> 19 18 <Outlet /> 20 19 </MainWrapper> -
reactapp/src/Components/Main.style.js
rd654c74 r74b8c52 17 17 text-decoration: underline 3px; 18 18 margin-bottom: 30px; 19 width: fit-content;20 float: left;21 19 `; -
reactapp/src/Components/ProfessorCard.style.js
rd654c74 r74b8c52 6 6 padding: 10px; 7 7 margin-bottom: 30px; 8 margin-top: 140px;9 8 `; 10 9 -
reactapp/src/Components/Search.js
rd654c74 r74b8c52 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 query18 )}`;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 cycles25 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 <div38 style={{39 position: "relative",40 width: "fit-content",41 float: "right",42 }}43 >44 <SearchSmall45 placeholder="Пребарувај..."46 onChange={(e) => setQuery(e.target.value)}47 />48 <SearchDropdownSmall49 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 <SearchDropdownResultLinkSmall55 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
rd654c74 r74b8c52 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"; 5 11 6 12 import { … … 64 70 return ( 65 71 <div> 66 <p style={{ marginTop: "140px" }}>се вчитува...</p>72 <p>loading</p> 67 73 <Outlet /> 68 74 </div>
Note:
See TracChangeset
for help on using the changeset viewer.