Skip to content

Commit

Permalink
Theme
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 2, 2023
1 parent 12e152b commit b83d00f
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 40 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 30 additions & 16 deletions apps/dashboard/src/components/modals/overview-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ import { Button } from "@midday/ui/button";
import { cn } from "@midday/ui/utils";
import Image from "next/image";
import Link from "next/link";
import { useState } from "react";
import { Fragment, useState } from "react";
import OverViewScreenOneLight from "./overview-1-light.png";
import OverViewScreenOne from "./overview-1.png";
import OverViewScreenTwoLight from "./overview-2-light.png";
import OverViewScreenTwo from "./overview-2.png";

const images = [
{ id: 1, src: OverViewScreenOne },
{ id: 2, src: OverViewScreenTwo },
{ id: 1, src: OverViewScreenOne, src2: OverViewScreenOneLight },
{ id: 2, src: OverViewScreenTwo, src2: OverViewScreenTwoLight },
];

export function OverviewModal() {
const [activeId, setActive] = useState(1);

return (
<div
className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-xl p-px shadow-lg text-primary rounded-lg z-50 "
className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-xl border dark:border-none dark:p-px text-primary rounded-lg z-50"
style={{
background:
"linear-gradient(-45deg, rgba(235,248,255,.18) 0%, #727d8b 50%, rgba(235,248,255,.18) 100%)",
Expand All @@ -39,17 +41,29 @@ export function OverviewModal() {

<div className="pb-8 relative h-[272px]">
{images.map((image) => (
<Image
key={image.id}
src={image.src}
width={486}
height={251}
alt="Overview"
className={cn(
"w-full opacity-0 absolute transition-all",
image.id === activeId && "opacity-1"
)}
/>
<Fragment key={image.id}>
<Image
src={image.src}
width={486}
height={251}
alt="Overview"
className={cn(
"w-full opacity-0 absolute transition-all hidden dark:block",
image.id === activeId && "opacity-1"
)}
/>

<Image
src={image.src2}
width={486}
height={251}
alt="Overview"
className={cn(
"w-full opacity-0 absolute transition-all block dark:hidden",
image.id === activeId && "opacity-1"
)}
/>
</Fragment>
))}
</div>

Expand All @@ -62,7 +76,7 @@ export function OverviewModal() {
onClick={() => setActive(image.id)}
key={image.id}
className={cn(
"w-[16px] h-[6px] rounded-full bg-[#D9D9D9] opacity-30 transition-all cursor-pointer",
"w-[16px] h-[6px] rounded-full bg-[#1D1D1D] dark:bg-[#D9D9D9] opacity-30 transition-all cursor-pointer",
image.id === activeId && "opacity-1"
)}
/>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 30 additions & 16 deletions apps/dashboard/src/components/modals/transactions-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ import { Button } from "@midday/ui/button";
import { cn } from "@midday/ui/utils";
import Image from "next/image";
import Link from "next/link";
import { useState } from "react";
import { Fragment, useState } from "react";
import TransactionsScreenOneLight from "./transactions-1-light.png";
import TransactionsScreenOne from "./transactions-1.png";
import TransactionsScreenTwoLight from "./transactions-2-light.png";
import TransactionsScreenTwo from "./transactions-2.png";

const images = [
{ id: 1, src: TransactionsScreenOne },
{ id: 2, src: TransactionsScreenTwo },
{ id: 1, src: TransactionsScreenOne, src2: TransactionsScreenOneLight },
{ id: 2, src: TransactionsScreenTwo, src2: TransactionsScreenTwoLight },
];

export function TransactionsModal() {
const [activeId, setActive] = useState(1);

return (
<div
className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-xl p-px shadow-lg text-primary rounded-lg z-50 "
className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-xl border dark:border-none dark:p-px text-primary rounded-lg z-50"
style={{
background:
"linear-gradient(-45deg, rgba(235,248,255,.18) 0%, #727d8b 50%, rgba(235,248,255,.18) 100%)",
Expand All @@ -39,17 +41,29 @@ export function TransactionsModal() {

<div className="pb-8 relative h-[272px]">
{images.map((image) => (
<Image
key={image.id}
src={image.src}
width={486}
height={251}
alt="Overview"
className={cn(
"w-full opacity-0 absolute transition-all",
image.id === activeId && "opacity-1"
)}
/>
<Fragment key={image.id}>
<Image
src={image.src}
width={486}
height={251}
alt="Overview"
className={cn(
"w-full opacity-0 absolute transition-all hidden dark:block",
image.id === activeId && "opacity-1"
)}
/>

<Image
src={image.src2}
width={486}
height={251}
alt="Overview"
className={cn(
"w-full opacity-0 absolute transition-all block dark:hidden",
image.id === activeId && "opacity-1"
)}
/>
</Fragment>
))}
</div>

Expand All @@ -62,7 +76,7 @@ export function TransactionsModal() {
onClick={() => setActive(image.id)}
key={image.id}
className={cn(
"w-[16px] h-[6px] rounded-full bg-[#D9D9D9] opacity-30 transition-all cursor-pointer",
"w-[16px] h-[6px] rounded-full bg-[#1D1D1D] dark:bg-[#D9D9D9] opacity-30 transition-all cursor-pointer",
image.id === activeId && "opacity-1"
)}
/>
Expand Down
12 changes: 6 additions & 6 deletions packages/ui/src/components/alert-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AlertDialogOverlay = React.forwardRef<
<AlertDialogPrimitive.Overlay
className={cn(
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className,
className
)}
{...props}
ref={ref}
Expand All @@ -35,8 +35,8 @@ const AlertDialogContent = React.forwardRef<
<AlertDialogPrimitive.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 md:w-full",
className,
"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 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 md:w-full",
className
)}
{...props}
/>
Expand All @@ -51,7 +51,7 @@ const AlertDialogHeader = ({
<div
className={cn(
"flex flex-col space-y-2 text-center sm:text-left",
className,
className
)}
{...props}
/>
Expand All @@ -65,7 +65,7 @@ const AlertDialogFooter = ({
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
className,
className
)}
{...props}
/>
Expand Down Expand Up @@ -118,7 +118,7 @@ const AlertDialogCancel = React.forwardRef<
className={cn(
buttonVariants({ variant: "outline" }),
"mt-2 sm:mt-0",
className,
className
)}
{...props}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DialogContent = React.forwardRef<
<DialogOverlay />
<DialogPrimitive.Content
ref={ref}
className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-xl p-px shadow-lg text-primary rounded-2xl z-50 "
className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-xl border dark:border-none dark:p-px text-primary rounded-lg z-50"
style={{
background:
"linear-gradient(-45deg, rgba(235,248,255,.18) 0%, #727d8b 50%, rgba(235,248,255,.18) 100%)",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
--border: 48, 13%, 84%;
--input: 240 5.9% 90%;
--ring: 240 5.9% 10%;
--radius: 0.5rem;
Expand Down

0 comments on commit b83d00f

Please sign in to comment.