Skip to content

Commit

Permalink
ui
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Aug 16, 2024
1 parent efdcdf2 commit 57706b9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"axios": "^1.7.3",
"clsx": "^2.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
Expand Down
9 changes: 9 additions & 0 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions frontend/src/app/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ function Home() {
<h3 className="mt-4 text-2xl font-medium">Logged in as</h3>
<p className="mt-1">{credentials.email}</p>
<Button onClick={handleSignout}>Logout</Button>
<div className="flex w-[80%] space-x-4">
<div className="flex w-[80%] flex-col md:flex-row md:space-x-4">
{SERVICES_URL.map((url, idx) => (
<Button key={url} onClick={() => window.open(url, "_blank")}>
<Button
className="w-full"
key={url}
onClick={() => window.open(url, "_blank")}
>
Service {idx + 1}
</Button>
))}
Expand All @@ -64,7 +68,7 @@ function Home() {

return (
<div className="flex h-screen w-screen items-center justify-center bg-gray-300">
<div className="flex h-[45vh] w-[60vw] flex-col items-center justify-center rounded-xl bg-white px-8 py-[10vh] drop-shadow-xl md:w-[40vw] xl:w-[30vw] 2xl:w-[20vw]">
<div className="flex h-[60vh] w-[80vw] flex-col items-center justify-center rounded-xl bg-white px-8 py-[10vh] drop-shadow-xl md:h-[45vh] md:w-[40vw] xl:w-[30vw] 2xl:w-[20vw]">
<h1 className="text-4xl font-bold">SSO Login</h1>
{SSOLoginStatus()}
{loading && <p className="mt-4 text-gray-500">Loading...</p>}
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import clsx from "clsx";
import { FC, ReactNode } from "react";

interface ButtonProps {
children: ReactNode;
className?: string;
onClick: () => void;
}

export const Button: FC<ButtonProps> = ({ children, onClick }) => {
export const Button: FC<ButtonProps> = ({ children, className, onClick }) => {
return (
<button
onClick={onClick}
className="mt-8 flex w-[80%] items-center justify-center rounded-lg border border-gray-300 py-2 text-lg text-gray-600 duration-300 ease-in-out hover:bg-slate-100"
className={clsx(
"mt-8 flex w-[80%] items-center justify-center rounded-lg border border-gray-300 py-2 text-lg text-gray-600 duration-300 ease-in-out hover:bg-slate-100",
className
)}
>
{children}
</button>
Expand Down

0 comments on commit 57706b9

Please sign in to comment.