From 90a7eb5b32887a3c41fd906d10dc9108eb22b2e0 Mon Sep 17 00:00:00 2001 From: Dispatcharr Date: Sat, 8 Mar 2025 09:10:26 -0600 Subject: [PATCH] Updated theme.js to use tailwind colors Updated theme.js to use tailwind colors. Updated ChannelsTable to use theme.js --- .../src/components/tables/ChannelsTable.js | 365 ++++++++---------- frontend/src/theme.js | 69 ++-- 2 files changed, 208 insertions(+), 226 deletions(-) diff --git a/frontend/src/components/tables/ChannelsTable.js b/frontend/src/components/tables/ChannelsTable.js index 9c88b188..23bfbe08 100644 --- a/frontend/src/components/tables/ChannelsTable.js +++ b/frontend/src/components/tables/ChannelsTable.js @@ -1,5 +1,4 @@ // src/components/tables/ChannelsTable.js - import React, { useEffect, useMemo, useRef, useState } from 'react'; import { Box, @@ -13,27 +12,26 @@ import { Autocomplete, InputAdornment, Paper, - Grid as Grid2, } from '@mui/material'; +import Grid2 from '@mui/material/Grid'; import { Add as AddIcon, Delete as DeleteIcon, - SwapVert as SwapVertIcon, - Tv as TvIcon, LiveTv as LiveTvIcon, Edit as EditIcon, Clear as ClearIcon, ContentCopy, - Computer as ComputerIcon, - Description as DescriptionIcon, - Hd as HdIcon, IndeterminateCheckBox, CompareArrows, Code, AddBox, + Hd as HdIcon, } from '@mui/icons-material'; import { MaterialReactTable, useMaterialReactTable } from 'material-react-table'; -import { styled } from '@mui/material/styles'; +import { styled, useTheme } from '@mui/material/styles'; + +// Lucide icons +import { Tv2, ScreenShare, Scroll } from 'lucide-react'; import ChannelForm from '../forms/Channel'; import useChannelsStore from '../../store/channels'; @@ -132,69 +130,11 @@ const ChannelStreams = ({ channel, isExpanded }) => { }; /* ----------------------------------------------------------- - 2) Custom-styled "chip" buttons for HDHR, M3U, EPG ------------------------------------------------------------- */ -const HDHRButton = styled(Button)(() => ({ - border: '1px solid #a3d977', - color: '#a3d977', - backgroundColor: 'transparent', - textTransform: 'none', - fontSize: '0.85rem', - display: 'flex', - alignItems: 'center', - gap: '4px', - padding: '2px 8px', - minWidth: 'auto', - '&:hover': { - borderColor: '#c2e583', - color: '#c2e583', - backgroundColor: 'rgba(163,217,119,0.1)', - }, -})); - -const M3UButton = styled(Button)(() => ({ - border: '1px solid #5f6dc6', - color: '#5f6dc6', - backgroundColor: 'transparent', - textTransform: 'none', - fontSize: '0.85rem', - display: 'flex', - alignItems: 'center', - gap: '4px', - padding: '2px 8px', - minWidth: 'auto', - '&:hover': { - borderColor: '#7f8de6', - color: '#7f8de6', - backgroundColor: 'rgba(95,109,198,0.1)', - }, -})); - -const EPGButton = styled(Button)(() => ({ - border: '1px solid #707070', - color: '#a0a0a0', - backgroundColor: 'transparent', - textTransform: 'none', - fontSize: '0.85rem', - display: 'flex', - alignItems: 'center', - gap: '4px', - padding: '2px 8px', - minWidth: 'auto', - '&:hover': { - borderColor: '#a0a0a0', - color: '#c0c0c0', - backgroundColor: 'rgba(112,112,112,0.1)', - }, -})); - -/* ----------------------------------------------------------- - 3) Main ChannelsTable component + 2) Main ChannelsTable component ------------------------------------------------------------ */ const ChannelsTable = () => { const [channel, setChannel] = useState(null); const [channelModalOpen, setChannelModalOpen] = useState(false); - const [rowSelection, setRowSelection] = useState([]); const [channelGroupOptions, setChannelGroupOptions] = useState([]); const [anchorEl, setAnchorEl] = useState(null); @@ -208,6 +148,8 @@ const ChannelsTable = () => { const rowVirtualizerInstanceRef = useRef(null); const outputUrlRef = useRef(null); + const theme = useTheme(); // Use the theme for colors and fonts + const { showVideo } = useVideoStore(); const { channels, @@ -438,7 +380,6 @@ const ChannelsTable = () => { [channelGroupOptions, filterValues] ); - // Filter data const filteredData = Object.values(channels).filter((row) => columns.every(({ accessorKey }) => filterValues[accessorKey] @@ -526,265 +467,299 @@ const ChannelsTable = () => { ), - // No default MRT top toolbar renderTopToolbar: () => null, enableTopToolbar: false, }); const hasNoData = filteredData.length === 0; - /* ------------------------------------------------------------------ - 4) Return the layout with a Paper "box" around the table - (like your old snippet). We'll also show a "Channels" heading. - ------------------------------------------------------------------- */ return ( - {/* We only need 1 column, so use Grid2 item xs={12} */} - {/* Title above the Paper box */} - {/* Row with "Channels" text, "Links:" label, and HDHR/M3U/EPG chip buttons */} - - {/* "Channels" */} + {/* Header Row */} + Channels - {/* "Links:" */} - - Links: - + + Links: + + - - {/* HDHR chip */} + + {/* HDHR Button */} - {/* M3U chip */} + {/* M3U Button */} - {/* EPG chip */} + {/* EPG Button */} - {/* The Paper box with dark background, rounding, etc. */} - {/* Toolbar row with "Remove/Assign/Auto-match/Add" */} - {/* Right side: "Remove / Assign / Auto-match / Add" */} - {/* Remove */} - - {/* Assign */} - - {/* Auto-match */} - - {/* Add */}