Skip to content

Commit

Permalink
dialog styles
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmcadam committed Aug 2, 2024
1 parent 741eedf commit 289549c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
23 changes: 5 additions & 18 deletions src/components/quiz-button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import * as React from "react";
import { Button } from "@/components/ui/button";
import {
Expand All @@ -11,22 +9,9 @@ import {
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import { cn } from "@/lib/utils";
import { DialogClose } from "@radix-ui/react-dialog";
import { Quiz } from "./quiz";

type Option = {
display: string;
value: string;
isRejection: boolean;
};

type Question = {
question: string;
type: string;
options: Option[];
};

export function QuizButton() {
return (
<Dialog>
Expand All @@ -35,10 +20,12 @@ export function QuizButton() {
Take the quiz
</Button>
</DialogTrigger>
<DialogContent className="max-w-full h-full">
<DialogContent>
<DialogHeader>
<DialogTitle>Is Manual Right For You?</DialogTitle>
<DialogDescription>
<DialogTitle className="text-brand">
Is Manual Right For You?
</DialogTitle>
<DialogDescription className="text-brand">
Help us provide you with the best possible care by answering a few
quick questions.
</DialogDescription>
Expand Down
2 changes: 1 addition & 1 deletion src/components/quiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function Quiz() {
const visitorIsRejected = Object.values(chosenOptions).some((o) => o === -1);

return (
<div className="py-4">
<div className="p-4 flex-grow">
{visitorIsRejected ? (
<h3>You&apos;re not eligible for treatment</h3>
) : currentIndex === questions.length ? (
Expand Down
8 changes: 4 additions & 4 deletions src/components/ui/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const DialogOverlay = React.forwardRef<
<DialogPrimitive.Overlay
ref={ref}
className={cn(
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
"fixed inset-0 z-50 bg-brand/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className,
)}
{...props}
Expand All @@ -38,7 +38,7 @@ const DialogContent = React.forwardRef<
<DialogPrimitive.Content
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
"fixed left-[50%] top-[50%] z-50 flex flex-col w-full max-w-full h-full translate-x-[-50%] translate-y-[-50%] bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
className,
)}
{...props}
Expand All @@ -59,7 +59,7 @@ const DialogHeader = ({
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn(
"flex flex-col space-y-1.5 text-center sm:text-left",
"flex flex-col space-y-1.5 text-center sm:text-left bg-brand/10 p-4",
className,
)}
{...props}
Expand All @@ -73,7 +73,7 @@ const DialogFooter = ({
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-4 border-t",
className,
)}
{...props}
Expand Down

0 comments on commit 289549c

Please sign in to comment.