Skip to content

Commit

Permalink
initial dark mode support
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 23, 2024
1 parent 8f46c38 commit 377f9f4
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from "next/link"
export const Header = () => {
return (
<div style={{ padding: 20 }}>
<h1 className="text-center text-3xl text-gray-700 mb-4">
<h1 className="text-center text-3xl text-gray-700 dark:text-gray-200 mb-4">
Comfy Workflows CI/CD
</h1>
<div className="flex justify-center gap-4">
Expand Down
4 changes: 2 additions & 2 deletions components/LongTextPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ const LongTextPreview = ({ text, previewLines = 1 }) => {
const preview = lines.slice(0, previewLines).join('\n');

return (
<div className="border rounded-md p-2 bg-gray-50">
<div className="border rounded-md p-2 bg-gray-50 dark:bg-gray-900">
<pre className="whitespace-pre-wrap break-words">
{isExpanded ? text : preview}
{lines.length > previewLines && !isExpanded && '...'}
</pre>
{lines.length > previewLines && (
<button
onClick={() => setIsExpanded(!isExpanded)}
className="mt-2 text-blue-600 hover:text-blue-800 underline"
className="mt-2 text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-600 underline"
>
{isExpanded ? 'Show Less' : 'Show More'}
</button>
Expand Down
1 change: 0 additions & 1 deletion components/StatusButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Tooltip } from 'flowbite-react';
import { useRouter } from 'next/router';

interface OSStatusButtonProps {
text: string;
Expand Down
5 changes: 5 additions & 0 deletions components/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React, { useEffect } from 'react';
import Head from 'next/head'
import { ThemeModeScript } from 'flowbite-react'
import { Header } from './Header'
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

export default function Layout({ children }: React.PropsWithChildren) {
useEffect(() => {
document.body.classList.add('dark');
document.body.classList.add('dark:bg-gray-900');
}, []);
return (
<>
<Head>
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function GitCommitsList() {
}, [router.query.repo]);

return (
<div style={{ padding: 20 }}>
<div style={{ padding: 20 }} className="dark:text-white">
<h3>Filters</h3>
<div className="flex items-center gap-2 mb-4">
<Badge href={`https://github.com/${repoFilter}`}>
Expand Down
2 changes: 1 addition & 1 deletion pages/waterfall/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function GitCommitsList() {


return (
<div style={{ padding: 20 }}>
<div style={{ padding: 20 }} className="dark:text-white">
<h3>Filters</h3>
<div className="flex items-center gap-2 mb-4">
<Badge href={`https://github.com/${repoFilter}`}>
Expand Down
4 changes: 2 additions & 2 deletions pages/workflow/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function WorkflowResultDetail() {

return (
<div className="space-y-6 p-10">
<div className="bg-white shadow rounded-lg p-4">
<div className="bg-white dark:bg-gray-900 shadow rounded-lg p-4">
<div className="flex flex-col items-center justify-center sm:flex-row gap-2">
<div>
{workflowResult?.storage_file?.public_url && (
Expand Down Expand Up @@ -148,7 +148,7 @@ function WorkflowResultDetail() {
</Table>
</Card>

<Card>
<Card className="text-black dark:text-white">
<h5 className="text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
Machine Stats
</h5>
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('tailwindcss').Config} */

module.exports = {
darkMode: 'media',
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
Expand Down

0 comments on commit 377f9f4

Please sign in to comment.