- Timestamp:
- 08/01/22 19:18:54 (2 years ago)
- Branches:
- main
- Children:
- d654c74
- Parents:
- 080a3f3
- Location:
- reactapp/src
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
reactapp/src/App.js
r080a3f3 r0df6b9e 16 16 } 17 17 </style> 18 <MainTitle>profesori.mk</MainTitle> 19 <Search /> 18 <MainTitle>profesori.mk</MainTitle> <Search /> 20 19 <Outlet /> 21 20 </MainWrapper> -
reactapp/src/Components/Main.style.js
r080a3f3 r0df6b9e 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
r080a3f3 r0df6b9e 6 6 padding: 10px; 7 7 margin-bottom: 30px; 8 margin-top: 140px; 8 9 `; 9 10 -
reactapp/src/Components/Search.js
r080a3f3 r0df6b9e 3 3 import { transliterate } from "../Util/transliterate"; 4 4 import { 5 SearchDropdownContentSmall, 5 SearchDropdownResultSmall, 6 SearchDropdownTextSmall, 6 7 SearchDropdownSmall, 8 SearchDropdownResultLinkSmall, 9 SearchSmall, 7 10 } from "./Search.style"; 8 11 function Search() { … … 32 35 33 36 return ( 34 <div style={{ position: "relative" }}> 35 <input 37 <div 38 style={{ 39 position: "relative", 40 width: "fit-content", 41 float: "right", 42 }} 43 > 44 <SearchSmall 36 45 placeholder="Пребарувај..." 37 46 onChange={(e) => setQuery(e.target.value)} 38 47 /> 39 40 {query.length > 2 && 41 professors.slice(0, 10).map((professor) => ( 42 <SearchDropdownSmall> 43 <div key={professor.professorId}> 44 <SearchDropdownContentSmall weight="bold" size="medium"> 45 {professor.professorName} 46 </SearchDropdownContentSmall> 47 <SearchDropdownContentSmall weight="normal" size="smaller"> 48 {professor.faculty.facultyName} 49 </SearchDropdownContentSmall> 50 </div> 51 </SearchDropdownSmall> 52 ))} 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> 53 67 </div> 54 68 ); -
reactapp/src/Components/Search.style.js
r080a3f3 r0df6b9e 1 1 import styled from "styled-components"; 2 import searchicon from "../searchicon.png"; 3 4 export const SearchSmall = styled.input` 5 width: 350px; 6 box-sizing: border-box; 7 border: 2px solid #ccc; 8 font-size: 16px; 9 background-color: #f9f9f9; 10 background-image: url(${searchicon}); 11 background-position: 10px 10px; 12 background-repeat: no-repeat; 13 padding: 12px 20px 12px 40px; 14 margin-top: 10px; 15 `; 2 16 3 17 export const SearchDropdownSmall = styled.div` 4 display: block; 18 display: ${(props) => props.display}; 19 position: absolute; 5 20 background-color: #f9f9f9; 6 21 min-width: 160px; … … 8 23 padding: 12px 16px; 9 24 z-index: 1; 25 width: 350px; 26 padding: 0; 10 27 `; 11 28 12 export const SearchDropdownContentSmall = styled.p` 29 export const SearchDropdownResultSmall = styled.div` 30 &:hover { 31 background-color: papayawhip; 32 border: 1px solid blue; 33 text-decoration: underline 1px blue; 34 } 35 padding: 10px; 36 `; 37 38 export const SearchDropdownResultLinkSmall = styled.a` 39 text-decoration: none; 40 color: black; 41 `; 42 43 export const SearchDropdownTextSmall = styled.p` 13 44 font-weight: ${(props) => props.weight}; 14 45 font-size: ${(props) => props.size}; -
reactapp/src/Pages/Professor.js
r080a3f3 r0df6b9e 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.