From 43eb05af5a19b006b8e2c648e4ea6cab0c012f3e Mon Sep 17 00:00:00 2001 From: Sean Edmunds Date: Thu, 2 Jan 2025 14:49:09 -0600 Subject: [PATCH] Style fixes --- src/components/DataTable/DataTable.tsx | 39 ++++++++++---- src/components/WeatherModal/HourlyCard.tsx | 17 ++++-- .../WeatherModal/SmallOutlookCard.tsx | 13 ++--- .../WeatherModal/SmallWeatherCard.tsx | 24 +++++---- src/components/WeatherModal/WeatherModal.tsx | 34 ++++++++---- src/dataTableStyles.css | 27 +++++----- .../homepage/components/Header/Header.tsx | 53 ++++++++++--------- src/pages/settings/Settings.tsx | 38 +++++++++---- src/styles/Tabs.module.css | 9 +++- 9 files changed, 165 insertions(+), 89 deletions(-) diff --git a/src/components/DataTable/DataTable.tsx b/src/components/DataTable/DataTable.tsx index e7dd04a..1180815 100644 --- a/src/components/DataTable/DataTable.tsx +++ b/src/components/DataTable/DataTable.tsx @@ -81,7 +81,13 @@ export function DataTableComponent({ showLoadingOverlay: isLoading, isLoading: isLoading, }, - mantinePaperProps: { className: 'root' }, + mantinePaperProps: { + className: 'root', + style: { + height: '75vh', + overflow: 'scroll', + }, + }, renderRowActions: ({ row, table }) => ( ), mantineCreateRowModalProps: { - style: { - color: theme.primaryColor, + styles: { + root: { + color: theme.primaryColor, + }, + content: { + color: theme.primaryColor, + }, }, }, + renderCreateRowModalContent: ({ row }) => undefined, renderTopToolbarCustomActions: ({ table }) => { return ( - + <> + {tableName !== 'Personalization' && ( + + )} + ); }, }); diff --git a/src/components/WeatherModal/HourlyCard.tsx b/src/components/WeatherModal/HourlyCard.tsx index e474bcb..e7e834d 100644 --- a/src/components/WeatherModal/HourlyCard.tsx +++ b/src/components/WeatherModal/HourlyCard.tsx @@ -12,9 +12,9 @@ export enum WindDirection { NW = 315, } -export default function HourlyCard({ weather }: any) { +export default function HourlyCard({ weather, isMobile }: any) { return ( - + - + {new Date(weather.startTime).toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric', @@ -73,11 +73,16 @@ export default function HourlyCard({ weather }: any) { style={{ position: 'absolute', transform: `rotate(${WindDirection[weather.windDirection]}deg)`, + color: 'black', }} /> - + - + {weather.windSpeed} @@ -91,6 +96,7 @@ export default function HourlyCard({ weather }: any) { textAlign: 'center', borderRadius: '4px', background: 'rgba(0, 0, 0, 0.6)', + color: 'white', }} > {weather.temperature}°{weather.temperatureUnit}/{weather.relativeHumidity.value}% @@ -103,6 +109,7 @@ export default function HourlyCard({ weather }: any) { textAlign: 'center', borderRadius: '4px', background: 'rgba(0, 0, 0, 0.6)', + color: 'white', }} > diff --git a/src/components/WeatherModal/SmallOutlookCard.tsx b/src/components/WeatherModal/SmallOutlookCard.tsx index 140998e..fdfc497 100644 --- a/src/components/WeatherModal/SmallOutlookCard.tsx +++ b/src/components/WeatherModal/SmallOutlookCard.tsx @@ -32,25 +32,26 @@ export default function SmallOutlookCard({ weather }: any) { style={{ position: 'absolute', transform: `rotate(${WindDirection[weather.windDirection]}deg)`, + color: 'white', }} /> - + - + {weather.windSpeed} - + Precip: - + {weather.precipitation}% - + {weather.isDayTime ? 'High of:' : 'Low of:'} - + {weather.temperature}°F diff --git a/src/components/WeatherModal/SmallWeatherCard.tsx b/src/components/WeatherModal/SmallWeatherCard.tsx index 10f16df..d9dda59 100644 --- a/src/components/WeatherModal/SmallWeatherCard.tsx +++ b/src/components/WeatherModal/SmallWeatherCard.tsx @@ -14,41 +14,47 @@ export default function SmallWeatherCard({ weather }: any) { /> - + {weather.highTemp}°F/{weather.lowTemp}°F {weather.precipitation !== 'N/A' && ( - - {weather.precipitation} mm + + {weather.precipitation} mm )} {weather.precipitation === 'N/A' && ( - + )}
- +
- + {weather.windSpeed} mph
- + {weather.temperature}°F - + Feels like: {weather.heatIndex}°F - + Humidity: {weather.humidity}% diff --git a/src/components/WeatherModal/WeatherModal.tsx b/src/components/WeatherModal/WeatherModal.tsx index 633cea4..6a22143 100644 --- a/src/components/WeatherModal/WeatherModal.tsx +++ b/src/components/WeatherModal/WeatherModal.tsx @@ -1,4 +1,4 @@ -import { Center, Divider, Group, Modal, Stack } from '@mantine/core'; +import { Box, Center, Divider, Group, Modal, Stack } from '@mantine/core'; import { useAtom } from 'jotai'; import { modalClasses } from 'styles'; import SmallOutlookCard from './SmallOutlookCard'; @@ -17,6 +17,7 @@ export function WeatherModal({ setValue, setProviderLabel, setProviderURL, + isMobile, }: any) { const [theme, _] = useAtom(appTheme); const [hourlyForecast, setHourlyForecast] = useState([]); @@ -42,6 +43,7 @@ export function WeatherModal({ }, [hourlyForecast]); return (
- + -

Currently

+

Currently

- + {outlook.map((o: any) => ( -

{o.name}

+

{o.name}

@@ -102,10 +108,20 @@ export function WeatherModal({ borderRadius: '.5rem', }} > - {hourlyForecast.length > 0 && - hourlyForecast.map((h: any) => { - return ; - })} + + {hourlyForecast.length > 0 && + hourlyForecast.map((h: any) => { + return ; + })} +
diff --git a/src/dataTableStyles.css b/src/dataTableStyles.css index d955f38..08e4ea1 100644 --- a/src/dataTableStyles.css +++ b/src/dataTableStyles.css @@ -1,16 +1,16 @@ .root { --mrt-base-background-color: var(--color-background); - --mrt-striped-row-background-color: var(); - --mrt-row-hover-background-color: var(); - --mrt-striped-row-hover-background-color: var(); - --mrt-selected-row-background-color: var(); - --mrt-selected-row-hover-background-color: var(); - --mrt-pinned-row-background-color: var(); - --mrt-pinned-row-hover-background-color: var(); - --mrt-pinned-column-background-color: var(); - --mrt-dragging-hovered-border-color: var(); - --mrt-dragging-drag-border-color: var(); - --mrt-resize-column-border-color: var(); + --mrt-striped-row-background-color: var(--color-background); + --mrt-row-hover-background-color: var(--color-background); + --mrt-striped-row-hover-background-color: var(--color-background); + --mrt-selected-row-background-color: var(--color-text-pri); + --mrt-selected-row-hover-background-color: var(--color-background); + --mrt-pinned-row-background-color: var(--color-background); + --mrt-pinned-row-hover-background-color: var(--color-background); + --mrt-pinned-column-background-color: var(--color-background); + --mrt-dragging-hovered-border-color: var(--color-background); + --mrt-dragging-drag-border-color: var(--color-background); + --mrt-resize-column-border-color: var(--color-background); color: var(--color-text-pri) !important; } @@ -26,6 +26,7 @@ color: var(--color-text-pri) !important; } -.mantine-Select-option { - color: var(--color-text-pri) !important; +.mantine-Select-options { + color: black !important; + background-color: white !important; } \ No newline at end of file diff --git a/src/pages/homepage/components/Header/Header.tsx b/src/pages/homepage/components/Header/Header.tsx index 5ddd105..8fd99b9 100644 --- a/src/pages/homepage/components/Header/Header.tsx +++ b/src/pages/homepage/components/Header/Header.tsx @@ -104,36 +104,40 @@ function Header({
- {!isMobile && ( - + - - {current.temperature}°F - - - {current.highTemp}°F/{current.lowTemp}°F - - - )} + {current.temperature}°F + + + {current.highTemp}°F/{current.lowTemp}°F + + {`${ time.getHours() === 0 @@ -154,6 +158,7 @@ function Header({ setValue={setValue} setProviderLabel={setProviderLabel} setProviderURL={setProviderURL} + isMobile={isMobile} />
); diff --git a/src/pages/settings/Settings.tsx b/src/pages/settings/Settings.tsx index 497ca83..aa48f7f 100644 --- a/src/pages/settings/Settings.tsx +++ b/src/pages/settings/Settings.tsx @@ -1,5 +1,14 @@ import { ActionIcon, Group, Stack, Tabs, Text } from '@mantine/core'; -import { FiArrowLeftCircle } from 'react-icons/fi'; +import { + FiArrowLeftCircle, + FiBook, + FiBookmark, + FiEdit, + FiGlobe, + FiMail, + FiSearch, + FiUser, +} from 'react-icons/fi'; import { actionIconClasses, tabClasses, textClasses } from 'styles'; import Applications from './components/Applications'; import Bookmarks from './components/Bookmarks'; @@ -10,8 +19,9 @@ import SearchProviders from './components/SearchProviders'; import Themes from './components/Themes'; export function Settings({ theme }: any) { + const isMobile = window.matchMedia('(max-width: 600px)').matches; return ( - + - Personal Info - Messages - Applications - Bookmarks - Categories - Themes - Search Providers + + {isMobile ? : 'Personal Info'} + + {isMobile ? : 'Messages'} + + {isMobile ? : 'Applications'} + + {isMobile ? : 'Bookmarks'} + + {isMobile ? : 'Categories'} + + {isMobile ? : 'Themes'} + + {isMobile ? : 'Search Providers'} + diff --git a/src/styles/Tabs.module.css b/src/styles/Tabs.module.css index ced563a..a7760bc 100644 --- a/src/styles/Tabs.module.css +++ b/src/styles/Tabs.module.css @@ -1,7 +1,11 @@ .settingsTabs { + @media (max-width: 600px) { + .panel { + padding-left: 0 !important; + } + } .panel { padding-left: 2rem; - height: 100%; } .tab { color: var(--color-text-pri); @@ -17,4 +21,5 @@ .list::before { border-color: var(--color-text-acc); } -} \ No newline at end of file +} +