From 6db17950a9aa5507c31319b6dbf72091fedafdcc Mon Sep 17 00:00:00 2001 From: Evandro Ribeiro Date: Sat, 22 Jul 2023 15:32:23 -0300 Subject: [PATCH 1/4] fix: fixing skipped database file name --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1bf93f6..5a94625 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,5 @@ yarn-error.log* next-env.d.ts # sqlite -prisma/dev.db* +prisma/db.dev frontin.csv From 9fdc0cf678bb89c7213f1c8294c54a05f363b1a5 Mon Sep 17 00:00:00 2001 From: Evandro Ribeiro Date: Sat, 22 Jul 2023 15:34:42 -0300 Subject: [PATCH 2/4] fix: fixing class order in tailwind --- src/components/table/table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/table/table.tsx b/src/components/table/table.tsx index 10f65ec..64ced14 100644 --- a/src/components/table/table.tsx +++ b/src/components/table/table.tsx @@ -77,7 +77,7 @@ const TableCell = React.forwardRef< Date: Sun, 23 Jul 2023 22:39:33 -0300 Subject: [PATCH 3/4] feat: adding styles when selecting a winner --- src/app/events/[event]/participants/page.tsx | 66 ++++++++++--------- src/components/rounds-list/final-round.tsx | 9 +++ src/components/rounds-list/index.ts | 1 + .../rounds-list/participant-image.tsx | 13 ++-- .../rounds-list/participant-item.tsx | 6 +- .../rounds-list/participant-name.tsx | 2 +- .../rounds-list/participants-list.tsx | 6 +- tailwind.config.js | 1 + 8 files changed, 61 insertions(+), 43 deletions(-) create mode 100644 src/components/rounds-list/final-round.tsx diff --git a/src/app/events/[event]/participants/page.tsx b/src/app/events/[event]/participants/page.tsx index ee3aadb..fb4214e 100644 --- a/src/app/events/[event]/participants/page.tsx +++ b/src/app/events/[event]/participants/page.tsx @@ -1,6 +1,7 @@ "use client" import { + FinalRound, ParticipantImage, ParticipantItem, ParticipantName, @@ -11,6 +12,8 @@ import { } from "@/components" import { EventProps, Round } from "@/shared/types" import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query" +import { RefreshCcw, ThumbsUp } from "lucide-react" + import { getSelectedParticipants, selectNewRandomPlayer, @@ -106,35 +109,36 @@ export default function Participants({ params }: EventProps) { {round.participants.map((participant, index) => ( - - {participant.name} - -

+

-

-

+ + -

+
+ + {participant.name}
))}
@@ -142,23 +146,21 @@ export default function Participants({ params }: EventProps) { ))} - - - Final - - {finalRound.participants.map((participant, index) => ( - - - {participant.name} - - ))} - - - + + Final + + {finalRound.participants.map((participant, index) => ( + + + {participant.name} + + ))} + + ) } diff --git a/src/components/rounds-list/final-round.tsx b/src/components/rounds-list/final-round.tsx new file mode 100644 index 0000000..0d71189 --- /dev/null +++ b/src/components/rounds-list/final-round.tsx @@ -0,0 +1,9 @@ +import { PropsWithChildren } from "react" + +export function FinalRound({ children }: PropsWithChildren) { + return ( +
+
{children}
+
+ ) +} diff --git a/src/components/rounds-list/index.ts b/src/components/rounds-list/index.ts index 9e42e7d..2e1a411 100644 --- a/src/components/rounds-list/index.ts +++ b/src/components/rounds-list/index.ts @@ -5,3 +5,4 @@ export * from "./participants-list" export * from "./participant-item" export * from "./participant-image" export * from "./participant-name" +export * from "./final-round" diff --git a/src/components/rounds-list/participant-image.tsx b/src/components/rounds-list/participant-image.tsx index 0708049..6cc3265 100644 --- a/src/components/rounds-list/participant-image.tsx +++ b/src/components/rounds-list/participant-image.tsx @@ -1,4 +1,5 @@ import Image from "next/image" +import { RefreshCcw, ThumbsUp } from "lucide-react" type ParticipantImageProps = { src: string @@ -9,20 +10,16 @@ type ParticipantImageProps = { const afterClasses = " after:content-[''] after:h-[1px] after:width-1/2 after:right-1 after:w-full after:bg-primary-100 after:absolute after:top-1/2 relative after:translate-x-1/2 after:left-1/2" -export function ParticipantImage({ - src, - alt, - lined, -}: ParticipantImageProps) { +export function ParticipantImage({ src, alt, lined }: ParticipantImageProps) { return ( -
-
+
+
{alt}
diff --git a/src/components/rounds-list/participant-item.tsx b/src/components/rounds-list/participant-item.tsx index 921460f..857b5f8 100644 --- a/src/components/rounds-list/participant-item.tsx +++ b/src/components/rounds-list/participant-item.tsx @@ -1,5 +1,9 @@ import { PropsWithChildren } from "react" export function ParticipantItem({ children }: PropsWithChildren) { - return
  • {children}
  • + return ( +
  • + {children} +
  • + ) } diff --git a/src/components/rounds-list/participant-name.tsx b/src/components/rounds-list/participant-name.tsx index 2f85db2..1acc366 100644 --- a/src/components/rounds-list/participant-name.tsx +++ b/src/components/rounds-list/participant-name.tsx @@ -2,7 +2,7 @@ import { PropsWithChildren } from "react" export function ParticipantName({ children }: PropsWithChildren) { return ( - + {children} ) diff --git a/src/components/rounds-list/participants-list.tsx b/src/components/rounds-list/participants-list.tsx index aa54b53..084f2ae 100644 --- a/src/components/rounds-list/participants-list.tsx +++ b/src/components/rounds-list/participants-list.tsx @@ -1,5 +1,9 @@ import { PropsWithChildren } from "react" export function ParticipantsList({ children }: PropsWithChildren) { - return
      {children}
    + return ( +
      + {children} +
    + ) } diff --git a/tailwind.config.js b/tailwind.config.js index 97a0b3d..3e67dbf 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,4 +1,5 @@ const radiusAndSpacing = { + 0: "0", 1: "8px", 1.5: "12px", 2: "16px", From ab87575467a4d762f79cf299f095479dae1ce093 Mon Sep 17 00:00:00 2001 From: Evandro Ribeiro Date: Mon, 24 Jul 2023 18:45:21 -0300 Subject: [PATCH 4/4] fix: rename database file and update gitignore --- .env.example | 2 +- .gitignore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 527575b..43f4d1a 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -DATABASE_URL=file:./db.dev +DATABASE_URL=file:./dev.db diff --git a/.gitignore b/.gitignore index 5a94625..1bf93f6 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,5 @@ yarn-error.log* next-env.d.ts # sqlite -prisma/db.dev +prisma/dev.db* frontin.csv