Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions aws/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ phases:
- cd aws/lambda-functions/start_history_search_v2 && zip -qr ../../../start_history_search.zip . && cd -
post_build:
commands:
# - aws lambda update-function-code --function-name PopulateMatchDataV1 --zip-file fileb://populate_match_data.zip
# - aws lambda update-function-code --function-name PopulateMatchDataV2 --zip-file fileb://populate_match_data.zip
# - aws lambda update-function-code --function-name PopulateMatchDataV3 --zip-file fileb://populate_match_data.zip
# - aws lambda update-function-code --function-name PopulateMatchDataV4 --zip-file fileb://populate_match_data.zip
# - aws lambda update-function-code --function-name StartHistorySearch --zip-file fileb://start_history_search.zip
- aws lambda update-function-code --function-name test-lambda --zip-file fileb://start_history_search.zip
- aws lambda update-function-code --function-name PopulateMatchDataV1 --zip-file fileb://populate_match_data.zip
- aws lambda update-function-code --function-name PopulateMatchDataV2 --zip-file fileb://populate_match_data.zip
- aws lambda update-function-code --function-name PopulateMatchDataV3 --zip-file fileb://populate_match_data.zip
- aws lambda update-function-code --function-name PopulateMatchDataV4 --zip-file fileb://populate_match_data.zip
- aws lambda update-function-code --function-name StartHistorySearch --zip-file fileb://start_history_search.zip

# used for testing
# - aws lambda update-function-code --function-name test-lambda --zip-file fileb://start_history_search.zip

artifacts:
files:
Expand Down
5 changes: 5 additions & 0 deletions front-end/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore artifacts:
build
coverage
.next
node_modules/
3 changes: 3 additions & 0 deletions front-end/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["prettier-plugin-tailwindcss"]
}
12 changes: 7 additions & 5 deletions front-end/components/ChatBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ export default function ChatBox() {
};

return (
<div className="w-full max-w-lg mx-auto">
<div className="border rounded-lg p-4 h-96 overflow-y-auto bg-white shadow">
<div className="mx-auto w-full max-w-lg">
<div className="h-96 overflow-y-auto rounded-lg border bg-white p-4 shadow">
{messages.map((msg, idx) => (
<div
key={idx}
className={`my-2 ${
msg.sender === "user" ? "text-right text-blue-600" : "text-left text-gray-700"
msg.sender === "user"
? "text-right text-blue-600"
: "text-left text-gray-700"
}`}
>
<span>{msg.text}</span>
Expand All @@ -44,12 +46,12 @@ export default function ChatBox() {
type="text"
value={input}
onChange={(e) => setInput(e.target.value)}
className="flex-grow border rounded-l-lg px-3 py-2 focus:outline-none"
className="flex-grow rounded-l-lg border px-3 py-2 focus:outline-none"
placeholder="Type your message..."
/>
<button
type="submit"
className="bg-blue-600 text-white px-4 py-2 rounded-r-lg hover:bg-blue-700"
className="rounded-r-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700"
>
Send
</button>
Expand Down
6 changes: 3 additions & 3 deletions front-end/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import Link from "next/link";

export default function Navbar() {
return (
<nav className="bg-dark text-background p-4 flex justify-between items-center">
<nav className="flex items-center justify-between bg-dark p-4 text-background">
<h1 className="text-xl font-semibold">####</h1>
<Link href="/theme-preview" className="text-background hover:underline">
<button className="bg-primary hover:bg-accent text-dark px-4 py-2 rounded-lg">
<button className="rounded-lg bg-primary px-4 py-2 text-dark hover:bg-accent">
Button
</button>
</Link>
</nav>
);
}
}
12 changes: 6 additions & 6 deletions front-end/components/ThemePreview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ const colors = [
export default function ThemePreview() {
return (
<div
className="min-h-screen flex flex-col items-center justify-center p-8"
className="flex min-h-screen flex-col items-center justify-center p-8"
style={{ backgroundColor: "#F4EAEA", color: "#56374E" }}
>
<h1 className="text-3xl font-bold mb-8">Theme Preview</h1>
<h1 className="mb-8 text-3xl font-bold">Theme Preview</h1>

<div className="grid grid-cols-2 sm:grid-cols-4 gap-6">
<div className="grid grid-cols-2 gap-6 sm:grid-cols-4">
{colors.map((c, i) => (
<motion.div
key={i}
className="flex flex-col items-center justify-center p-6 rounded-2xl shadow-lg cursor-pointer transition-transform"
className="flex cursor-pointer flex-col items-center justify-center rounded-2xl p-6 shadow-lg transition-transform"
style={{ backgroundColor: c.hex }}
whileHover={{
scale: 1.15,
Expand All @@ -30,11 +30,11 @@ export default function ThemePreview() {
}}
>
<div
className="w-20 h-20 rounded-xl border border-black/20 mb-3"
className="mb-3 h-20 w-20 rounded-xl border border-black/20"
style={{ backgroundColor: c.hex }}
/>
<p className="font-semibold text-white drop-shadow">{c.name}</p>
<p className="text-sm opacity-80 text-white drop-shadow">{c.hex}</p>
<p className="text-sm text-white opacity-80 drop-shadow">{c.hex}</p>
</motion.div>
))}
</div>
Expand Down
16 changes: 16 additions & 0 deletions front-end/components/classroom/question.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { motion } from "motion/react";

const Question = ({ text }) => {
return (
<motion.div
initial={{ y: 100, opacity: 0 }}
animate={{ y: 0, opacity: 1 }}
transition={{ delay: 2.5 }}
className="w-10/12 rounded-2xl border-2 border-dark bg-background/90 p-10 text-2xl"
>
{text}
</motion.div>
);
};

export default Question;
86 changes: 86 additions & 0 deletions front-end/components/classroom/response.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { motion } from "motion/react";

const Response = ({ questionType, choices, question }) => {
const selectAll = questionType === "selectAll";
const multipleChoice = questionType === "multipleChoice";
const shortAnswer = questionType === "shortAnswer";
return (
<motion.div
initial={{ x: 100, opacity: 0 }}
animate={{ x: 0, opacity: 1 }}
transition={{ delay: 2.5 }}
className="flex w-1/4 flex-col items-center justify-center rounded-2xl border-2 border-dark bg-background/90 p-5 text-2xl"
>
<form>
{multipleChoice && (
<div>
<p> Choose One</p>

{choices.map((item, index) => (
<div
key={index}
className="flex items-center justify-start gap-2"
>
<input type="radio" id={item} value={item} name={question} />{" "}
<label for={item} className="text-start">
{item}
</label>
</div>
))}
<input
type="submit"
className="cursor-pointer"
value="next question"
/>
</div>
)}
{selectAll && (
<div>
<p> Select all that apply</p>

{choices.map((item, index) => (
<div
key={index}
className="flex items-center justify-start gap-2"
>
<input type="checkbox" id={item} value={item} name={question} />{" "}
<label for={item} className="text-start">
{item}
</label>
</div>
))}
<input
type="submit"
className="cursor-pointer"
value="next question"
/>
</div>
)}
{shortAnswer && (
<div>
<p> type your answer</p>

<div className="flex flex-col items-center justify-center gap-2 py-2">
<input
type="text"
id={choices[0]}
name={question}
placeholder={choices[0]}
/>
</div>
<input
type="submit"
className="cursor-pointer"
value="next question"
/>
</div>
)}
{!multipleChoice && !selectAll && !shortAnswer && (
<p>invalid question type</p>
)}
</form>
</motion.div>
);
};

export default Response;
Loading