@stevederico/skateboard-ui 4.5.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ 4.6.0
4
+
5
+ SettingsView uses ThemeToggle
6
+
3
7
  4.5.0
4
8
 
5
9
  Toggle uses resolvedTheme
@@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { useNavigate } from 'react-router';
4
4
  import { getState } from '../core/Context.js';
5
- import { useTheme } from '../core/ThemeProvider.js';
6
- import { Sun, Moon } from '../../icons/index.js';
5
+ import ThemeToggle from '../ThemeToggle.js';
7
6
  import Header from '../layout/Header.js';
8
7
  import { Avatar, AvatarFallback } from '../../shadcn/ui/avatar.js';
9
8
  import { Badge } from '../../shadcn/ui/badge.js';
@@ -29,8 +28,6 @@ export default function SettingsView() {
29
28
  const { state, dispatch } = getState();
30
29
  const constants = state.constants;
31
30
  const navigate = useNavigate();
32
- const { theme, setTheme } = useTheme();
33
- const isDarkMode = theme === 'dark';
34
31
  const user = state.user;
35
32
  const subscription = user?.subscription;
36
33
  const showAuth = (constants.noLogin === false || typeof constants.noLogin === 'undefined') && user;
@@ -49,7 +46,7 @@ export default function SettingsView() {
49
46
  return `Ends ${new Date(subscription.expires * 1000).toLocaleDateString('en-US')}`;
50
47
  return `Plan ${status}`;
51
48
  }
52
- return (_jsxs("div", { className: "flex-1", children: [_jsx(Header, { title: "Settings", children: _jsx(Button, { variant: "ghost", size: "icon", onClick: () => setTheme(isDarkMode ? 'light' : 'dark'), "aria-label": "Toggle dark mode", children: isDarkMode ? _jsx(Sun, { size: 20 }) : _jsx(Moon, { size: 20 }) }) }), _jsxs("div", { className: "flex flex-col items-center p-4 gap-4", children: [!user && constants.noLogin !== true && (_jsx(Card, { className: "w-full max-w-lg", children: _jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Account" }), _jsx(CardDescription, { children: "Sign in to access your account settings." }), _jsx(CardAction, { children: _jsx(Button, { variant: "outline", size: "sm", onClick: () => {
49
+ return (_jsxs("div", { className: "flex-1", children: [_jsx(Header, { title: "Settings", children: _jsx(ThemeToggle, { iconSize: 20 }) }), _jsxs("div", { className: "flex flex-col items-center p-4 gap-4", children: [!user && constants.noLogin !== true && (_jsx(Card, { className: "w-full max-w-lg", children: _jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Account" }), _jsx(CardDescription, { children: "Sign in to access your account settings." }), _jsx(CardAction, { children: _jsx(Button, { variant: "outline", size: "sm", onClick: () => {
53
50
  if (isAuthOverlayEnabled()) {
54
51
  dispatch({ type: 'SHOW_AUTH_OVERLAY' });
55
52
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stevederico/skateboard-ui",
3
3
  "private": false,
4
- "version": "4.5.0",
4
+ "version": "4.6.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {