Changeset 0df6b9e for reactapp/src/Components/Search.js
- Timestamp:
- 08/01/22 19:18:54 (2 years ago)
- Branches:
- main
- Children:
- d654c74
- Parents:
- 080a3f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 );
Note:
See TracChangeset
for help on using the changeset viewer.