Skip to content

Commit 46fcbc4

Browse files
committed
wip: moved components + fixed theme toggle alignment
1 parent 236d2c7 commit 46fcbc4

5 files changed

Lines changed: 11 additions & 17 deletions

File tree

panel/src/components/ui/alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { cva, type VariantProps } from "class-variance-authority"
44
import { cn } from "@/lib/utils"
55

66
const alertVariants = cva(
7-
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
7+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground text-black/75 dark:text-white/90",
88
{
99
variants: {
1010
variant: {
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import {
77
import { Input } from "@/components/ui/input";
88
import { Label } from "@/components/ui/label";
99
import { useAuth } from "@/hooks/auth";
10-
import { memo, useEffect, useState } from "react";
10+
import { useEffect, useState } from "react";
1111
import { TabsTrigger, TabsList, TabsContent, Tabs } from "@/components/ui/tabs";
1212
import { ApiChangeIdentifiersReq, ApiChangePasswordReq } from "@shared/authApiTypes";
1313
import { useAccountModal, useCloseAccountModal } from "@/hooks/dialogs";
1414
import { GenericApiOkResp } from "@shared/genericApiTypes";
15-
import { ApiTimeout, fetchWithTimeout, useAuthedFetcher, useBackendApi } from "@/hooks/fetch";
15+
import { fetchWithTimeout, useAuthedFetcher, useBackendApi } from "@/hooks/fetch";
1616
import consts from "@shared/consts";
17-
import { txToast } from "./TxToaster";
17+
import { txToast } from "@/components/TxToaster";
1818
import useSWR from 'swr';
19-
import TxAnchor from "./TxAnchor";
19+
import TxAnchor from "@/components/TxAnchor";
2020

2121

2222
/**
2323
* Change Password tab
2424
*/
25-
const ChangePasswordTab = memo(function () {
25+
function ChangePasswordTab() {
2626
const { authData, setAuthData } = useAuth();
2727
const { setAccountModalTab } = useAccountModal();
2828
const closeAccountModal = useCloseAccountModal();
@@ -151,7 +151,7 @@ const ChangePasswordTab = memo(function () {
151151
</form>
152152
</TabsContent>
153153
);
154-
})
154+
}
155155

156156

157157
/**
File renamed without changes.

panel/src/layout/Header.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,8 @@ function AuthedHeaderFragment() {
143143
{/* TODO: remove this when remaking the ingame menu */}
144144
{window.txConsts.isWebInterface && (
145145
<DropdownMenuItem className="cursor-pointer" onClick={switchTheme}>
146-
<span className="hidden dark:flex items-center">
147-
<SunIcon className="mr-2 h-4 w-4" />
148-
Light Mode
149-
</span>
150-
<span className="flex dark:hidden items-center">
151-
<MoonIcon className="mr-2 h-4 w-4" />
152-
Dark Mode
153-
</span>
146+
{theme === 'light' ? <SunIcon className="mr-2 h-4 w-4" /> : <MoonIcon className="mr-2 h-4 w-4" />}
147+
{theme === 'light' ? 'Light Mode' : 'Dark Mode'}
154148
</DropdownMenuItem>
155149
)}
156150
<DropdownMenuItem className="cursor-pointer" onClick={openAccountModal}>

panel/src/layout/MainShell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import WarningBar from './WarningBar';
99
import ConfirmDialog from '@/components/ConfirmDialog';
1010
import PromptDialog from '@/components/PromptDialog';
1111
import TxToaster from '@/components/TxToaster';
12-
import AccountDialog from '@/components/AccountDialog';
12+
import AccountDialog from './AccountDialog';
1313
import { useOpenAccountModal } from '@/hooks/dialogs';
1414
import PlayerModal from './PlayerModal/PlayerModal';
1515
import { playerModalUrlParam, useOpenPlayerModal } from '@/hooks/playerModal';
@@ -18,7 +18,7 @@ import MainSocket from './MainSocket';
1818
import { TooltipProvider } from '@/components/ui/tooltip';
1919
import { useToggleTheme } from '@/hooks/theme';
2020
import { hotkeyEventListener } from '@/lib/hotkeyEventListener';
21-
import BreakpointDebugger from '@/components/BreakpointDebugger';
21+
import BreakpointDebugger from './BreakpointDebugger';
2222
import ActionModal from './ActionModal/ActionModal';
2323
import { useEffect } from 'react';
2424
import { actionModalUrlParam, useOpenActionModal } from '@/hooks/actionModal';

0 commit comments

Comments
 (0)