@@ -39,26 +39,77 @@ import PreferencesFilter from "./components/PreferencesFilter";
39
39
40
40
*/
41
41
42
+
43
+ export const HealthSeachResultsSection = styled . section `
44
+ left: 0;
45
+ bottom: 0;
46
+ padding : 1rem;
47
+ background-color: pink;
48
+ // position: relative;
49
+
50
+ ul.search-results-list {
51
+ list-style-type: none;
52
+ list-style-position: outside;
53
+ // padding-inline-start: 5%;
54
+ overflow-y: auto;
55
+ overflow-x: hidden;
56
+ height: 40vh;
57
+ width: 100%;
58
+ }
42
59
60
+ li {
61
+ margin-bottom: 0.9rem;
62
+ }
63
+ ` ;
64
+
65
+ export const SearchResult = styled . article `
66
+ width: 95%;
67
+ height: fit-content;
68
+ background-color: beige;
69
+ border-radius: 0.5rem;
70
+ padding: 0.15rem;
71
+ h3, p {
72
+ margin: 0.2rem;
73
+ margin-bottom: 0.35rem;
74
+ }
75
+ ` ;
76
+
77
+ export const SearchResultHeading = styled . h3 `
78
+ font-size: 1rem;
79
+ font-weight: 500;
80
+ line-height: 1.2;
81
+ height: 2rem;
82
+ width: 70%;
83
+ background-color: #e5cccc;
84
+ border-radius: 0.5rem;
85
+ padding-left: 0.6rem;
86
+ padding-top: 0.4rem;
87
+ ` ;
43
88
44
- // export const HealthSearchFilter = styled.section`
45
- // background-color: skyblue;
46
- // position: absolute;
47
- // height: fit-content;
48
- // width: 100vw;
49
- // margin-inline: auto;
50
- // `;
89
+ export const SearchResultdescription = styled . p `
90
+ font-size: 1rem;
91
+ line-height: 1.2;
92
+ margin: 0;
93
+ padding: 0;
94
+ height: 5rem;
95
+ background-color: #e5cccc;
96
+ border-radius: 0.5rem;
97
+ padding-left: 0.6rem;
98
+ padding-top: 0.4rem;
99
+ ` ;
51
100
52
- // export const HealthSeachResults = styled.section`
53
- // // top: auto;
54
- // left: 0;
55
- // bottom: 0;
56
- // background-color: pink;
57
- // position: relative;
58
- // // width: fit-content;
59
- // margin-inline: auto;
60
- // box-shadow: 0 0 20px rgba(69,86,104,0.25), 0 1px 5px rgba(69,86,104,0.1);
61
- // `;
101
+ export const SearchResultAddress = styled . p `
102
+ font-size: 1rem;
103
+ line-height: 1.2;
104
+ margin: 0;
105
+ padding: 0;
106
+ height: 2rem;
107
+ background-color: #e7dbdb;
108
+ border-radius: 0.5rem;
109
+ padding-left: 0.6rem;
110
+ padding-top: 0.4rem;
111
+ width: min(25%, 70vw);
112
+ ` ;
62
113
63
114
64
115
const renderMockedJSONSearchResults = ( data ) => {
@@ -73,25 +124,33 @@ const renderMockedJSONSearchResults = (data) => {
73
124
const renderMockedDetailedSearchResults = ( data : MockData [ ] ) => {
74
125
// TODO Make h2 live region
75
126
return (
76
- < section className = "health-search-results" >
127
+ < HealthSeachResultsSection className = "health-search-results" >
77
128
< h2 > { data . length } { t `Search Results` } </ h2 >
78
- < ul >
129
+ < ul className = "search-results-list" >
79
130
{ data . map ( ( item : MockData ) => {
80
131
const name = typeof item . properties . name === 'string' ? item . properties . name : item . properties . name ?. en ?? "Praxis Dr. Linker Platzhalter" ;
81
132
const { street, city, house, postalCode, text } = item . properties . address || { } ;
133
+ const description = item . properties . description ?. en ?? "Lorem ipsum dolor sit amet, consectetur adipiscing elit." ;
82
134
return (
83
135
< li key = { item . _id } >
84
- { JSON . stringify ( name ) }
85
- { JSON . stringify ( street ) }
86
- { JSON . stringify ( city ) }
87
- { JSON . stringify ( house ) }
88
- { JSON . stringify ( postalCode ) }
89
- { JSON . stringify ( text ) }
136
+ < SearchResult >
137
+ < SearchResultHeading > { JSON . stringify ( name ) } </ SearchResultHeading >
138
+ < SearchResultdescription >
139
+ { JSON . stringify ( description ) }
140
+ { /* <SearchResultAddress>
141
+ {JSON.stringify(street + city + house + postalCode + text)}
142
+ {JSON.stringify(city)}
143
+ {JSON.stringify(house)}
144
+ {JSON.stringify(postalCode)}
145
+ {JSON.stringify(text)}
146
+ {/* </SearchResultAddress> */ }
147
+ </ SearchResultdescription >
148
+ </ SearchResult >
90
149
</ li >
91
150
) ;
92
151
} ) }
93
152
</ ul >
94
- </ section >
153
+ </ HealthSeachResultsSection >
95
154
) ;
96
155
97
156
}
@@ -118,7 +177,7 @@ const renderMockedSurveyForm = () => {
118
177
119
178
120
179
121
-
180
+ // use useswr to import data from file
122
181
export default function Page ( ) {
123
182
return (
124
183
< React . Fragment >
@@ -138,7 +197,7 @@ const HealthSearchFilterSection = styled.section`
138
197
padding: 1rem;
139
198
display: grid;
140
199
background-color: rgb(255, 255, 255, 0.95);
141
- h1, h2 {
200
+ h1, h2, h3 {
142
201
line-height: 1;
143
202
font-weight: 400;
144
203
display: flex;
@@ -152,6 +211,10 @@ const HealthSearchFilterSection = styled.section`
152
211
font-size: 1.25rem;
153
212
font-weight: 500;
154
213
}
214
+ h3 {
215
+ font-size: 1rem;
216
+ font-weight: 500;
217
+ }
155
218
` ;
156
219
157
220
Page . getLayout = function getLayout ( page : ReactElement ) {
0 commit comments