1
1
import {
2
2
BarChartOutlined ,
3
3
BellOutlined ,
4
- CheckOutlined ,
5
4
HomeOutlined ,
6
5
QuestionCircleOutlined ,
7
6
SwapOutlined ,
@@ -36,7 +35,6 @@ import {
36
35
sendAnalyticsEvent ,
37
36
switchToOrganization ,
38
37
updateNovelUserExperienceInfos ,
39
- updateSelectedThemeOfUser ,
40
38
} from "admin/rest_api" ;
41
39
import type { ItemType , MenuItemType , SubMenuType } from "antd/es/menu/interface" ;
42
40
import { MaintenanceBanner , UpgradeVersionBanner } from "banners" ;
@@ -50,20 +48,14 @@ import * as Utils from "libs/utils";
50
48
import window , { location } from "libs/window" ;
51
49
import messages from "messages" ;
52
50
import type { MenuClickEventHandler } from "rc-menu/lib/interface" ;
53
- import { getAntdTheme , getSystemColorTheme } from "theme" ;
54
- import type {
55
- APIOrganizationCompact ,
56
- APIUser ,
57
- APIUserCompact ,
58
- APIUserTheme ,
59
- } from "types/api_types" ;
51
+ import { getAntdTheme } from "theme" ;
52
+ import type { APIOrganizationCompact , APIUser , APIUserCompact } from "types/api_types" ;
60
53
import constants from "viewer/constants" ;
61
54
import {
62
55
isAnnotationFromDifferentOrganization ,
63
56
isAnnotationOwner as isAnnotationOwnerAccessor ,
64
57
} from "viewer/model/accessors/annotation_accessor" ;
65
58
import { formatUserName } from "viewer/model/accessors/user_accessor" ;
66
- import { setThemeAction } from "viewer/model/actions/ui_actions" ;
67
59
import { logoutUserAction , setActiveUserAction } from "viewer/model/actions/user_actions" ;
68
60
import type { WebknossosState } from "viewer/store" ;
69
61
import Store from "viewer/store" ;
@@ -573,7 +565,7 @@ function LoggedInAvatar({
573
565
handleLogout : ( event : React . SyntheticEvent ) => void ;
574
566
navbarHeight : number ;
575
567
} & SubMenuProps ) {
576
- const { firstName, lastName, organization : organizationId , selectedTheme } = activeUser ;
568
+ const { firstName, lastName, organization : organizationId } = activeUser ;
577
569
const usersOrganizations = useFetch ( getUsersOrganizations , [ ] , [ ] ) ;
578
570
const activeOrganization = usersOrganizations . find ( ( org ) => org . id === organizationId ) ;
579
571
const switchableOrganizations = usersOrganizations . filter ( ( org ) => org . id !== organizationId ) ;
@@ -593,16 +585,6 @@ function LoggedInAvatar({
593
585
}
594
586
} ;
595
587
596
- const setSelectedTheme = async ( newTheme : APIUserTheme ) => {
597
- if ( newTheme === "auto" ) newTheme = getSystemColorTheme ( ) ;
598
-
599
- if ( selectedTheme !== newTheme ) {
600
- const newUser = await updateSelectedThemeOfUser ( activeUser . id , newTheme ) ;
601
- Store . dispatch ( setThemeAction ( newTheme ) ) ;
602
- Store . dispatch ( setActiveUserAction ( newUser ) ) ;
603
- }
604
- } ;
605
-
606
588
const maybeOrganizationFilterInput =
607
589
switchableOrganizations . length > ORGANIZATION_COUNT_THRESHOLD_FOR_SEARCH_INPUT
608
590
? [
@@ -673,34 +655,10 @@ function LoggedInAvatar({
673
655
] ,
674
656
}
675
657
: null ,
676
- {
677
- key : "resetpassword" ,
678
- label : < Link to = "/account/password" > Change Password</ Link > ,
679
- } ,
680
- { key : "token" , label : < Link to = "/account/token" > Auth Token</ Link > } ,
681
658
{
682
659
key : "account" ,
683
660
label : < Link to = "/account" > Account Settings</ Link > ,
684
661
} ,
685
- {
686
- key : "theme" ,
687
- label : "Theme" ,
688
- children : [
689
- [ "auto" , "System-default" ] ,
690
- [ "light" , "Light" ] ,
691
- [ "dark" , "Dark" ] ,
692
- ] . map ( ( [ key , label ] ) => {
693
- return {
694
- key,
695
- label : label ,
696
- icon : selectedTheme === key ? < CheckOutlined /> : null ,
697
- onClick : ( ) => {
698
- // @ts -expect-error ts-migrate(2345) FIXME: Argument of type 'string' is not assignable to par... Remove this comment to see the full error message
699
- setSelectedTheme ( key ) ;
700
- } ,
701
- } ;
702
- } ) ,
703
- } ,
704
662
{
705
663
key : "logout" ,
706
664
label : (
0 commit comments