Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small UI improvements #15

Merged
merged 1 commit into from
Jul 3, 2024
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
10 changes: 5 additions & 5 deletions frontend/app/components/ToggleSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
onToggle,
}) => {
return (
<div className="flex space-x-4 bg-sky-800 p-2 rounded-lg shadow-md">
<div className="flex space-x-4 bg-sky-900 p-2 rounded-lg shadow-md">
<button
className={`px-4 py-2 rounded ${
className={`px-4 py-2 w-[80px] rounded ${
selectedOption === option1
? "bg-white text-sky-900"
: " bg-sky-950 text-white"
: " bg-sky-950 text-white hover:bg-sky-700"
}`}
onClick={() => onToggle(option1)}
>
{option1}
</button>
<button
className={`px-4 py-2 rounded ${
className={`px-4 py-2 w-[80px] rounded ${
selectedOption === option2
? "bg-white text-sky-900"
: " bg-sky-950 text-white"
: " bg-sky-950 text-white hover:bg-sky-700"
}`}
onClick={() => onToggle(option2)}
>
Expand Down
8 changes: 4 additions & 4 deletions frontend/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default function Home() {
</div>

{results.length > 0 && (
<div className="w-full flex justify-center mt-6">
<div className="w-full flex justify-center mt-0">
<ToggleSwitch
option1="Plot"
option2="Table"
Expand All @@ -121,14 +121,14 @@ export default function Home() {
{" "}
{/* Reference to this div */}
{results.length > 0 && view === "Plot" && (
<div className="w-full flex justify-center mt-6">
<div className="w-full flex justify-center mt-0">
<div className="w-full max-w-[1200px] bg-sky-900 p-6 rounded-lg shadow-lg flex flex-col justify-center items-center">
<ScatterPlot results={results} />
</div>
</div>
)}
{results.length > 0 && view === "Table" && (
<div className="w-full flex justify-center mt-6">
<div className="w-full flex justify-center mt-0">
<div className="w-full bg-sky-900 p-6 rounded-lg shadow-lg flex flex-col justify-center items-center">
<SearchResultsTable
results={results}
Expand All @@ -143,7 +143,7 @@ export default function Home() {

<div className="w-full flex justify-center mt-6">
<button
className="w-full max-w-[250px] p-2 border border-sky-700 rounded bg-sky-800 text-white hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-sky-700"
className="w-full max-w-[250px] p-2 border border-sky-700 rounded bg-sky-900 text-white hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-sky-700"
onClick={() => setInfoBoxVisible(!infoBoxVisible)}
>
{infoBoxVisible ? "Hide Info" : "How does this work?"}
Expand Down
Loading