Skip to content

Commit 9d383e3

Browse files
authored
Merge pull request #39 from kristo-baricevic/feedback-form2
feat: Feedback Form
2 parents 8378963 + b364c31 commit 9d383e3

13 files changed

Lines changed: 483 additions & 361 deletions

File tree

frontend/package-lock.json

Lines changed: 111 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
"prettier-plugin-tailwindcss": "^0.4.1",
4242
"tailwindcss": "^3.3.2",
4343
"typescript": "^5.1.3",
44-
"vite": "^4.3.9"
44+
"vite": "^4.4.9"
4545
}
4646
}

frontend/src/App.css

Lines changed: 91 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,13 @@
66
transform: rotate(360deg);
77
}
88
}
9-
.error-message {
10-
11-
}
12-
13-
.error-message::before {
14-
15-
16-
top: 0;
17-
left: 0;
18-
width: 10px;
19-
height: 10px;
20-
border-radius: 50%;
21-
background-color: pink;
22-
}
23-
24-
.error-message {
25-
26-
color: #FFFFFF;
27-
padding: 10px;
28-
margin: 5px 0;
29-
border-radius: 5px;
30-
}
319

3210
@media (prefers-reduced-motion: no-preference) {
3311
a:nth-of-type(2) .logo {
3412
animation: logo-spin infinite 20s linear;
3513
}
3614
}
3715

38-
.read-the-docs {
39-
color: #888;
40-
}
41-
4216
@tailwind base;
4317
@tailwind components;
4418
@tailwind utilities;
@@ -131,28 +105,67 @@
131105
}
132106
}
133107

134-
/* Tailwind Styles */
108+
/*
109+
Note: This is layout for the whole site.
110+
*/
111+
112+
/* Layout For Whole Site */
135113

136114
.container {
137115
@apply relative z-10 mx-auto flex w-full flex-col items-center;
138116
}
139117

140-
.btnCancel {
141-
@apply h-10 rounded-xl border bg-gray-400 px-3 py-1.5 font-satoshi text-sm text-white hover:bg-blue-400;
118+
/*
119+
This is the wording logo in the nav bar
120+
*/
121+
122+
.header_logo {
123+
@apply bg-gradient-to-r from-blue-600 via-blue-700 to-blue-600 bg-clip-text text-transparent;
124+
}
125+
126+
/* Tailwind Styles */
127+
128+
/*
129+
Font for body
130+
*/
131+
132+
.font_body {
133+
@apply font-satoshi text-sm;
134+
}
135+
136+
/*
137+
The border style of the container
138+
*/
139+
140+
.summary_box {
141+
@apply rounded-md border bg-white p-4 px-8 ring-1 hover:ring-slate-300 ;
142142
}
143143

144-
.btn {
144+
/*
145+
Button
146+
*/
147+
148+
.btnBlue {
145149
@apply h-10 rounded-xl border bg-blue-500 px-3 py-1.5 font-satoshi text-sm text-white hover:bg-blue-400;
146150
}
147151

152+
.btnGray {
153+
@apply h-10 rounded-xl border bg-gray-400 px-3 py-1.5 font-satoshi text-sm text-white hover:bg-blue-400;
154+
}
155+
156+
.btnRed {
157+
@apply h-10 rounded-xl border bg-red-700 px-3 py-1.5 font-satoshi text-sm text-white hover:bg-blue-400;
158+
}
159+
160+
161+
/*
162+
The heading directly under the nav bar.
163+
*/
164+
148165
.head_text {
149166
@apply mt-16 text-center text-5xl font-extrabold leading-[1.15] text-black sm:text-6xl;
150167
}
151168

152-
.header_logo {
153-
@apply bg-gradient-to-r from-blue-600 via-blue-700 to-blue-600 bg-clip-text text-transparent;
154-
}
155-
156169
.desc {
157170
@apply mt-7 px-2 text-center font-sans text-3xl font-medium text-gray-800 md:p-0 md:px-0 md:text-5xl;
158171
}
@@ -162,49 +175,50 @@
162175
letter-spacing: 0.03em;
163176
}
164177

165-
.url_input {
166-
@apply block w-full rounded-md border-0 bg-white py-2 pl-5 pr-5 font-satoshi text-sm font-medium shadow-sm ring-1 ring-slate-300 hover:border-0 hover:ring-1 hover:ring-sky-500 focus:border-blue-400 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-40;
167-
}
178+
/*
179+
Input field.
180+
*/
168181

169-
.ani_input {
170-
@apply block w-full rounded-md border-0 bg-white py-2 pl-5 pr-5 font-satoshi text-sm font-medium shadow-sm ring-1 ring-slate-300 transition duration-200 hover:border-0 hover:ring-1 hover:ring-sky-500 focus:border-blue-400 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-40;
182+
.input {
183+
@apply block rounded-md border-0 bg-white py-2 pl-5 pr-5 font-satoshi text-sm ring-1 transition duration-200 hover:border-0 hover:ring-1 hover:ring-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-500;
171184
}
172185

173-
input[type="ani_input"]:focus ~ .input-text,
174-
input[type="ani_input"]:not(:placeholder-shown) ~ .input-text {
175-
@apply -translate-x-2 -translate-y-5 scale-75 transform text-blue-500;
176-
}
186+
/*
187+
This is for when the input field is loading
188+
*/
177189

178-
.url_input_loading {
190+
.input_loading {
179191
@apply block w-full rounded-md border border-gray-300 bg-gray-300 bg-opacity-50 py-2 pl-5 pr-5 font-satoshi text-sm font-medium shadow-lg focus:border-black focus:outline-none focus:ring-0;
180192
}
181-
.dropdown {
182-
@apply block w-64 rounded-md border-0 p-3 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:border-blue-400 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-40 sm:text-sm sm:leading-6;
183-
}
184193

185-
.submit_btn {
186-
@apply absolute inset-y-0 right-0 my-1.5 mr-1.5 flex w-10 items-center justify-center rounded border border-gray-200 font-sans text-sm font-medium text-gray-400 hover:border-gray-700 hover:text-gray-700;
194+
/*
195+
Dropdown field.
196+
*/
197+
198+
.dropdown {
199+
@apply block w-64 font-satoshi cursor-pointer rounded-md border-0 p-3 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset sm:text-sm sm:leading-6 focus:outline-none focus:ring-2 focus:ring-sky-500 hover:border-0 hover:ring-1 hover:ring-sky-500 ;
187200
}
188201

189202
.link_card {
190203
@apply flex cursor-pointer items-center justify-between rounded-md border bg-white p-3 py-2.5 pl-5 ring-1 hover:bg-indigo-100;
191204
}
192205

206+
/*
207+
Circle background for logos
208+
*/
209+
193210
.copy_btn {
194211
@apply flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-white/10 shadow-[inset_10px_-50px_94px_0_rgb(199,199,199,0.2)] md:mr-10;
195212
}
196213

197-
.blue_gradient {
198-
@apply bg-gradient-to-r from-blue-600 to-cyan-600 bg-clip-text font-black text-transparent;
199-
}
214+
/*
215+
Tooltip. Please see Tooltip.tsx under components folder
216+
*/
200217

201-
.summary_box {
202-
@apply w-[870px] rounded-md border bg-white p-4 px-8 ring-1 hover:ring-slate-300 hover:ring-slate-300;
203-
/* backdrop-blur */
204-
}
205218
.tooltip-container {
206219
@apply cursor-pointer;
207220
}
221+
208222
.tooltip {
209223
@apply border;
210224
position: absolute;
@@ -220,5 +234,25 @@ input[type="ani_input"]:not(:placeholder-shown) ~ .input-text {
220234
}
221235

222236
.material-symbols-outlined {
223-
font-size: 18px; /* Adjust the value as needed */
237+
font-size: 18px;
238+
}
239+
240+
/*
241+
Error message. Please see ErrorMessages.tsx under components folder
242+
*/
243+
244+
.error-message::before {
245+
top: 0;
246+
left: 0;
247+
width: 10px;
248+
height: 10px;
249+
border-radius: 50%;
250+
background-color: pink;
224251
}
252+
253+
.error-message {
254+
color: #FFFFFF;
255+
padding: 10px;
256+
margin: 5px 0;
257+
border-radius: 5px;
258+
}

frontend/src/assets/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export function copy(): any; // replace any with the appropriate type if you know it

frontend/src/components/Header/Chat.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
2323
const [inputValue, setInputValue] = useState("");
2424
const [chatLog, setChatLog] = useState<ChatLogItem[]>([]); // Specify the type as ChatLogItem[]
2525
const [isLoading, setIsLoading] = useState(false);
26-
const suggestionPrompts = [
27-
"Tell me about treatment options.",
28-
"What are the common side effects?",
29-
"How to manage medication schedule?",
30-
];
26+
// const suggestionPrompts = [
27+
// "Tell me about treatment options.",
28+
// "What are the common side effects?",
29+
// "How to manage medication schedule?",
30+
// ];
3131
const [pageContent, setPageContent] = useState("");
3232

3333
let systemMessage = {
@@ -44,7 +44,7 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
4444
observer.observe(document.body, {
4545
childList: true,
4646
subtree: true,
47-
characterData: true
47+
characterData: true,
4848
});
4949

5050
const extractedContent = extractContentFromDOM();
@@ -133,14 +133,14 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
133133
>
134134
{showChat ? (
135135
<div
136-
id="chat_container"
136+
id="chat_container "
137137
className=" mx-auto flex h-full flex-col overflow-auto rounded "
138138
>
139139
<div
140140
className="absolute mt-0 flex h-8 w-full flex-row items-center justify-between rounded-t-lg border-b bg-white p-1 "
141141
style={{ borderBottomColor: "#abcdef" }}
142142
>
143-
<div className=" ml-4 text-black">
143+
<div className=" ml-4 text-black">
144144
Questions for me? <br />
145145
</div>
146146
<div
@@ -162,7 +162,7 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
162162
</svg>
163163
</div>
164164
</div>
165-
<div className="mt-6 flex flex-grow flex-col space-y-2 p-5 pb-44">
165+
<div className="font_body mt-6 flex flex-grow flex-col space-y-2 p-5 pb-44">
166166
{chatLog.length === 0 ? (
167167
<>
168168
{/* <div className="text-gray-500">
@@ -223,15 +223,15 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
223223
<form onSubmit={handleSubmit} className="mb-1 flex">
224224
<div className="ml-2 flex-grow">
225225
<input
226-
type="text"
227-
className="input_chat ring-slate-1000/10 dark:highlight-white/5 text-sm"
226+
type="ani_input"
227+
className="input dark:highlight-white/5 w-full"
228228
placeholder="Talk to me..."
229229
value={inputValue}
230230
onChange={(e) => setInputValue(e.target.value)}
231231
/>
232232
</div>
233233
<div className="ml-5">
234-
<button type="submit" className="btn">
234+
<button type="submit" className="btnBlue">
235235
Send
236236
</button>
237237
</div>

frontend/src/components/Header/FeatureMenuDropDown.tsx

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,30 @@ import { Link } from "react-router-dom";
22

33
export const FeatureMenuDropDown = () => {
44
return (
5-
<div className="absolute text-sm items-center mt-2 mb-2 top-full flex h-50 flex-row rounded-lg bg-white font-inter border-2 sm:px-6 md:px-8 lg:px-8 xl:px-6 ">
6-
5+
<div className="h-50 absolute top-full mb-2 mt-2 flex flex-row items-center rounded-lg border-2 bg-white font-inter text-sm sm:px-6 md:px-8 lg:px-8 xl:px-6 ">
76
<div className="mx-3 my-5 ">
8-
<ul className=" cursor-pointer hover:bg-gray-100 p-3 rounded-lg transition duration-300">
9-
<Link
10-
to="/"
11-
12-
>
13-
<span className=" text-black font-bold ">
14-
Medication Suggester
15-
</span>
16-
17-
<div className="text-sm font-satoshi mt-1 text-gray-400">Medication recommendations based on symptoms and medical history.</div>
18-
</Link>
19-
</ul>
20-
7+
<Link to="/">
8+
<ul className=" cursor-pointer rounded-lg p-3 transition duration-300 hover:bg-gray-100">
9+
<span className=" font-bold text-black ">
10+
Medication Suggester
11+
</span>
2112

22-
<ul className=" cursor-pointer hover:bg-gray-100 p-3 rounded-lg transition duration-300">
23-
<Link
24-
to="/drugSummary"
25-
26-
>
27-
<span className=" text-black font-bold ">
13+
<div className="mt-1 font-satoshi text-sm text-gray-400">
14+
Medication recommendations based on symptoms and medical history.
15+
</div>
16+
</ul>
17+
</Link>
2818

29-
Medication Summary and Comparison
30-
</span>
31-
<div className="text-sm font-satoshi mt-1 text-gray-400">Streamline drug documentation analysis.</div>
32-
</Link>
33-
</ul>
19+
<Link to="/drugSummary">
20+
<ul className=" cursor-pointer rounded-lg p-3 transition duration-300 hover:bg-gray-100">
21+
<span className=" font-bold text-black ">
22+
Medication Summary and Comparison
23+
</span>
24+
<div className="mt-1 font-satoshi text-sm text-gray-400">
25+
Streamline drug documentation analysis.
26+
</div>
27+
</ul>
28+
</Link>
3429

3530
{/* <div
3631
className="mr-9 text-black hover:border-b-2 hover:border-blue-600 hover:text-black hover:no-underline"

frontend/src/components/Header/chat.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.input_chat {
2-
@apply w-full rounded-lg bg-white px-2 py-2 pl-3 font-semibold text-black text-slate-400 placeholder-gray-500 shadow-sm ring-1 hover:ring-slate-300 focus:outline-none focus:ring-2 focus:ring-sky-500 dark:bg-slate-800 dark:text-slate-300 dark:ring-0 dark:hover:bg-slate-700;
2+
@apply rounded-md text-sm bg-white px-2 py-2 pl-3 font-semibold text-black text-slate-400 placeholder-gray-500 shadow-sm ring-1 hover:ring-slate-300 focus:outline-none focus:ring-2 focus:ring-sky-500 dark:bg-slate-800 dark:text-slate-300 dark:ring-0 dark:hover:bg-slate-700;
33
}
44

55
.show_chat {
6-
@apply h-[100%] w-[100%] rounded-lg bg-white text-slate-400 shadow-sm ring-1 hover:ring-slate-300 focus:outline-none focus:ring-2 focus:ring-sky-500 dark:bg-slate-800 dark:text-slate-300 dark:ring-0 dark:hover:bg-slate-700 md:h-[70%] md:w-[25%];
6+
@apply h-[100%] w-[100%] rounded-lg bg-white shadow-sm ring-1 hover:ring-slate-300 focus:outline-none focus:ring-2 focus:ring-sky-500 dark:bg-slate-800 dark:text-slate-300 dark:ring-0 dark:hover:bg-slate-700 md:h-[70%] md:w-[25%];
77
}
88

99
.inside_chat {
10-
@apply rounded-b-lg bg-white text-slate-400 shadow-sm ring-1 hover:ring-slate-300 focus:outline-none focus:ring-2 focus:ring-sky-500 dark:bg-slate-800 dark:text-slate-300 dark:ring-0 dark:hover:bg-slate-700;
10+
@apply rounded-b-lg bg-white shadow-sm ring-1 hover:ring-slate-300 focus:outline-none focus:ring-2 focus:ring-sky-500 dark:bg-slate-800 dark:text-slate-300 dark:ring-0 dark:hover:bg-slate-700;
1111
}
1212
.circle {
1313
border-radius: 50%;

frontend/src/pages/DrugSummary/DrugSummary.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import Welcome from "../../components/Welcome/Welcome.tsx";
33
import Layout from "../Layout/Layout";
44

55
function DrugLookup() {
6-
return (
7-
<Layout>
8-
<Welcome
9-
subHeader="Drug Summary"
10-
descriptionText="Get a condensed summary for a clinical drug trial and/or study."
11-
/>
12-
<DrugSummaryForm />
13-
</Layout>
14-
);
6+
return (
7+
<Layout>
8+
<div className="py-20"></div>
9+
<Welcome
10+
subHeader="Drug Summary"
11+
descriptionText="Get a condensed summary for a clinical drug trial and/or study."
12+
/>
13+
<DrugSummaryForm/>
14+
</Layout>
15+
);
1516
}
1617

1718
export default DrugLookup;

0 commit comments

Comments
 (0)