Spaces:
Sleeping
Sleeping
copilot-swe-agent[bot] ArnavSingh76533 commited on
Commit ·
00acb79
1
Parent(s): ce09e2f
Update alert, user, and input components with modern styling
Browse filesCo-authored-by: ArnavSingh76533 <160649079+ArnavSingh76533@users.noreply.github.com>
- components/alert/Alert.tsx +7 -3
- components/input/ControlButton.tsx +1 -1
- components/input/InputClipboardCopy.tsx +3 -3
- components/user/UserItem.tsx +9 -9
- components/user/UserList.tsx +1 -1
- pages/404.tsx +15 -1
components/alert/Alert.tsx
CHANGED
|
@@ -22,13 +22,17 @@ const Alert: FC<AlertProps> = ({
|
|
| 22 |
return (
|
| 23 |
<div
|
| 24 |
className={classNames(
|
| 25 |
-
"rounded bg-dark-800 p-
|
| 26 |
className
|
| 27 |
)}
|
| 28 |
>
|
| 29 |
-
<div className={"flex flex-row gap-
|
| 30 |
{canClose && (
|
| 31 |
-
<Button
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
<IconClose />
|
| 33 |
</Button>
|
| 34 |
)}
|
|
|
|
| 22 |
return (
|
| 23 |
<div
|
| 24 |
className={classNames(
|
| 25 |
+
"rounded-lg bg-dark-800/90 backdrop-blur-sm border border-dark-700/50 p-3 flex gap-2 items-center flex-row justify-between shadow-lg",
|
| 26 |
className
|
| 27 |
)}
|
| 28 |
>
|
| 29 |
+
<div className={"flex flex-row gap-2 items-center"}>{children}</div>
|
| 30 |
{canClose && (
|
| 31 |
+
<Button
|
| 32 |
+
tooltip={"Dismiss"}
|
| 33 |
+
onClick={() => setClosed(true)}
|
| 34 |
+
actionClasses="hover:bg-dark-700 active:bg-dark-600"
|
| 35 |
+
>
|
| 36 |
<IconClose />
|
| 37 |
</Button>
|
| 38 |
)}
|
components/input/ControlButton.tsx
CHANGED
|
@@ -21,7 +21,7 @@ const ControlButton: FC<Props> = ({
|
|
| 21 |
<InteractionHandler
|
| 22 |
tooltip={tooltip}
|
| 23 |
className={classNames(
|
| 24 |
-
"action cursor-pointer rounded p-2 select-none",
|
| 25 |
className
|
| 26 |
)}
|
| 27 |
onClick={(e, touch) => {
|
|
|
|
| 21 |
<InteractionHandler
|
| 22 |
tooltip={tooltip}
|
| 23 |
className={classNames(
|
| 24 |
+
"action cursor-pointer rounded-lg p-2.5 select-none transition-all duration-200",
|
| 25 |
className
|
| 26 |
)}
|
| 27 |
onClick={(e, touch) => {
|
components/input/InputClipboardCopy.tsx
CHANGED
|
@@ -9,10 +9,10 @@ interface Props {
|
|
| 9 |
const InputClipboardCopy: FC<Props> = ({ value, className }) => {
|
| 10 |
return (
|
| 11 |
<div
|
| 12 |
-
className={"rounded flex flex-row items-center bg-dark-900 " + className}
|
| 13 |
>
|
| 14 |
<input
|
| 15 |
-
className={"rounded grow bg-
|
| 16 |
value={value}
|
| 17 |
type={"text"}
|
| 18 |
readOnly={true}
|
|
@@ -23,7 +23,7 @@ const InputClipboardCopy: FC<Props> = ({ value, className }) => {
|
|
| 23 |
/>
|
| 24 |
<button
|
| 25 |
className={
|
| 26 |
-
"
|
| 27 |
}
|
| 28 |
data-tooltip-content={"Click to copy"}
|
| 29 |
type={"button"}
|
|
|
|
| 9 |
const InputClipboardCopy: FC<Props> = ({ value, className }) => {
|
| 10 |
return (
|
| 11 |
<div
|
| 12 |
+
className={"rounded-lg flex flex-row items-center bg-dark-900 border border-dark-700/50 overflow-hidden " + className}
|
| 13 |
>
|
| 14 |
<input
|
| 15 |
+
className={"rounded-l-lg grow bg-transparent p-3 outline-none " + className}
|
| 16 |
value={value}
|
| 17 |
type={"text"}
|
| 18 |
readOnly={true}
|
|
|
|
| 23 |
/>
|
| 24 |
<button
|
| 25 |
className={
|
| 26 |
+
"px-4 py-3 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 flex flex-row items-center gap-2 cursor-copy font-medium transition-all duration-200"
|
| 27 |
}
|
| 28 |
data-tooltip-content={"Click to copy"}
|
| 29 |
type={"button"}
|
components/user/UserItem.tsx
CHANGED
|
@@ -31,11 +31,11 @@ const UserItem: FC<Props> = ({ user, ownerId, socketId, updateName }) => {
|
|
| 31 |
return (
|
| 32 |
<div
|
| 33 |
className={classNames(
|
| 34 |
-
"rounded border-l-4",
|
| 35 |
-
"flex flex-row bg-dark-
|
| 36 |
socketId == user.uid
|
| 37 |
-
? "border-primary-
|
| 38 |
-
: "border-dark-
|
| 39 |
)}
|
| 40 |
>
|
| 41 |
{ownerId == user.uid && (
|
|
@@ -43,7 +43,7 @@ const UserItem: FC<Props> = ({ user, ownerId, socketId, updateName }) => {
|
|
| 43 |
className={"absolute inline-flex -ml-4 -mt-4 p-2 cursor-help"}
|
| 44 |
data-tooltip-content={"Owner of the lobby"}
|
| 45 |
>
|
| 46 |
-
<IconOwner className={"text-primary-
|
| 47 |
</div>
|
| 48 |
)}
|
| 49 |
<div className={"aspect-square shrink-0"}>
|
|
@@ -57,7 +57,7 @@ const UserItem: FC<Props> = ({ user, ownerId, socketId, updateName }) => {
|
|
| 57 |
/>
|
| 58 |
</div>
|
| 59 |
<div
|
| 60 |
-
className={"p-2 pl-
|
| 61 |
onMouseEnter={() => {
|
| 62 |
if (user.uid === socketId) {
|
| 63 |
setEdit(true)
|
|
@@ -78,12 +78,12 @@ const UserItem: FC<Props> = ({ user, ownerId, socketId, updateName }) => {
|
|
| 78 |
/>
|
| 79 |
) : (
|
| 80 |
<>
|
| 81 |
-
<div className={"flex flex-row gap-1 truncate"}>{user.name}</div>
|
| 82 |
-
<div className={"flex flex-row gap-1 items-center"}>
|
| 83 |
{user.player.paused ? (
|
| 84 |
<IconPause sizeClassName={"w-3 h-3"} />
|
| 85 |
) : (
|
| 86 |
-
<IconPlay sizeClassName={"w-3 h-3"} />
|
| 87 |
)}
|
| 88 |
{secondsToTime(user.player.progress)}
|
| 89 |
</div>
|
|
|
|
| 31 |
return (
|
| 32 |
<div
|
| 33 |
className={classNames(
|
| 34 |
+
"rounded-lg border-l-4 overflow-hidden transition-all duration-200",
|
| 35 |
+
"flex flex-row bg-dark-800/50 hover:bg-dark-800 shadow-md",
|
| 36 |
socketId == user.uid
|
| 37 |
+
? "border-primary-600 hover:border-primary-500"
|
| 38 |
+
: "border-dark-700 hover:border-dark-600"
|
| 39 |
)}
|
| 40 |
>
|
| 41 |
{ownerId == user.uid && (
|
|
|
|
| 43 |
className={"absolute inline-flex -ml-4 -mt-4 p-2 cursor-help"}
|
| 44 |
data-tooltip-content={"Owner of the lobby"}
|
| 45 |
>
|
| 46 |
+
<IconOwner className={"text-primary-500"} sizeClassName={"w-5 h-5"} />
|
| 47 |
</div>
|
| 48 |
)}
|
| 49 |
<div className={"aspect-square shrink-0"}>
|
|
|
|
| 57 |
/>
|
| 58 |
</div>
|
| 59 |
<div
|
| 60 |
+
className={"p-2 pl-2 grow"}
|
| 61 |
onMouseEnter={() => {
|
| 62 |
if (user.uid === socketId) {
|
| 63 |
setEdit(true)
|
|
|
|
| 78 |
/>
|
| 79 |
) : (
|
| 80 |
<>
|
| 81 |
+
<div className={"flex flex-row gap-1 truncate font-medium text-dark-200"}>{user.name}</div>
|
| 82 |
+
<div className={"flex flex-row gap-1.5 items-center text-dark-400 text-sm"}>
|
| 83 |
{user.player.paused ? (
|
| 84 |
<IconPause sizeClassName={"w-3 h-3"} />
|
| 85 |
) : (
|
| 86 |
+
<IconPlay sizeClassName={"w-3 h-3 text-primary-500"} />
|
| 87 |
)}
|
| 88 |
{secondsToTime(user.player.progress)}
|
| 89 |
</div>
|
components/user/UserList.tsx
CHANGED
|
@@ -36,7 +36,7 @@ const UserList: FC<Props> = ({ socket }) => {
|
|
| 36 |
return (
|
| 37 |
<div
|
| 38 |
className={
|
| 39 |
-
"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-
|
| 40 |
}
|
| 41 |
>
|
| 42 |
{users.map((user) => (
|
|
|
|
| 36 |
return (
|
| 37 |
<div
|
| 38 |
className={
|
| 39 |
+
"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 gap-2 p-2"
|
| 40 |
}
|
| 41 |
>
|
| 42 |
{users.map((user) => (
|
pages/404.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import Layout from "../components/Layout"
|
|
|
|
| 2 |
|
| 3 |
export default function Error404() {
|
| 4 |
return (
|
|
@@ -9,7 +10,20 @@ export default function Error404() {
|
|
| 9 |
}}
|
| 10 |
error={404}
|
| 11 |
>
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
</Layout>
|
| 14 |
)
|
| 15 |
}
|
|
|
|
| 1 |
import Layout from "../components/Layout"
|
| 2 |
+
import Link from "next/link"
|
| 3 |
|
| 4 |
export default function Error404() {
|
| 5 |
return (
|
|
|
|
| 10 |
}}
|
| 11 |
error={404}
|
| 12 |
>
|
| 13 |
+
<div className="flex flex-col items-center justify-center min-h-[60vh] text-center">
|
| 14 |
+
<h1 className="text-6xl font-bold bg-gradient-to-r from-primary-500 to-accent-500 bg-clip-text text-transparent mb-4">
|
| 15 |
+
404
|
| 16 |
+
</h1>
|
| 17 |
+
<p className="text-xl text-dark-400 mb-6">
|
| 18 |
+
There is nothing to be found here :/
|
| 19 |
+
</p>
|
| 20 |
+
<Link
|
| 21 |
+
href="/"
|
| 22 |
+
className="px-6 py-3 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 rounded-lg font-medium transition-all duration-200 shadow-lg hover:shadow-glow"
|
| 23 |
+
>
|
| 24 |
+
Go Back Home
|
| 25 |
+
</Link>
|
| 26 |
+
</div>
|
| 27 |
</Layout>
|
| 28 |
)
|
| 29 |
}
|