add dark styles to modal
This commit is contained in:
parent
ebe737bc99
commit
e06af3e570
5 changed files with 16 additions and 11 deletions
|
|
@ -11,11 +11,11 @@ export const Button: React.FC<{
|
||||||
secondary:
|
secondary:
|
||||||
"hover:bg-blue-500 transition-colors hover:text-white dark:hover:bg-blue-900/50",
|
"hover:bg-blue-500 transition-colors hover:text-white dark:hover:bg-blue-900/50",
|
||||||
danger:
|
danger:
|
||||||
"bg-red-400 text-white border-green-50 hover:border-red-700 hover:bg-red-600 dark:bg-red-800 dark:border-none",
|
"bg-red-400 text-white border-green-50 hover:border-red-700 hover:bg-red-600 dark:bg-red-800 dark:border-none dark:hover:bg-red-900",
|
||||||
primary:
|
primary:
|
||||||
"bg-blue-600 text-white hover:bg-blue-800 disabled:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-300 dark:border-none",
|
"bg-blue-600 text-white hover:bg-blue-800 disabled:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-300 dark:border-none",
|
||||||
cancel:
|
cancel:
|
||||||
"hover:bg-slate-200 dark:bg-slate-200 dark:hover:bg-slate-400 dark:border-none",
|
"hover:bg-slate-200 dark:bg-slate-600 dark:hover:bg-slate-700 dark:border-none",
|
||||||
none: "",
|
none: "",
|
||||||
}[variant ?? "secondary"];
|
}[variant ?? "secondary"];
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export const FormInput: React.FC<{
|
||||||
<input
|
<input
|
||||||
autoFocus={autoFocus}
|
autoFocus={autoFocus}
|
||||||
type={inputType}
|
type={inputType}
|
||||||
className="block border rounded bg-transparent py-1.5 pl-2 text-gray-800 focus:ring-0 sm:text-sm sm:leading-6"
|
className="block border rounded bg-transparent py-1.5 pl-2 text-gray-800 focus:ring-0 sm:text-sm sm:leading-6 dark:text-slate-300"
|
||||||
id={name}
|
id={name}
|
||||||
name={name}
|
name={name}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ export const DeleteTorrentModal: React.FC<{
|
||||||
return (
|
return (
|
||||||
<Modal isOpen={show} onClose={onHide} title="Delete torrent">
|
<Modal isOpen={show} onClose={onHide} title="Delete torrent">
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
<p className="text-gray-700">
|
<p className="text-gray-700 dark:text-slate-300">
|
||||||
Are you sure you want to delete the torrent?
|
Are you sure you want to delete the torrent?
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -65,7 +65,10 @@ export const DeleteTorrentModal: React.FC<{
|
||||||
checked={deleteFiles}
|
checked={deleteFiles}
|
||||||
placeholder="Also delete files"
|
placeholder="Also delete files"
|
||||||
/>
|
/>
|
||||||
<label htmlFor="deleteFiles" className="ml-2 text-gray-700">
|
<label
|
||||||
|
htmlFor="deleteFiles"
|
||||||
|
className="ml-2 text-gray-700 dark:text-slate-300"
|
||||||
|
>
|
||||||
Also delete files
|
Also delete files
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ const ModalHeader: React.FC<{
|
||||||
title: string;
|
title: string;
|
||||||
}> = ({ onClose, title }) => {
|
}> = ({ onClose, title }) => {
|
||||||
return (
|
return (
|
||||||
<div className="flex p-3 justify-between items-center border-b">
|
<div className="flex p-3 justify-between items-center border-b dark:border-slate-600">
|
||||||
<h2 className="text-xl font-semibold">{title}</h2>
|
<h2 className="text-xl font-semibold dark:slate-300">{title}</h2>
|
||||||
{onClose && (
|
{onClose && (
|
||||||
<button
|
<button
|
||||||
className="text-gray-500 hover:text-gray-700"
|
className="text-gray-500 hover:text-gray-700"
|
||||||
|
|
@ -39,17 +39,19 @@ export const Modal: React.FC<ModalProps> = ({
|
||||||
className,
|
className,
|
||||||
}) => {
|
}) => {
|
||||||
const renderBackdrop = () => {
|
const renderBackdrop = () => {
|
||||||
return <div className="fixed inset-0 bg-black/30 z-[300]"></div>;
|
return (
|
||||||
|
<div className="fixed inset-0 bg-black/30 z-[300] dark:bg-black/60"></div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<RestartModal
|
<RestartModal
|
||||||
show={isOpen}
|
show={isOpen}
|
||||||
onHide={onClose}
|
onHide={onClose}
|
||||||
renderBackdrop={renderBackdrop}
|
renderBackdrop={renderBackdrop}
|
||||||
className={`fixed z-[301] top-0 left-0 w-full h-full block overflow-x-hidden overflow-y-auto`}
|
className="fixed z-[301] top-0 left-0 w-full h-full block overflow-x-hidden overflow-y-auto"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`bg-white shadow-lg my-8 mx-auto max-w-2xl rounded ${className}`}
|
className={`bg-white shadow-lg my-8 mx-auto max-w-2xl rounded ${className} dark:bg-slate-800`}
|
||||||
>
|
>
|
||||||
<ModalHeader onClose={onClose} title={title} />
|
<ModalHeader onClose={onClose} title={title} />
|
||||||
{children}
|
{children}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
|
|
||||||
export const ModalBody = ({ children }: { children: ReactNode }) => {
|
export const ModalBody = ({ children }: { children: ReactNode }) => {
|
||||||
return <div className="p-3 border-b">{children}</div>;
|
return <div className="p-3 border-b dark:border-slate-500">{children}</div>;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue