diff --git a/shared/app/global-errors/hook.tsx b/shared/app/global-errors/hook.tsx index 646d872c8f90..f35ad7056a9c 100644 --- a/shared/app/global-errors/hook.tsx +++ b/shared/app/global-errors/hook.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' import * as React from 'react' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import type {RPCError} from '@/util/errors' import {settingsFeedbackTab} from '@/constants/settings/util' -import {useDaemonState} from '@/constants/daemon' +import {useDaemonState} from '@/stores/daemon' export type Size = 'Closed' | 'Small' | 'Big' diff --git a/shared/app/index.native.tsx b/shared/app/index.native.tsx index 9fbbeae4fbbd..2a1c1337b56d 100644 --- a/shared/app/index.native.tsx +++ b/shared/app/index.native.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as Kb from '@/common-adapters' import * as React from 'react' import {handleAppLink} from '@/constants/deeplinks' @@ -18,7 +18,7 @@ import ServiceDecoration from '@/common-adapters/markdown/service-decoration' import {useUnmountAll} from '@/util/debug-react' import {darkModeSupported, guiConfig} from 'react-native-kb' import {install} from 'react-native-kb' -import * as DarkMode from '@/constants/darkmode' +import * as DarkMode from '@/stores/darkmode' import {initPlatformListener, onEngineConnected, onEngineDisconnected, onEngineIncoming} from '@/constants/init/index.native' enableFreeze(true) diff --git a/shared/app/main.desktop.tsx b/shared/app/main.desktop.tsx index 16ef0670516d..12bd8e36da36 100644 --- a/shared/app/main.desktop.tsx +++ b/shared/app/main.desktop.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import Router from '@/router-v2/router' -import {useDarkModeState} from '@/constants/darkmode' +import {useDarkModeState} from '@/stores/darkmode' import ResetModal from '../login/reset/modal' import GlobalError from './global-errors' import OutOfDate from './out-of-date' diff --git a/shared/app/out-of-date.tsx b/shared/app/out-of-date.tsx index 3287a86e87d1..d77926f918bc 100644 --- a/shared/app/out-of-date.tsx +++ b/shared/app/out-of-date.tsx @@ -3,7 +3,7 @@ import * as Kb from '@/common-adapters' import * as React from 'react' import * as T from '@/constants/types' import logger from '@/logger' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const styles = Kb.Styles.styleSheetCreate(() => ({ container: { diff --git a/shared/app/runtime-stats.tsx b/shared/app/runtime-stats.tsx index 55e94eee4a96..2ea975b665cc 100644 --- a/shared/app/runtime-stats.tsx +++ b/shared/app/runtime-stats.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const isIPhoneX = false as boolean // import lagRadar from 'lag-radar' diff --git a/shared/chat/audio/audio-recorder.native.tsx b/shared/chat/audio/audio-recorder.native.tsx index b68e7f68ade6..8c3a2d197c98 100644 --- a/shared/chat/audio/audio-recorder.native.tsx +++ b/shared/chat/audio/audio-recorder.native.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import {Portal} from '@/common-adapters/portal.native' diff --git a/shared/chat/blocking/block-modal.tsx b/shared/chat/blocking/block-modal.tsx index e0c695937385..0a9dfdd64d03 100644 --- a/shared/chat/blocking/block-modal.tsx +++ b/shared/chat/blocking/block-modal.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' -import * as Chat from '@/constants/chat2' -import {useTeamsState} from '@/constants/teams' -import {useUsersState} from '@/constants/users' +import * as Chat from '@/stores/chat2' +import {useTeamsState} from '@/stores/teams' +import {useUsersState} from '@/stores/users' // Type for extra RouteProp passed to block modal sometimes when launching the // modal from specific places from the app. diff --git a/shared/chat/blocking/invitation-to-block.tsx b/shared/chat/blocking/invitation-to-block.tsx index e7ba0b2f0950..9e124e37d688 100644 --- a/shared/chat/blocking/invitation-to-block.tsx +++ b/shared/chat/blocking/invitation-to-block.tsx @@ -1,8 +1,8 @@ -import * as Chat from '@/constants/chat2' -import {useProfileState} from '@/constants/profile' +import * as Chat from '@/stores/chat2' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' const BlockButtons = () => { const nav = useSafeNavigation() diff --git a/shared/chat/chat-button.tsx b/shared/chat/chat-button.tsx index 1524bf4e37a2..d565cffd15b4 100644 --- a/shared/chat/chat-button.tsx +++ b/shared/chat/chat-button.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Styles from '@/styles' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import WaitingButton from '@/common-adapters/waiting-button' import Icon from '@/common-adapters/icon' diff --git a/shared/chat/conversation/attachment-fullscreen/hooks.tsx b/shared/chat/conversation/attachment-fullscreen/hooks.tsx index 584d3cdeacc9..cd16b218c638 100644 --- a/shared/chat/conversation/attachment-fullscreen/hooks.tsx +++ b/shared/chat/conversation/attachment-fullscreen/hooks.tsx @@ -1,9 +1,9 @@ import * as React from 'react' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import type * as T from '@/constants/types' import {maxWidth, maxHeight} from '../messages/attachment/shared' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const blankMessage = Chat.makeMessageAttachment({}) export const useData = (initialOrdinal: T.Chat.Ordinal) => { diff --git a/shared/chat/conversation/attachment-get-titles.tsx b/shared/chat/conversation/attachment-get-titles.tsx index 317df4f73246..ee2da9c58036 100644 --- a/shared/chat/conversation/attachment-get-titles.tsx +++ b/shared/chat/conversation/attachment-get-titles.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/bot/confirm.tsx b/shared/chat/conversation/bot/confirm.tsx index 4f0c8230ebbc..6d7c001fb176 100644 --- a/shared/chat/conversation/bot/confirm.tsx +++ b/shared/chat/conversation/bot/confirm.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import type * as T from '@/constants/types' import {useBotConversationIDKey} from './install' diff --git a/shared/chat/conversation/bot/install.tsx b/shared/chat/conversation/bot/install.tsx index c1e24c343beb..88c1f3a90369 100644 --- a/shared/chat/conversation/bot/install.tsx +++ b/shared/chat/conversation/bot/install.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import ChannelPicker from './channel-picker' import openURL from '@/util/open-url' import * as T from '@/constants/types' -import {useBotsState} from '@/constants/bots' +import {useBotsState} from '@/stores/bots' import {useAllChannelMetas} from '@/teams/common/channel-hooks' const RestrictedItem = '---RESTRICTED---' diff --git a/shared/chat/conversation/bot/search.tsx b/shared/chat/conversation/bot/search.tsx index 3a3dd2ab36f3..ec1309ad25f6 100644 --- a/shared/chat/conversation/bot/search.tsx +++ b/shared/chat/conversation/bot/search.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import debounce from 'lodash/debounce' import type * as T from '@/constants/types' import {Bot} from '../info-panel/bot' -import {getFeaturedSorted, useBotsState} from '@/constants/bots' +import {getFeaturedSorted, useBotsState} from '@/stores/bots' type Props = {teamID?: T.Teams.TeamID} diff --git a/shared/chat/conversation/bot/team-picker.tsx b/shared/chat/conversation/bot/team-picker.tsx index 23c869eeff54..b62b38be91c9 100644 --- a/shared/chat/conversation/bot/team-picker.tsx +++ b/shared/chat/conversation/bot/team-picker.tsx @@ -5,7 +5,7 @@ import * as T from '@/constants/types' import {Avatars, TeamAvatar} from '@/chat/avatars' import debounce from 'lodash/debounce' import logger from '@/logger' -import {useBotsState} from '@/constants/bots' +import {useBotsState} from '@/stores/bots' type Props = {botUsername: string} diff --git a/shared/chat/conversation/bottom-banner.tsx b/shared/chat/conversation/bottom-banner.tsx index 3b845cd09e92..6d5fa9af7d4e 100644 --- a/shared/chat/conversation/bottom-banner.tsx +++ b/shared/chat/conversation/bottom-banner.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import _openSMS from '@/util/sms' import {assertionToDisplay} from '@/common-adapters/usernames' import type {Props as TextProps} from '@/common-adapters/text' -import {useUsersState} from '@/constants/users' -import {useFollowerState} from '@/constants/followers' +import {useUsersState} from '@/stores/users' +import {useFollowerState} from '@/stores/followers' const installMessage = `I sent you encrypted messages on Keybase. You can install it here: https://keybase.io/phone-app` diff --git a/shared/chat/conversation/command-markdown.tsx b/shared/chat/conversation/command-markdown.tsx index 1f434bc4d280..10c20f1c5509 100644 --- a/shared/chat/conversation/command-markdown.tsx +++ b/shared/chat/conversation/command-markdown.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' const CommandMarkdown = () => { diff --git a/shared/chat/conversation/command-status.tsx b/shared/chat/conversation/command-status.tsx index 9a005c52a13c..d27ab60a9bf3 100644 --- a/shared/chat/conversation/command-status.tsx +++ b/shared/chat/conversation/command-status.tsx @@ -1,7 +1,7 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const empty = { actions: [], diff --git a/shared/chat/conversation/container.tsx b/shared/chat/conversation/container.tsx index 0cb2f2d21908..d892d3f39949 100644 --- a/shared/chat/conversation/container.tsx +++ b/shared/chat/conversation/container.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import Normal from './normal/container' import NoConversation from './no-conversation' import Error from './error' diff --git a/shared/chat/conversation/error.tsx b/shared/chat/conversation/error.tsx index c4762dc4f87a..0c9266bb235c 100644 --- a/shared/chat/conversation/error.tsx +++ b/shared/chat/conversation/error.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' const ConversationError = () => { diff --git a/shared/chat/conversation/fwd-msg.tsx b/shared/chat/conversation/fwd-msg.tsx index 53ec16deb001..265d9e69c756 100644 --- a/shared/chat/conversation/fwd-msg.tsx +++ b/shared/chat/conversation/fwd-msg.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' diff --git a/shared/chat/conversation/giphy/hooks.tsx b/shared/chat/conversation/giphy/hooks.tsx index bad968dd56aa..b2aea6c79b09 100644 --- a/shared/chat/conversation/giphy/hooks.tsx +++ b/shared/chat/conversation/giphy/hooks.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' export const useHooks = () => { const giphy = Chat.useChatContext(s => s.giphyResult) diff --git a/shared/chat/conversation/header-area/index.native.tsx b/shared/chat/conversation/header-area/index.native.tsx index c2b82732a4aa..ceaaff316fdd 100644 --- a/shared/chat/conversation/header-area/index.native.tsx +++ b/shared/chat/conversation/header-area/index.native.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useProfileState} from '@/constants/profile' +import * as Chat from '@/stores/chat2' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' import * as React from 'react' import type {HeaderBackButtonProps} from '@react-navigation/elements' @@ -9,8 +9,8 @@ import {Keyboard} from 'react-native' // import {DebugChatDumpContext} from '@/constants/chat2/debug' import {assertionToDisplay} from '@/common-adapters/usernames' import {useSafeAreaFrame} from 'react-native-safe-area-context' -import {useUsersState} from '@/constants/users' -import {useCurrentUserState} from '@/constants/current-user' +import {useUsersState} from '@/stores/users' +import {useCurrentUserState} from '@/stores/current-user' export const HeaderAreaRight = () => { const conversationIDKey = Chat.useChatContext(s => s.id) diff --git a/shared/chat/conversation/info-panel/add-people.tsx b/shared/chat/conversation/info-panel/add-people.tsx index 9e7492a91f92..724cd29ec1c1 100644 --- a/shared/chat/conversation/info-panel/add-people.tsx +++ b/shared/chat/conversation/info-panel/add-people.tsx @@ -1,5 +1,5 @@ -import * as Chat from '@/constants/chat2' -import {useTeamsState} from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import {useTeamsState} from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/info-panel/add-to-channel.tsx b/shared/chat/conversation/info-panel/add-to-channel.tsx index 59bfd1d8e9ca..2109aaae2717 100644 --- a/shared/chat/conversation/info-panel/add-to-channel.tsx +++ b/shared/chat/conversation/info-panel/add-to-channel.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' import * as T from '@/constants/types' diff --git a/shared/chat/conversation/info-panel/attachments.tsx b/shared/chat/conversation/info-panel/attachments.tsx index 451fa0a9bf98..1deea243bb7d 100644 --- a/shared/chat/conversation/info-panel/attachments.tsx +++ b/shared/chat/conversation/info-panel/attachments.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import type {StylesTextCrossPlatform} from '@/common-adapters/text' import * as T from '@/constants/types' @@ -8,7 +8,7 @@ import chunk from 'lodash/chunk' import {formatAudioRecordDuration, formatTimeForMessages} from '@/util/timestamp' import {infoPanelWidth} from './common' import {useMessagePopup} from '../messages/message-popup' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' type Props = { commonSections: ReadonlyArray
diff --git a/shared/chat/conversation/info-panel/bot.tsx b/shared/chat/conversation/info-panel/bot.tsx index 9acfef03a51a..1152170c6d5d 100644 --- a/shared/chat/conversation/info-panel/bot.tsx +++ b/shared/chat/conversation/info-panel/bot.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Teams from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as React from 'react' import type * as T from '@/constants/types' -import {getFeaturedSorted, useBotsState} from '@/constants/bots' -import {useUsersState} from '@/constants/users' +import {getFeaturedSorted, useBotsState} from '@/stores/bots' +import {useUsersState} from '@/stores/users' type AddToChannelProps = { conversationIDKey: T.Chat.ConversationIDKey diff --git a/shared/chat/conversation/info-panel/common.tsx b/shared/chat/conversation/info-panel/common.tsx index 1de1bb893716..d01c196b8579 100644 --- a/shared/chat/conversation/info-panel/common.tsx +++ b/shared/chat/conversation/info-panel/common.tsx @@ -1,5 +1,5 @@ -import type * as Chat from '@/constants/chat2' -import {useTeamsState} from '@/constants/teams' +import type * as Chat from '@/stores/chat2' +import {useTeamsState} from '@/stores/teams' import * as React from 'react' import * as Styles from '@/styles' import type * as T from '@/constants/types' diff --git a/shared/chat/conversation/info-panel/header.tsx b/shared/chat/conversation/info-panel/header.tsx index 121f86d02404..6d45cc0ca533 100644 --- a/shared/chat/conversation/info-panel/header.tsx +++ b/shared/chat/conversation/info-panel/header.tsx @@ -1,6 +1,6 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import InfoPanelMenu from './menu' import * as InfoPanelCommon from './common' diff --git a/shared/chat/conversation/info-panel/index.tsx b/shared/chat/conversation/info-panel/index.tsx index f2bcd79a3346..0bf1adf3fad2 100644 --- a/shared/chat/conversation/info-panel/index.tsx +++ b/shared/chat/conversation/info-panel/index.tsx @@ -1,6 +1,6 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import {AdhocHeader, TeamHeader} from './header' import SettingsList from './settings' diff --git a/shared/chat/conversation/info-panel/members.tsx b/shared/chat/conversation/info-panel/members.tsx index 5c1242ee02d7..72b3a4405985 100644 --- a/shared/chat/conversation/info-panel/members.tsx +++ b/shared/chat/conversation/info-panel/members.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useProfileState} from '@/constants/profile' -import * as Teams from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import {useProfileState} from '@/stores/profile' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import Participant from './participant' -import {useUsersState} from '@/constants/users' +import {useUsersState} from '@/stores/users' type Props = { commonSections: ReadonlyArray
diff --git a/shared/chat/conversation/info-panel/menu.tsx b/shared/chat/conversation/info-panel/menu.tsx index eac5285c62f0..0d1bd8e20c50 100644 --- a/shared/chat/conversation/info-panel/menu.tsx +++ b/shared/chat/conversation/info-panel/menu.tsx @@ -1,14 +1,14 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as T from '@/constants/types' import * as InfoPanelCommon from './common' import {Avatars, TeamAvatar} from '@/chat/avatars' import {TeamsSubscriberMountOnly} from '@/teams/subscriber' -import {useUsersState} from '@/constants/users' -import {useCurrentUserState} from '@/constants/current-user' +import {useUsersState} from '@/stores/users' +import {useCurrentUserState} from '@/stores/current-user' export type OwnProps = { attachTo?: React.RefObject diff --git a/shared/chat/conversation/info-panel/settings/index.tsx b/shared/chat/conversation/info-panel/settings/index.tsx index 6535768ef672..7656d2a941d9 100644 --- a/shared/chat/conversation/info-panel/settings/index.tsx +++ b/shared/chat/conversation/info-panel/settings/index.tsx @@ -1,13 +1,13 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as T from '@/constants/types' import * as React from 'react' import MinWriterRole from './min-writer-role' import Notifications from './notifications' import RetentionPicker from '@/teams/team/settings-tab/retention' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type EntityType = 'adhoc' | 'small team' | 'channel' type SettingsPanelProps = {isPreview: boolean} diff --git a/shared/chat/conversation/info-panel/settings/min-writer-role.tsx b/shared/chat/conversation/info-panel/settings/min-writer-role.tsx index a25934607682..56c8a09e4566 100644 --- a/shared/chat/conversation/info-panel/settings/min-writer-role.tsx +++ b/shared/chat/conversation/info-panel/settings/min-writer-role.tsx @@ -1,6 +1,6 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as Style from '@/styles' import type * as T from '@/constants/types' diff --git a/shared/chat/conversation/info-panel/settings/notifications.tsx b/shared/chat/conversation/info-panel/settings/notifications.tsx index 53bbf518206f..fdfcb3a0bc94 100644 --- a/shared/chat/conversation/info-panel/settings/notifications.tsx +++ b/shared/chat/conversation/info-panel/settings/notifications.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' diff --git a/shared/chat/conversation/input-area/container.tsx b/shared/chat/conversation/input-area/container.tsx index 7ce09e75c96b..e318566ef103 100644 --- a/shared/chat/conversation/input-area/container.tsx +++ b/shared/chat/conversation/input-area/container.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import Normal from './normal2' import Preview from './preview' import ThreadSearch from '../search' diff --git a/shared/chat/conversation/input-area/location-popup.native.tsx b/shared/chat/conversation/input-area/location-popup.native.tsx index 1225ddfcd0eb..1df813f11cf2 100644 --- a/shared/chat/conversation/input-area/location-popup.native.tsx +++ b/shared/chat/conversation/input-area/location-popup.native.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import logger from '@/logger' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import LocationMap from '@/chat/location-map' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' import {requestLocationPermission} from '@/constants/platform-specific' import * as ExpoLocation from 'expo-location' diff --git a/shared/chat/conversation/input-area/normal2/index.tsx b/shared/chat/conversation/input-area/normal2/index.tsx index 8ceea809bb21..248c3e9db0bd 100644 --- a/shared/chat/conversation/input-area/normal2/index.tsx +++ b/shared/chat/conversation/input-area/normal2/index.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import CommandMarkdown from '../../command-markdown' @@ -13,7 +13,7 @@ import {infoPanelWidthTablet} from '../../info-panel/common' import {assertionToDisplay} from '@/common-adapters/usernames' import {FocusContext, ScrollContext} from '@/chat/conversation/normal/context' import type {RefType as Input2Ref} from '@/common-adapters/input2' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' const useHintText = (p: { isExploding: boolean diff --git a/shared/chat/conversation/input-area/normal2/moremenu-popup.native.tsx b/shared/chat/conversation/input-area/normal2/moremenu-popup.native.tsx index fc790cc73f5a..e75a2301b57f 100644 --- a/shared/chat/conversation/input-area/normal2/moremenu-popup.native.tsx +++ b/shared/chat/conversation/input-area/normal2/moremenu-popup.native.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' type Props = { diff --git a/shared/chat/conversation/input-area/normal2/platform-input.desktop.tsx b/shared/chat/conversation/input-area/normal2/platform-input.desktop.tsx index d56a9ef8bba8..5533d8515bec 100644 --- a/shared/chat/conversation/input-area/normal2/platform-input.desktop.tsx +++ b/shared/chat/conversation/input-area/normal2/platform-input.desktop.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import * as React from 'react' diff --git a/shared/chat/conversation/input-area/normal2/platform-input.native.tsx b/shared/chat/conversation/input-area/normal2/platform-input.native.tsx index 134412c3846e..496f7ebb8c5a 100644 --- a/shared/chat/conversation/input-area/normal2/platform-input.native.tsx +++ b/shared/chat/conversation/input-area/normal2/platform-input.native.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import AudioRecorder from '@/chat/audio/audio-recorder.native' @@ -28,7 +28,7 @@ import logger from '@/logger' import {AudioSendWrapper} from '@/chat/audio/audio-send.native' import {usePickerState} from '@/chat/emoji-picker/use-picker' import type {RefType as Input2Ref, Props as Input2Props} from '@/common-adapters/input2' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const singleLineHeight = 36 const threeLineHeight = 78 diff --git a/shared/chat/conversation/input-area/normal2/set-explode-popup/hooks.tsx b/shared/chat/conversation/input-area/normal2/set-explode-popup/hooks.tsx index 1552f0f23d43..64ae5aca987a 100644 --- a/shared/chat/conversation/input-area/normal2/set-explode-popup/hooks.tsx +++ b/shared/chat/conversation/input-area/normal2/set-explode-popup/hooks.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import type * as T from '@/constants/types' import type {Props} from '.' diff --git a/shared/chat/conversation/input-area/normal2/typing.tsx b/shared/chat/conversation/input-area/normal2/typing.tsx index b9a42ecff2ee..c274f4396aae 100644 --- a/shared/chat/conversation/input-area/normal2/typing.tsx +++ b/shared/chat/conversation/input-area/normal2/typing.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/input-area/preview.tsx b/shared/chat/conversation/input-area/preview.tsx index 3f118f4469ac..64e25419c5f8 100644 --- a/shared/chat/conversation/input-area/preview.tsx +++ b/shared/chat/conversation/input-area/preview.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/input-area/suggestors/channels.tsx b/shared/chat/conversation/input-area/suggestors/channels.tsx index 0fcf0b2bb3ba..4e0bc22ec650 100644 --- a/shared/chat/conversation/input-area/suggestors/channels.tsx +++ b/shared/chat/conversation/input-area/suggestors/channels.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Common from './common' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/input-area/suggestors/commands.tsx b/shared/chat/conversation/input-area/suggestors/commands.tsx index 80f9f7753c81..4cfa2041c692 100644 --- a/shared/chat/conversation/input-area/suggestors/commands.tsx +++ b/shared/chat/conversation/input-area/suggestors/commands.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as Common from './common' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/input-area/suggestors/emoji.tsx b/shared/chat/conversation/input-area/suggestors/emoji.tsx index 2af8b5366e0e..df285c3eb4d2 100644 --- a/shared/chat/conversation/input-area/suggestors/emoji.tsx +++ b/shared/chat/conversation/input-area/suggestors/emoji.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Common from './common' import * as Kb from '@/common-adapters' import * as React from 'react' diff --git a/shared/chat/conversation/input-area/suggestors/index.tsx b/shared/chat/conversation/input-area/suggestors/index.tsx index d82cd92e2019..a075d4262c9c 100644 --- a/shared/chat/conversation/input-area/suggestors/index.tsx +++ b/shared/chat/conversation/input-area/suggestors/index.tsx @@ -1,5 +1,5 @@ import * as Channels from './channels' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Commands from './commands' import * as Emoji from './emoji' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/input-area/suggestors/users.tsx b/shared/chat/conversation/input-area/suggestors/users.tsx index 841ea76922fd..f951b0e3536a 100644 --- a/shared/chat/conversation/input-area/suggestors/users.tsx +++ b/shared/chat/conversation/input-area/suggestors/users.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useTeamsState} from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import {useTeamsState} from '@/stores/teams' import * as T from '@/constants/types' import * as Common from './common' import * as Kb from '@/common-adapters' import * as React from 'react' -import {useUsersState} from '@/constants/users' +import {useUsersState} from '@/stores/users' export const transformer = ( input: { diff --git a/shared/chat/conversation/list-area/hooks.tsx b/shared/chat/conversation/list-area/hooks.tsx index 6208ee8417e4..0570ca7ed8fd 100644 --- a/shared/chat/conversation/list-area/hooks.tsx +++ b/shared/chat/conversation/list-area/hooks.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import JumpToRecent from './jump-to-recent' import type * as T from '@/constants/types' diff --git a/shared/chat/conversation/list-area/index.desktop.tsx b/shared/chat/conversation/list-area/index.desktop.tsx index f26f84b9ca4d..2dd8fc5f700a 100644 --- a/shared/chat/conversation/list-area/index.desktop.tsx +++ b/shared/chat/conversation/list-area/index.desktop.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as Hooks from './hooks' import * as React from 'react' @@ -17,7 +17,7 @@ import logger from '@/logger' import shallowEqual from 'shallowequal' import useResizeObserver from '@/util/use-resize-observer.desktop' import useIntersectionObserver from '@/util/use-intersection-observer' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' // Infinite scrolling list. // We group messages into a series of Waypoints. When the waypoint exits the screen we replace it with a single div instead diff --git a/shared/chat/conversation/list-area/index.native.tsx b/shared/chat/conversation/list-area/index.native.tsx index 8cfc247601a6..099c5b69734e 100644 --- a/shared/chat/conversation/list-area/index.native.tsx +++ b/shared/chat/conversation/list-area/index.native.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as Hooks from './hooks' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/load-status.tsx b/shared/chat/conversation/load-status.tsx index e992dd920145..786061c50ab9 100644 --- a/shared/chat/conversation/load-status.tsx +++ b/shared/chat/conversation/load-status.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' diff --git a/shared/chat/conversation/messages/account-payment/container.tsx b/shared/chat/conversation/messages/account-payment/container.tsx index 7aec89fb2655..e728ab2606eb 100644 --- a/shared/chat/conversation/messages/account-payment/container.tsx +++ b/shared/chat/conversation/messages/account-payment/container.tsx @@ -1,8 +1,8 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import MarkdownMemo from '@/wallets/markdown-memo' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' // Props for rendering the loading indicator const loadingProps = { diff --git a/shared/chat/conversation/messages/account-payment/wrapper.tsx b/shared/chat/conversation/messages/account-payment/wrapper.tsx index 7e2bd8bf7b79..619ed8222849 100644 --- a/shared/chat/conversation/messages/account-payment/wrapper.tsx +++ b/shared/chat/conversation/messages/account-payment/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type PaymentMessageType from './container' diff --git a/shared/chat/conversation/messages/attachment/audio.tsx b/shared/chat/conversation/messages/attachment/audio.tsx index eb299725bc45..1de12a908a91 100644 --- a/shared/chat/conversation/messages/attachment/audio.tsx +++ b/shared/chat/conversation/messages/attachment/audio.tsx @@ -1,9 +1,9 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import {useOrdinal} from '../ids-context' import AudioPlayer from '@/chat/audio/audio-player' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const missingMessage = Chat.makeMessageAttachment() diff --git a/shared/chat/conversation/messages/attachment/file.tsx b/shared/chat/conversation/messages/attachment/file.tsx index 948f66f32a0d..9ec116c82f1c 100644 --- a/shared/chat/conversation/messages/attachment/file.tsx +++ b/shared/chat/conversation/messages/attachment/file.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Crypto from '@/constants/crypto' +import * as Chat from '@/stores/chat2' +import * as Crypto from '@/stores/crypto' import * as React from 'react' import {isPathSaltpack, isPathSaltpackEncrypted, isPathSaltpackSigned} from '@/util/path' import type * as T from '@/constants/types' @@ -9,7 +9,7 @@ import captialize from 'lodash/capitalize' import * as Kb from '@/common-adapters' import type {StyleOverride} from '@/common-adapters/markdown' import {getEditStyle, ShowToastAfterSaving} from './shared' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' type OwnProps = {showPopup: () => void} diff --git a/shared/chat/conversation/messages/attachment/image2/use-state.tsx b/shared/chat/conversation/messages/attachment/image2/use-state.tsx index da4c4093b538..2399086be164 100644 --- a/shared/chat/conversation/messages/attachment/image2/use-state.tsx +++ b/shared/chat/conversation/messages/attachment/image2/use-state.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import {useOrdinal} from '@/chat/conversation/messages/ids-context' import {maxWidth, maxHeight} from '../shared' diff --git a/shared/chat/conversation/messages/attachment/shared.tsx b/shared/chat/conversation/messages/attachment/shared.tsx index 379a85ae8374..d0937dde1167 100644 --- a/shared/chat/conversation/messages/attachment/shared.tsx +++ b/shared/chat/conversation/messages/attachment/shared.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import * as T from '@/constants/types' import {useOrdinal} from '../ids-context' import {sharedStyles} from '../shared-styles' import {Keyboard} from 'react-native' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' type Props = { transferState: T.Chat.MessageAttachmentTransferState diff --git a/shared/chat/conversation/messages/attachment/video/use-state.tsx b/shared/chat/conversation/messages/attachment/video/use-state.tsx index b02adc6d8a21..5fc3c9eaa684 100644 --- a/shared/chat/conversation/messages/attachment/video/use-state.tsx +++ b/shared/chat/conversation/messages/attachment/video/use-state.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import {useOrdinal} from '@/chat/conversation/messages/ids-context' import {missingMessage, maxWidth, maxHeight} from '../shared' diff --git a/shared/chat/conversation/messages/cards/make-team.tsx b/shared/chat/conversation/messages/cards/make-team.tsx index ce3ca6ea16b3..d01d46e8e954 100644 --- a/shared/chat/conversation/messages/cards/make-team.tsx +++ b/shared/chat/conversation/messages/cards/make-team.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' const MakeTeam = () => { diff --git a/shared/chat/conversation/messages/cards/team-journey/container.tsx b/shared/chat/conversation/messages/cards/team-journey/container.tsx index 249383bf41a7..19d47a2be434 100644 --- a/shared/chat/conversation/messages/cards/team-journey/container.tsx +++ b/shared/chat/conversation/messages/cards/team-journey/container.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import {renderWelcomeMessage} from './util' import {useAllChannelMetas} from '@/teams/common/channel-hooks' diff --git a/shared/chat/conversation/messages/emoji-row.tsx b/shared/chat/conversation/messages/emoji-row.tsx index 43e13a7f324c..ffbb461d8082 100644 --- a/shared/chat/conversation/messages/emoji-row.tsx +++ b/shared/chat/conversation/messages/emoji-row.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {useOrdinal} from './ids-context' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/messages/message-popup/attachment.tsx b/shared/chat/conversation/messages/message-popup/attachment.tsx index 0cf6fdb9efb9..19227db84c07 100644 --- a/shared/chat/conversation/messages/message-popup/attachment.tsx +++ b/shared/chat/conversation/messages/message-popup/attachment.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import type * as T from '@/constants/types' import {type Position, fileUIName, type StylesCrossPlatform} from '@/styles' import {useItems, useHeader} from './hooks' import * as Kb from '@/common-adapters' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' type OwnProps = { attachTo?: React.RefObject diff --git a/shared/chat/conversation/messages/message-popup/exploding-header.tsx b/shared/chat/conversation/messages/message-popup/exploding-header.tsx index e390b96f7879..7d691f4b30b8 100644 --- a/shared/chat/conversation/messages/message-popup/exploding-header.tsx +++ b/shared/chat/conversation/messages/message-popup/exploding-header.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' import {formatTimeForPopup, formatTimeForRevoked, msToDHMS} from '@/util/timestamp' import {addTicker, removeTicker} from '@/util/second-timer' diff --git a/shared/chat/conversation/messages/message-popup/header.tsx b/shared/chat/conversation/messages/message-popup/header.tsx index d0221144273a..d57e76ad84f5 100644 --- a/shared/chat/conversation/messages/message-popup/header.tsx +++ b/shared/chat/conversation/messages/message-popup/header.tsx @@ -1,6 +1,6 @@ import * as Kb from '@/common-adapters' import * as React from 'react' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import {formatTimeForPopup, formatTimeForRevoked} from '@/util/timestamp' import type * as T from '@/constants/types' diff --git a/shared/chat/conversation/messages/message-popup/hooks.tsx b/shared/chat/conversation/messages/message-popup/hooks.tsx index 6a8a35db164b..5a55ddf164ab 100644 --- a/shared/chat/conversation/messages/message-popup/hooks.tsx +++ b/shared/chat/conversation/messages/message-popup/hooks.tsx @@ -1,11 +1,11 @@ import * as React from 'react' import type * as T from '@/constants/types' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Teams from '@/constants/teams' -import {useConfigState} from '@/constants/config' -import {useProfileState} from '@/constants/profile' -import {useCurrentUserState} from '@/constants/current-user' +import * as Chat from '@/stores/chat2' +import * as Teams from '@/stores/teams' +import {useConfigState} from '@/stores/config' +import {useProfileState} from '@/stores/profile' +import {useCurrentUserState} from '@/stores/current-user' import {linkFromConvAndMessage} from '@/constants/deeplinks' import ReactionItem from './reactionitem' import MessagePopupHeader from './header' diff --git a/shared/chat/conversation/messages/message-popup/index.tsx b/shared/chat/conversation/messages/message-popup/index.tsx index 111c936d3678..3736bfdc3587 100644 --- a/shared/chat/conversation/messages/message-popup/index.tsx +++ b/shared/chat/conversation/messages/message-popup/index.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import AttachmentMessage from './attachment' diff --git a/shared/chat/conversation/messages/message-popup/journeycard.tsx b/shared/chat/conversation/messages/message-popup/journeycard.tsx index 560590fd8ce3..f631f84246f6 100644 --- a/shared/chat/conversation/messages/message-popup/journeycard.tsx +++ b/shared/chat/conversation/messages/message-popup/journeycard.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import * as React from 'react' diff --git a/shared/chat/conversation/messages/message-popup/reactionitem.tsx b/shared/chat/conversation/messages/message-popup/reactionitem.tsx index 051dce87b10c..9c734e3f529c 100644 --- a/shared/chat/conversation/messages/message-popup/reactionitem.tsx +++ b/shared/chat/conversation/messages/message-popup/reactionitem.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' type Props = { diff --git a/shared/chat/conversation/messages/message-popup/text.tsx b/shared/chat/conversation/messages/message-popup/text.tsx index 3a8c7f28077d..ac05c2730cce 100644 --- a/shared/chat/conversation/messages/message-popup/text.tsx +++ b/shared/chat/conversation/messages/message-popup/text.tsx @@ -1,13 +1,13 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useConfigState} from '@/constants/config' +import * as Chat from '@/stores/chat2' +import {useConfigState} from '@/stores/config' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import type {Position, StylesCrossPlatform} from '@/styles' import {useItems, useHeader} from './hooks' import openURL from '@/util/open-url' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = { attachTo?: React.RefObject diff --git a/shared/chat/conversation/messages/pin/index.tsx b/shared/chat/conversation/messages/pin/index.tsx index 937d4cb6fb2c..7618510b7557 100644 --- a/shared/chat/conversation/messages/pin/index.tsx +++ b/shared/chat/conversation/messages/pin/index.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' diff --git a/shared/chat/conversation/messages/pin/wrapper.tsx b/shared/chat/conversation/messages/pin/wrapper.tsx index 5cfd3cb7c7f2..67125e1e8575 100644 --- a/shared/chat/conversation/messages/pin/wrapper.tsx +++ b/shared/chat/conversation/messages/pin/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type PinType from '.' diff --git a/shared/chat/conversation/messages/placeholder/wrapper.tsx b/shared/chat/conversation/messages/placeholder/wrapper.tsx index 5cc050f9d681..45c196e3be7a 100644 --- a/shared/chat/conversation/messages/placeholder/wrapper.tsx +++ b/shared/chat/conversation/messages/placeholder/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import * as T from '@/constants/types' diff --git a/shared/chat/conversation/messages/react-button.tsx b/shared/chat/conversation/messages/react-button.tsx index 4d9e009c7c5f..289f1870748c 100644 --- a/shared/chat/conversation/messages/react-button.tsx +++ b/shared/chat/conversation/messages/react-button.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import type {StylesCrossPlatform} from '@/styles' import {useOrdinal} from './ids-context' @@ -7,7 +7,7 @@ import * as Kb from '@/common-adapters' import type {StyleOverride} from '@/common-adapters/markdown' import {colors, darkColors} from '@/styles/colors' import {useColorScheme} from 'react-native' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' export type OwnProps = { className?: string diff --git a/shared/chat/conversation/messages/reaction-tooltip.tsx b/shared/chat/conversation/messages/reaction-tooltip.tsx index 985f3edacb4f..d196fa1180f1 100644 --- a/shared/chat/conversation/messages/reaction-tooltip.tsx +++ b/shared/chat/conversation/messages/reaction-tooltip.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import ReactButton from './react-button' import type * as T from '@/constants/types' import {MessageContext} from './ids-context' -import {useUsersState} from '@/constants/users' +import {useUsersState} from '@/stores/users' const positionFallbacks = ['bottom center', 'left center'] as const diff --git a/shared/chat/conversation/messages/reactions-rows.tsx b/shared/chat/conversation/messages/reactions-rows.tsx index cde5d850f470..21d1eef42325 100644 --- a/shared/chat/conversation/messages/reactions-rows.tsx +++ b/shared/chat/conversation/messages/reactions-rows.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import EmojiRow from './emoji-row' diff --git a/shared/chat/conversation/messages/reset-user.tsx b/shared/chat/conversation/messages/reset-user.tsx index 08ae473cf8ff..5ef6bde4ba85 100644 --- a/shared/chat/conversation/messages/reset-user.tsx +++ b/shared/chat/conversation/messages/reset-user.tsx @@ -1,5 +1,5 @@ -import * as Chat from '@/constants/chat2' -import {useProfileState} from '@/constants/profile' +import * as Chat from '@/stores/chat2' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' const ResetUser = () => { diff --git a/shared/chat/conversation/messages/retention-notice.tsx b/shared/chat/conversation/messages/retention-notice.tsx index add6faf305ea..77327c4f58ed 100644 --- a/shared/chat/conversation/messages/retention-notice.tsx +++ b/shared/chat/conversation/messages/retention-notice.tsx @@ -1,6 +1,6 @@ import type * as T from '@/constants/types' -import * as Chat from '@/constants/chat2' -import * as Teams from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as React from 'react' diff --git a/shared/chat/conversation/messages/separator.tsx b/shared/chat/conversation/messages/separator.tsx index d2a640007553..877beff3ad3a 100644 --- a/shared/chat/conversation/messages/separator.tsx +++ b/shared/chat/conversation/messages/separator.tsx @@ -1,15 +1,15 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useTeamsState} from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import * as React from 'react' import * as T from '@/constants/types' import {formatTimeForConversationList, formatTimeForChat} from '@/util/timestamp' import {OrangeLineContext} from '../orange-line-context' import logger from '@/logger' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' +import {useCurrentUserState} from '@/stores/current-user' // import {useChatDebugDump} from '@/constants/chat2/debug' const enoughTimeBetweenMessages = (mtimestamp?: number, ptimestamp?: number): boolean => diff --git a/shared/chat/conversation/messages/set-channelname/wrapper.tsx b/shared/chat/conversation/messages/set-channelname/wrapper.tsx index e3a0c0164c7d..c507ae29e940 100644 --- a/shared/chat/conversation/messages/set-channelname/wrapper.tsx +++ b/shared/chat/conversation/messages/set-channelname/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SetChannelnameType from './container' diff --git a/shared/chat/conversation/messages/set-description/wrapper.tsx b/shared/chat/conversation/messages/set-description/wrapper.tsx index 9f8400a9e58d..0383a7edc43e 100644 --- a/shared/chat/conversation/messages/set-description/wrapper.tsx +++ b/shared/chat/conversation/messages/set-description/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SetDescriptionType from './container' diff --git a/shared/chat/conversation/messages/special-bottom-message.tsx b/shared/chat/conversation/messages/special-bottom-message.tsx index e6e45bf35bee..386a56528d86 100644 --- a/shared/chat/conversation/messages/special-bottom-message.tsx +++ b/shared/chat/conversation/messages/special-bottom-message.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import OldProfileReset from './system-old-profile-reset-notice/container' import ResetUser from './reset-user' diff --git a/shared/chat/conversation/messages/special-top-message.tsx b/shared/chat/conversation/messages/special-top-message.tsx index 40205b7dc910..902b3c7f2bf0 100644 --- a/shared/chat/conversation/messages/special-top-message.tsx +++ b/shared/chat/conversation/messages/special-top-message.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import * as React from 'react' @@ -10,8 +10,8 @@ import NewChatCard from './cards/new-chat' import ProfileResetNotice from './system-profile-reset-notice' import RetentionNotice from './retention-notice' import {usingFlashList} from '../list-area/flashlist-config' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' const ErrorMessage = () => { const createConversationError = Chat.useChatState(s => s.createConversationError) diff --git a/shared/chat/conversation/messages/system-added-to-team/container.tsx b/shared/chat/conversation/messages/system-added-to-team/container.tsx index 58c6e70e030f..10999c12dc9f 100644 --- a/shared/chat/conversation/messages/system-added-to-team/container.tsx +++ b/shared/chat/conversation/messages/system-added-to-team/container.tsx @@ -1,12 +1,12 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import UserNotice from '../user-notice' import {getAddedUsernames} from '../system-users-added-to-conv/container' import {indefiniteArticle} from '@/util/string' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {message: T.Chat.MessageSystemAddedToTeam} diff --git a/shared/chat/conversation/messages/system-added-to-team/wrapper.tsx b/shared/chat/conversation/messages/system-added-to-team/wrapper.tsx index f90914a28f97..dcefb1626e38 100644 --- a/shared/chat/conversation/messages/system-added-to-team/wrapper.tsx +++ b/shared/chat/conversation/messages/system-added-to-team/wrapper.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemAddedToTeamType from './container' diff --git a/shared/chat/conversation/messages/system-change-avatar/index.tsx b/shared/chat/conversation/messages/system-change-avatar/index.tsx index bdf0fffdfe4b..8aa32c6b3098 100644 --- a/shared/chat/conversation/messages/system-change-avatar/index.tsx +++ b/shared/chat/conversation/messages/system-change-avatar/index.tsx @@ -1,7 +1,7 @@ import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import UserNotice from '../user-notice' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type Props = { message: T.Chat.MessageSystemChangeAvatar diff --git a/shared/chat/conversation/messages/system-change-avatar/wrapper.tsx b/shared/chat/conversation/messages/system-change-avatar/wrapper.tsx index 172ac0051c55..ed14bda12cb3 100644 --- a/shared/chat/conversation/messages/system-change-avatar/wrapper.tsx +++ b/shared/chat/conversation/messages/system-change-avatar/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemChangeAvatarType from '.' diff --git a/shared/chat/conversation/messages/system-change-retention/container.tsx b/shared/chat/conversation/messages/system-change-retention/container.tsx index c0ad42530fa3..d192ebd93f88 100644 --- a/shared/chat/conversation/messages/system-change-retention/container.tsx +++ b/shared/chat/conversation/messages/system-change-retention/container.tsx @@ -1,11 +1,11 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import UserNotice from '../user-notice' import * as T from '@/constants/types' import * as dateFns from 'date-fns' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {message: T.Chat.MessageSystemChangeRetention} diff --git a/shared/chat/conversation/messages/system-change-retention/wrapper.tsx b/shared/chat/conversation/messages/system-change-retention/wrapper.tsx index 85490ad934a3..8d6d231f78ed 100644 --- a/shared/chat/conversation/messages/system-change-retention/wrapper.tsx +++ b/shared/chat/conversation/messages/system-change-retention/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemChangeRetentionType from './container' diff --git a/shared/chat/conversation/messages/system-create-team/container.tsx b/shared/chat/conversation/messages/system-create-team/container.tsx index f248de32f0f6..b3c654e66d2f 100644 --- a/shared/chat/conversation/messages/system-create-team/container.tsx +++ b/shared/chat/conversation/messages/system-create-team/container.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import UserNotice from '../user-notice' import type * as T from '@/constants/types' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {message: T.Chat.MessageSystemCreateTeam} diff --git a/shared/chat/conversation/messages/system-create-team/wrapper.tsx b/shared/chat/conversation/messages/system-create-team/wrapper.tsx index 4d4cd246197a..2a9216ababec 100644 --- a/shared/chat/conversation/messages/system-create-team/wrapper.tsx +++ b/shared/chat/conversation/messages/system-create-team/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemCreateTeamType from './container' diff --git a/shared/chat/conversation/messages/system-git-push/container.tsx b/shared/chat/conversation/messages/system-git-push/container.tsx index 3d8d2c346a98..cd31144d737f 100644 --- a/shared/chat/conversation/messages/system-git-push/container.tsx +++ b/shared/chat/conversation/messages/system-git-push/container.tsx @@ -1,11 +1,11 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' -import {useGitState} from '@/constants/git' +import {useGitState} from '@/stores/git' import UserNotice from '../user-notice' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {message: T.Chat.MessageSystemGitPush} diff --git a/shared/chat/conversation/messages/system-git-push/wrapper.tsx b/shared/chat/conversation/messages/system-git-push/wrapper.tsx index aaac3ac464e6..89e05a0090f8 100644 --- a/shared/chat/conversation/messages/system-git-push/wrapper.tsx +++ b/shared/chat/conversation/messages/system-git-push/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemGitPushType from './container' diff --git a/shared/chat/conversation/messages/system-invite-accepted/container.tsx b/shared/chat/conversation/messages/system-invite-accepted/container.tsx index b3b76a752bba..b2d1357a85fd 100644 --- a/shared/chat/conversation/messages/system-invite-accepted/container.tsx +++ b/shared/chat/conversation/messages/system-invite-accepted/container.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import UserNotice from '../user-notice' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {message: T.Chat.MessageSystemInviteAccepted} diff --git a/shared/chat/conversation/messages/system-invite-accepted/wrapper.tsx b/shared/chat/conversation/messages/system-invite-accepted/wrapper.tsx index 118224348648..aeed739b80d4 100644 --- a/shared/chat/conversation/messages/system-invite-accepted/wrapper.tsx +++ b/shared/chat/conversation/messages/system-invite-accepted/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemInviteAcceptedType from './container' diff --git a/shared/chat/conversation/messages/system-joined/container.tsx b/shared/chat/conversation/messages/system-joined/container.tsx index 7ca9df41d333..a9dc7563c9d2 100644 --- a/shared/chat/conversation/messages/system-joined/container.tsx +++ b/shared/chat/conversation/messages/system-joined/container.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/messages/system-joined/wrapper.tsx b/shared/chat/conversation/messages/system-joined/wrapper.tsx index 996f2dc95968..7fe46e21979f 100644 --- a/shared/chat/conversation/messages/system-joined/wrapper.tsx +++ b/shared/chat/conversation/messages/system-joined/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemJoinedType from './container' diff --git a/shared/chat/conversation/messages/system-left/container.tsx b/shared/chat/conversation/messages/system-left/container.tsx index 70ed9a1b3d74..65d0cdf61516 100644 --- a/shared/chat/conversation/messages/system-left/container.tsx +++ b/shared/chat/conversation/messages/system-left/container.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import UserNotice from '../user-notice' diff --git a/shared/chat/conversation/messages/system-left/wrapper.tsx b/shared/chat/conversation/messages/system-left/wrapper.tsx index cf6f97dea1dd..53f8df6c82d2 100644 --- a/shared/chat/conversation/messages/system-left/wrapper.tsx +++ b/shared/chat/conversation/messages/system-left/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemLeftType from './container' diff --git a/shared/chat/conversation/messages/system-new-channel/container.tsx b/shared/chat/conversation/messages/system-new-channel/container.tsx index fb791f2b70b4..f8e1e201837d 100644 --- a/shared/chat/conversation/messages/system-new-channel/container.tsx +++ b/shared/chat/conversation/messages/system-new-channel/container.tsx @@ -1,6 +1,6 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as React from 'react' import type * as T from '@/constants/types' import UserNotice from '../user-notice' diff --git a/shared/chat/conversation/messages/system-new-channel/wrapper.tsx b/shared/chat/conversation/messages/system-new-channel/wrapper.tsx index 27da6aaba425..be12f9f0554f 100644 --- a/shared/chat/conversation/messages/system-new-channel/wrapper.tsx +++ b/shared/chat/conversation/messages/system-new-channel/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemNewChannelType from './container' diff --git a/shared/chat/conversation/messages/system-old-profile-reset-notice/container.tsx b/shared/chat/conversation/messages/system-old-profile-reset-notice/container.tsx index 4044fd8a281b..e306630f87ad 100644 --- a/shared/chat/conversation/messages/system-old-profile-reset-notice/container.tsx +++ b/shared/chat/conversation/messages/system-old-profile-reset-notice/container.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import type * as T from '@/constants/types' import {Text} from '@/common-adapters' import UserNotice from '../user-notice' diff --git a/shared/chat/conversation/messages/system-profile-reset-notice.tsx b/shared/chat/conversation/messages/system-profile-reset-notice.tsx index 2d7deca69d72..0a2677a6140d 100644 --- a/shared/chat/conversation/messages/system-profile-reset-notice.tsx +++ b/shared/chat/conversation/messages/system-profile-reset-notice.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import UserNotice from './user-notice' diff --git a/shared/chat/conversation/messages/system-sbs-resolve/container.tsx b/shared/chat/conversation/messages/system-sbs-resolve/container.tsx index 51da16607892..8346cd4d5a80 100644 --- a/shared/chat/conversation/messages/system-sbs-resolve/container.tsx +++ b/shared/chat/conversation/messages/system-sbs-resolve/container.tsx @@ -2,7 +2,7 @@ import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import {e164ToDisplay} from '@/util/phone-numbers' import UserNotice from '../user-notice' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {message: T.Chat.MessageSystemSBSResolved} diff --git a/shared/chat/conversation/messages/system-sbs-resolve/wrapper.tsx b/shared/chat/conversation/messages/system-sbs-resolve/wrapper.tsx index 32db70666c32..bd9d9626c95a 100644 --- a/shared/chat/conversation/messages/system-sbs-resolve/wrapper.tsx +++ b/shared/chat/conversation/messages/system-sbs-resolve/wrapper.tsx @@ -1,9 +1,9 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemSBSResolvedType from './container' import type SystemJoinedType from '../system-joined/container' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' const WrapperSystemInvite = React.memo(function WrapperSystemInvite(p: Props) { const {ordinal} = p diff --git a/shared/chat/conversation/messages/system-simple-to-complex/container.tsx b/shared/chat/conversation/messages/system-simple-to-complex/container.tsx index d0066afafefb..baa73a2f6af5 100644 --- a/shared/chat/conversation/messages/system-simple-to-complex/container.tsx +++ b/shared/chat/conversation/messages/system-simple-to-complex/container.tsx @@ -1,10 +1,10 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import UserNotice from '../user-notice' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {message: T.Chat.MessageSystemSimpleToComplex} diff --git a/shared/chat/conversation/messages/system-simple-to-complex/wrapper.tsx b/shared/chat/conversation/messages/system-simple-to-complex/wrapper.tsx index 93d830470578..d894327e7599 100644 --- a/shared/chat/conversation/messages/system-simple-to-complex/wrapper.tsx +++ b/shared/chat/conversation/messages/system-simple-to-complex/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemSimpleToComplexType from './container' diff --git a/shared/chat/conversation/messages/system-text/wrapper.tsx b/shared/chat/conversation/messages/system-text/wrapper.tsx index 9b99bc02b180..4f2efa4555f6 100644 --- a/shared/chat/conversation/messages/system-text/wrapper.tsx +++ b/shared/chat/conversation/messages/system-text/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemTextType from './container' diff --git a/shared/chat/conversation/messages/system-users-added-to-conv/container.tsx b/shared/chat/conversation/messages/system-users-added-to-conv/container.tsx index 3d67beba56bb..1a9d48e4233d 100644 --- a/shared/chat/conversation/messages/system-users-added-to-conv/container.tsx +++ b/shared/chat/conversation/messages/system-users-added-to-conv/container.tsx @@ -1,9 +1,9 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import UserNotice from '../user-notice' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {message: T.Chat.MessageSystemUsersAddedToConversation} diff --git a/shared/chat/conversation/messages/system-users-added-to-conv/wrapper.tsx b/shared/chat/conversation/messages/system-users-added-to-conv/wrapper.tsx index 5941d8eebbcd..1fe3e0bf1c8b 100644 --- a/shared/chat/conversation/messages/system-users-added-to-conv/wrapper.tsx +++ b/shared/chat/conversation/messages/system-users-added-to-conv/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {WrapperMessage, useCommon, type Props} from '../wrapper/wrapper' import type SystemUsersAddedToConvType from './container' diff --git a/shared/chat/conversation/messages/text/bottom.tsx b/shared/chat/conversation/messages/text/bottom.tsx index 128cc464ef16..e1a26112b6ab 100644 --- a/shared/chat/conversation/messages/text/bottom.tsx +++ b/shared/chat/conversation/messages/text/bottom.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import type * as T from '@/constants/types' import type CoinFlipType from './coinflip' diff --git a/shared/chat/conversation/messages/text/coinflip/index.tsx b/shared/chat/conversation/messages/text/coinflip/index.tsx index 223547f15130..45f53d2d088d 100644 --- a/shared/chat/conversation/messages/text/coinflip/index.tsx +++ b/shared/chat/conversation/messages/text/coinflip/index.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import * as T from '@/constants/types' diff --git a/shared/chat/conversation/messages/text/reply.tsx b/shared/chat/conversation/messages/text/reply.tsx index 7ad7cfacd4f9..bc0d9c745128 100644 --- a/shared/chat/conversation/messages/text/reply.tsx +++ b/shared/chat/conversation/messages/text/reply.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import {useOrdinal, useIsHighlighted} from '../ids-context' diff --git a/shared/chat/conversation/messages/text/unfurl/prompt-list/container.tsx b/shared/chat/conversation/messages/text/unfurl/prompt-list/container.tsx index 240d090eab40..ea0da57b5081 100644 --- a/shared/chat/conversation/messages/text/unfurl/prompt-list/container.tsx +++ b/shared/chat/conversation/messages/text/unfurl/prompt-list/container.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {useOrdinal} from '@/chat/conversation/messages/ids-context' import * as T from '@/constants/types' diff --git a/shared/chat/conversation/messages/text/unfurl/unfurl-list/generic.tsx b/shared/chat/conversation/messages/text/unfurl/unfurl-list/generic.tsx index 444f2452a61e..51105368b6e1 100644 --- a/shared/chat/conversation/messages/text/unfurl/unfurl-list/generic.tsx +++ b/shared/chat/conversation/messages/text/unfurl/unfurl-list/generic.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters/index' import * as T from '@/constants/types' import * as React from 'react' diff --git a/shared/chat/conversation/messages/text/unfurl/unfurl-list/giphy.tsx b/shared/chat/conversation/messages/text/unfurl/unfurl-list/giphy.tsx index 3e97b16ef8fd..238515cda7c3 100644 --- a/shared/chat/conversation/messages/text/unfurl/unfurl-list/giphy.tsx +++ b/shared/chat/conversation/messages/text/unfurl/unfurl-list/giphy.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters/index' import * as React from 'react' import UnfurlImage from './image' diff --git a/shared/chat/conversation/messages/text/unfurl/unfurl-list/image/index.tsx b/shared/chat/conversation/messages/text/unfurl/unfurl-list/image/index.tsx index a826e6dc5e04..e2a3ba2f2c5d 100644 --- a/shared/chat/conversation/messages/text/unfurl/unfurl-list/image/index.tsx +++ b/shared/chat/conversation/messages/text/unfurl/unfurl-list/image/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import * as Kb from '@/common-adapters/index' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import {maxWidth} from '@/chat/conversation/messages/attachment/shared' import {Video} from './video' import openURL from '@/util/open-url' diff --git a/shared/chat/conversation/messages/text/unfurl/unfurl-list/index.tsx b/shared/chat/conversation/messages/text/unfurl/unfurl-list/index.tsx index 1aa89030311a..65c37cb40387 100644 --- a/shared/chat/conversation/messages/text/unfurl/unfurl-list/index.tsx +++ b/shared/chat/conversation/messages/text/unfurl/unfurl-list/index.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as React from 'react' import UnfurlGeneric from './generic' diff --git a/shared/chat/conversation/messages/text/unfurl/unfurl-list/map-popup.tsx b/shared/chat/conversation/messages/text/unfurl/unfurl-list/map-popup.tsx index 243034849db6..59e03f3db1c5 100644 --- a/shared/chat/conversation/messages/text/unfurl/unfurl-list/map-popup.tsx +++ b/shared/chat/conversation/messages/text/unfurl/unfurl-list/map-popup.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters/index' import type * as T from '@/constants/types' import openURL from '@/util/open-url' import LocationMap from '@/chat/location-map' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' type Props = { coord: T.Chat.Coordinate diff --git a/shared/chat/conversation/messages/text/unfurl/unfurl-list/map.tsx b/shared/chat/conversation/messages/text/unfurl/unfurl-list/map.tsx index 2cf754f6891e..68ec76e60397 100644 --- a/shared/chat/conversation/messages/text/unfurl/unfurl-list/map.tsx +++ b/shared/chat/conversation/messages/text/unfurl/unfurl-list/map.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters/index' import * as T from '@/constants/types' import * as React from 'react' diff --git a/shared/chat/conversation/messages/text/unfurl/unfurl-list/use-state.tsx b/shared/chat/conversation/messages/text/unfurl/unfurl-list/use-state.tsx index 4a7fddb9d9dd..1092daf24b90 100644 --- a/shared/chat/conversation/messages/text/unfurl/unfurl-list/use-state.tsx +++ b/shared/chat/conversation/messages/text/unfurl/unfurl-list/use-state.tsx @@ -1,7 +1,7 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import type * as T from '@/constants/types' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' export const useActions = (youAreAuthor: boolean, messageID: T.Chat.MessageID, ordinal: T.Chat.Ordinal) => { const unfurlRemove = Chat.useChatContext(s => s.dispatch.unfurlRemove) diff --git a/shared/chat/conversation/messages/text/wrapper.tsx b/shared/chat/conversation/messages/text/wrapper.tsx index d3a6ed554bae..c1b077922b4b 100644 --- a/shared/chat/conversation/messages/text/wrapper.tsx +++ b/shared/chat/conversation/messages/text/wrapper.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import {useReply} from './reply' diff --git a/shared/chat/conversation/messages/wrapper/edited.tsx b/shared/chat/conversation/messages/wrapper/edited.tsx index bc39cbae643b..a3e2d0df2fbe 100644 --- a/shared/chat/conversation/messages/wrapper/edited.tsx +++ b/shared/chat/conversation/messages/wrapper/edited.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import {useIsHighlighted, useOrdinal} from '../ids-context' diff --git a/shared/chat/conversation/messages/wrapper/exploding-height-retainer/container.tsx b/shared/chat/conversation/messages/wrapper/exploding-height-retainer/container.tsx index fae3926d1218..0fc71930593c 100644 --- a/shared/chat/conversation/messages/wrapper/exploding-height-retainer/container.tsx +++ b/shared/chat/conversation/messages/wrapper/exploding-height-retainer/container.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import ExplodingHeightRetainer from '.' import {useOrdinal} from '../../ids-context' diff --git a/shared/chat/conversation/messages/wrapper/exploding-meta.tsx b/shared/chat/conversation/messages/wrapper/exploding-meta.tsx index c6a3a6c1bdde..fa796f6b0354 100644 --- a/shared/chat/conversation/messages/wrapper/exploding-meta.tsx +++ b/shared/chat/conversation/messages/wrapper/exploding-meta.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {useIsHighlighted, useOrdinal} from '../ids-context' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/messages/wrapper/long-pressable/index.native.tsx b/shared/chat/conversation/messages/wrapper/long-pressable/index.native.tsx index f5d163fce1c0..72f39ea87942 100644 --- a/shared/chat/conversation/messages/wrapper/long-pressable/index.native.tsx +++ b/shared/chat/conversation/messages/wrapper/long-pressable/index.native.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import type {Props} from '.' diff --git a/shared/chat/conversation/messages/wrapper/send-indicator.tsx b/shared/chat/conversation/messages/wrapper/send-indicator.tsx index 4f5df715d762..6f197da1ed5a 100644 --- a/shared/chat/conversation/messages/wrapper/send-indicator.tsx +++ b/shared/chat/conversation/messages/wrapper/send-indicator.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import {useOrdinal} from '../ids-context' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/chat/conversation/messages/wrapper/wrapper.tsx b/shared/chat/conversation/messages/wrapper/wrapper.tsx index d1c4186278d0..e4f0a9609e36 100644 --- a/shared/chat/conversation/messages/wrapper/wrapper.tsx +++ b/shared/chat/conversation/messages/wrapper/wrapper.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import {MessageContext, useOrdinal} from '../ids-context' @@ -13,7 +13,7 @@ import SendIndicator from './send-indicator' import * as T from '@/constants/types' import capitalize from 'lodash/capitalize' import {useEdited} from './edited' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' // import {useDebugLayout} from '@/util/debug-react' export type Props = { diff --git a/shared/chat/conversation/normal/container.tsx b/shared/chat/conversation/normal/container.tsx index dbbb9157900a..dc1ee30496aa 100644 --- a/shared/chat/conversation/normal/container.tsx +++ b/shared/chat/conversation/normal/container.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useConfigState} from '@/constants/config' +import * as Chat from '@/stores/chat2' +import {useConfigState} from '@/stores/config' import * as React from 'react' import Normal from '.' import * as T from '@/constants/types' diff --git a/shared/chat/conversation/normal/index.desktop.tsx b/shared/chat/conversation/normal/index.desktop.tsx index 645314cf0f43..2e5dde5320c0 100644 --- a/shared/chat/conversation/normal/index.desktop.tsx +++ b/shared/chat/conversation/normal/index.desktop.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import Banner from '../bottom-banner' diff --git a/shared/chat/conversation/normal/index.native.tsx b/shared/chat/conversation/normal/index.native.tsx index b51457ece826..bfb4263d9019 100644 --- a/shared/chat/conversation/normal/index.native.tsx +++ b/shared/chat/conversation/normal/index.native.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import {PortalHost} from '@/common-adapters/portal.native' import * as Kb from '@/common-adapters' import * as React from 'react' diff --git a/shared/chat/conversation/pinned-message.tsx b/shared/chat/conversation/pinned-message.tsx index c1bee40e5890..9e18af274b21 100644 --- a/shared/chat/conversation/pinned-message.tsx +++ b/shared/chat/conversation/pinned-message.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' const PinnedMessage = React.memo(function PinnedMessage() { const {conversationIDKey, teamname, pinnedMsg, replyJump, onIgnore, pinMessage} = Chat.useChatContext( diff --git a/shared/chat/conversation/rekey/container.tsx b/shared/chat/conversation/rekey/container.tsx index d4397fb0346a..8cc2428b7f7b 100644 --- a/shared/chat/conversation/rekey/container.tsx +++ b/shared/chat/conversation/rekey/container.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useProfileState} from '@/constants/profile' -import {useCurrentUserState} from '@/constants/current-user' +import * as Chat from '@/stores/chat2' +import {useProfileState} from '@/stores/profile' +import {useCurrentUserState} from '@/stores/current-user' import * as T from '@/constants/types' import ParticipantRekey from './participant-rekey' import YouRekey from './you-rekey' diff --git a/shared/chat/conversation/reply-preview.tsx b/shared/chat/conversation/reply-preview.tsx index 4997bad338bd..b194fb2091cb 100644 --- a/shared/chat/conversation/reply-preview.tsx +++ b/shared/chat/conversation/reply-preview.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' diff --git a/shared/chat/conversation/search.tsx b/shared/chat/conversation/search.tsx index 20d9d78fa081..455b96ee6743 100644 --- a/shared/chat/conversation/search.tsx +++ b/shared/chat/conversation/search.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import type * as Styles from '@/styles' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/chat/create-channel/hooks.tsx b/shared/chat/create-channel/hooks.tsx index ec52505df5e5..ae69f3d75443 100644 --- a/shared/chat/create-channel/hooks.tsx +++ b/shared/chat/create-channel/hooks.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import upperFirst from 'lodash/upperFirst' import type {Props} from '.' diff --git a/shared/chat/delete-history-warning.tsx b/shared/chat/delete-history-warning.tsx index 1e748facdc92..47ffafd71431 100644 --- a/shared/chat/delete-history-warning.tsx +++ b/shared/chat/delete-history-warning.tsx @@ -1,6 +1,6 @@ import * as Kb from '@/common-adapters' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import MaybePopup from './maybe-popup' const DeleteHistoryWarning = () => { diff --git a/shared/chat/emoji-picker/container.tsx b/shared/chat/emoji-picker/container.tsx index abe1b741f551..34376fe70b98 100644 --- a/shared/chat/emoji-picker/container.tsx +++ b/shared/chat/emoji-picker/container.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Teams from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' diff --git a/shared/chat/inbox-and-conversation-2.tsx b/shared/chat/inbox-and-conversation-2.tsx index 730766b62d5b..f0a13e01420a 100644 --- a/shared/chat/inbox-and-conversation-2.tsx +++ b/shared/chat/inbox-and-conversation-2.tsx @@ -1,6 +1,6 @@ // Just for desktop and tablet, we show inbox and conversation side by side import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import type * as T from '@/constants/types' diff --git a/shared/chat/inbox-and-conversation-header.tsx b/shared/chat/inbox-and-conversation-header.tsx index 157b61f73d3b..46fba91a82b5 100644 --- a/shared/chat/inbox-and-conversation-header.tsx +++ b/shared/chat/inbox-and-conversation-header.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import type {StyleOverride} from '@/common-adapters/markdown' @@ -7,9 +7,9 @@ import SearchRow from './inbox/search-row' import NewChatButton from './inbox/new-chat-button' import {useRoute} from '@react-navigation/native' import type {RootRouteProps} from '@/router-v2/route-params' -import {useUsersState} from '@/constants/users' -import {useCurrentUserState} from '@/constants/current-user' -import * as Teams from '@/constants/teams' +import {useUsersState} from '@/stores/users' +import {useCurrentUserState} from '@/stores/current-user' +import * as Teams from '@/stores/teams' const Header = () => { const {params} = useRoute>() diff --git a/shared/chat/inbox-search/index.tsx b/shared/chat/inbox-search/index.tsx index f85ab2edb2d3..823e2b970a33 100644 --- a/shared/chat/inbox-search/index.tsx +++ b/shared/chat/inbox-search/index.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useTeamsState} from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import * as React from 'react' import Rover from './background' diff --git a/shared/chat/inbox/container.tsx b/shared/chat/inbox/container.tsx index a8f303cc416c..210348d199d1 100644 --- a/shared/chat/inbox/container.tsx +++ b/shared/chat/inbox/container.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as T from '@/constants/types' import Inbox, {type Props} from '.' diff --git a/shared/chat/inbox/filter-row.tsx b/shared/chat/inbox/filter-row.tsx index 8a5651be6445..1d7214f8b4c1 100644 --- a/shared/chat/inbox/filter-row.tsx +++ b/shared/chat/inbox/filter-row.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/chat/inbox/index.native.tsx b/shared/chat/inbox/index.native.tsx index 3a33bbcbe653..41cafa1c706e 100644 --- a/shared/chat/inbox/index.native.tsx +++ b/shared/chat/inbox/index.native.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import * as RowSizes from './row/sizes' diff --git a/shared/chat/inbox/new-chat-button.tsx b/shared/chat/inbox/new-chat-button.tsx index e6987c1ddc92..bb086547ac38 100644 --- a/shared/chat/inbox/new-chat-button.tsx +++ b/shared/chat/inbox/new-chat-button.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/chat/inbox/row/big-team-channel.tsx b/shared/chat/inbox/row/big-team-channel.tsx index 79a4e46f06f3..e4089507b3b3 100644 --- a/shared/chat/inbox/row/big-team-channel.tsx +++ b/shared/chat/inbox/row/big-team-channel.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import * as RowSizes from './sizes' diff --git a/shared/chat/inbox/row/big-team-header.tsx b/shared/chat/inbox/row/big-team-header.tsx index b4cf9085a9b0..0fc4172f6497 100644 --- a/shared/chat/inbox/row/big-team-header.tsx +++ b/shared/chat/inbox/row/big-team-header.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as RowSizes from './sizes' import type * as T from '@/constants/types' diff --git a/shared/chat/inbox/row/big-teams-divider.tsx b/shared/chat/inbox/row/big-teams-divider.tsx index 35fc6ab594b1..547f2e267670 100644 --- a/shared/chat/inbox/row/big-teams-divider.tsx +++ b/shared/chat/inbox/row/big-teams-divider.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import * as RowSizes from './sizes' diff --git a/shared/chat/inbox/row/build-team.tsx b/shared/chat/inbox/row/build-team.tsx index 7f6415928fed..822260af2b68 100644 --- a/shared/chat/inbox/row/build-team.tsx +++ b/shared/chat/inbox/row/build-team.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' diff --git a/shared/chat/inbox/row/opened-row-state.tsx b/shared/chat/inbox/row/opened-row-state.tsx index f32a8b91ce9a..29c1d4c415ff 100644 --- a/shared/chat/inbox/row/opened-row-state.tsx +++ b/shared/chat/inbox/row/opened-row-state.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Z from '@/util/zustand' import type * as T from '@/constants/types' diff --git a/shared/chat/inbox/row/small-team/bottom-line.tsx b/shared/chat/inbox/row/small-team/bottom-line.tsx index eccb3d94d2bb..1dfbc213d35e 100644 --- a/shared/chat/inbox/row/small-team/bottom-line.tsx +++ b/shared/chat/inbox/row/small-team/bottom-line.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import {SnippetContext, SnippetDecorationContext} from './contexts' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type Props = { layoutSnippet?: string diff --git a/shared/chat/inbox/row/small-team/index.tsx b/shared/chat/inbox/row/small-team/index.tsx index 869aaa3a9957..f0289b126b34 100644 --- a/shared/chat/inbox/row/small-team/index.tsx +++ b/shared/chat/inbox/row/small-team/index.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import {SimpleTopLine} from './top-line' @@ -9,7 +9,7 @@ import * as RowSizes from '../sizes' import * as T from '@/constants/types' import SwipeConvActions from './swipe-conv-actions' import './small-team.css' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' import { IsTeamContext, ParticipantsContext, diff --git a/shared/chat/inbox/row/small-team/swipe-conv-actions/index.native.tsx b/shared/chat/inbox/row/small-team/swipe-conv-actions/index.native.tsx index 5ec1de0c2ee2..94ff76ff16f9 100644 --- a/shared/chat/inbox/row/small-team/swipe-conv-actions/index.native.tsx +++ b/shared/chat/inbox/row/small-team/swipe-conv-actions/index.native.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import * as Reanimated from 'react-native-reanimated' diff --git a/shared/chat/inbox/row/small-team/top-line.tsx b/shared/chat/inbox/row/small-team/top-line.tsx index 86825d823584..3e45c439e679 100644 --- a/shared/chat/inbox/row/small-team/top-line.tsx +++ b/shared/chat/inbox/row/small-team/top-line.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import TeamMenu from '@/chat/conversation/info-panel/menu' diff --git a/shared/chat/inbox/row/teams-divider.tsx b/shared/chat/inbox/row/teams-divider.tsx index 282156d7da76..a45090ee43b3 100644 --- a/shared/chat/inbox/row/teams-divider.tsx +++ b/shared/chat/inbox/row/teams-divider.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import * as React from 'react' diff --git a/shared/chat/inbox/search-row.tsx b/shared/chat/inbox/search-row.tsx index c97a2cc786bd..ceedb67615a9 100644 --- a/shared/chat/inbox/search-row.tsx +++ b/shared/chat/inbox/search-row.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import ChatFilterRow from './filter-row' import StartNewChat from './row/start-new-chat' diff --git a/shared/chat/new-team-dialog-container.tsx b/shared/chat/new-team-dialog-container.tsx index 0421c30d6fef..4c4d1864c28e 100644 --- a/shared/chat/new-team-dialog-container.tsx +++ b/shared/chat/new-team-dialog-container.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import {CreateNewTeam} from '../teams/new-team' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import upperFirst from 'lodash/upperFirst' const NewTeamDialog = () => { diff --git a/shared/chat/payments/status/index.tsx b/shared/chat/payments/status/index.tsx index 3fe3ec65668b..05236a073498 100644 --- a/shared/chat/payments/status/index.tsx +++ b/shared/chat/payments/status/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import * as Styles from '@/styles' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import PaymentStatusError from './error' import Text from '@/common-adapters/text' import {Box2} from '@/common-adapters/box' @@ -9,7 +9,7 @@ import type * as T from '@/constants/types' import type {MeasureRef} from '@/common-adapters/measure-ref' import type * as WalletTypes from '@/constants/types/wallets' import {useOrdinal} from '@/chat/conversation/messages/ids-context' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' // This is actually a dependency of common-adapters/markdown so we have to treat it like a common-adapter, no * import allowed const Kb = { diff --git a/shared/chat/pdf/index.desktop.tsx b/shared/chat/pdf/index.desktop.tsx index d0c53c8853c4..6fcee8301fc1 100644 --- a/shared/chat/pdf/index.desktop.tsx +++ b/shared/chat/pdf/index.desktop.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import type {Props} from '.' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const ChatPDF = (props: Props) => { const {ordinal} = props diff --git a/shared/chat/pdf/index.native.tsx b/shared/chat/pdf/index.native.tsx index 044e8691e00b..8f6253a027d2 100644 --- a/shared/chat/pdf/index.native.tsx +++ b/shared/chat/pdf/index.native.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import type {Props} from '.' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const ChatPDF = (props: Props) => { const {ordinal, url} = props diff --git a/shared/chat/routes.tsx b/shared/chat/routes.tsx index b34bfe654bdd..d9dcd49db022 100644 --- a/shared/chat/routes.tsx +++ b/shared/chat/routes.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import chatNewChat from '../team-building/page' import {headerNavigationOptions} from './conversation/header-area' import inboxGetOptions from './inbox/get-options' diff --git a/shared/chat/selectable-big-team-channel-container.tsx b/shared/chat/selectable-big-team-channel-container.tsx index 19af38e9941a..35e0b58f9614 100644 --- a/shared/chat/selectable-big-team-channel-container.tsx +++ b/shared/chat/selectable-big-team-channel-container.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import SelectableBigTeamChannel from './selectable-big-team-channel' type OwnProps = { diff --git a/shared/chat/selectable-small-team-container.tsx b/shared/chat/selectable-small-team-container.tsx index 2248c71d3a05..0a1f5f44b24a 100644 --- a/shared/chat/selectable-small-team-container.tsx +++ b/shared/chat/selectable-small-team-container.tsx @@ -1,8 +1,8 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import type {AllowedColors} from '@/common-adapters/text' import SelectableSmallTeam from './selectable-small-team' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = { filter?: string diff --git a/shared/chat/send-to-chat/index.tsx b/shared/chat/send-to-chat/index.tsx index 2bba86a3e4df..0b6d8b22f634 100644 --- a/shared/chat/send-to-chat/index.tsx +++ b/shared/chat/send-to-chat/index.tsx @@ -1,14 +1,14 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import * as React from 'react' import * as Kb from '@/common-adapters' import * as Kbfs from '@/fs/common' import ConversationList from './conversation-list/conversation-list' import ChooseConversation from './conversation-list/choose-conversation' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' type Props = { canBack?: boolean diff --git a/shared/common-adapters/avatar/hooks.tsx b/shared/common-adapters/avatar/hooks.tsx index 0307b138030d..e1177a28b72f 100644 --- a/shared/common-adapters/avatar/hooks.tsx +++ b/shared/common-adapters/avatar/hooks.tsx @@ -1,5 +1,5 @@ // High level avatar class. Handdles converting from usernames to urls. Deals with testing mode. -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as React from 'react' import {iconTypeToImgSet, urlsToImgSet, urlsToSrcSet, urlsToBaseSrc, type IconType} from '../icon' import * as Styles from '@/styles' @@ -7,9 +7,9 @@ import * as AvatarZus from './store' import './avatar.css' import type {Props} from '.' import {useColorScheme} from 'react-native' -import {useUsersState} from '@/constants/users' -import {useFollowerState} from '@/constants/followers' -import {navToProfile} from '@/constants/router2' +import {useUsersState} from '@/stores/users' +import {useFollowerState} from '@/stores/followers' +import {navToProfile} from '@/stores/router2' export const avatarSizes = [128, 96, 64, 48, 32, 24, 16] as const export type AvatarSize = (typeof avatarSizes)[number] diff --git a/shared/common-adapters/avatar/util.tsx b/shared/common-adapters/avatar/util.tsx deleted file mode 100644 index 6e08e360ab2f..000000000000 --- a/shared/common-adapters/avatar/util.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import {useAvatarState} from '@/common-adapters/avatar/store' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyTeamAvatarUpdated: { - const {name} = action.payload.params - useAvatarState.getState().dispatch.updated(name) - break - } - default: - } -} - diff --git a/shared/common-adapters/copy-text.tsx b/shared/common-adapters/copy-text.tsx index 7942082307fb..505513bd6efd 100644 --- a/shared/common-adapters/copy-text.tsx +++ b/shared/common-adapters/copy-text.tsx @@ -8,7 +8,7 @@ import {useTimeout} from './use-timers' import * as Styles from '@/styles' import logger from '@/logger' import type {MeasureRef} from './measure-ref' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const Kb = { Box2Measure, diff --git a/shared/common-adapters/markdown/channel.tsx b/shared/common-adapters/markdown/channel.tsx index 55a2dc3d237e..a80546942696 100644 --- a/shared/common-adapters/markdown/channel.tsx +++ b/shared/common-adapters/markdown/channel.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import type * as T from '@/constants/types' import Text, {type StylesTextCrossPlatform} from '../text' import * as React from 'react' diff --git a/shared/common-adapters/markdown/maybe-mention/index.tsx b/shared/common-adapters/markdown/maybe-mention/index.tsx index 33431631f674..86bbe6a0a396 100644 --- a/shared/common-adapters/markdown/maybe-mention/index.tsx +++ b/shared/common-adapters/markdown/maybe-mention/index.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import Text, {type StylesTextCrossPlatform} from '@/common-adapters/text' import Mention from '../../mention-container' diff --git a/shared/common-adapters/markdown/maybe-mention/team.tsx b/shared/common-adapters/markdown/maybe-mention/team.tsx index 90bd396a1ee5..e9b7f234f06b 100644 --- a/shared/common-adapters/markdown/maybe-mention/team.tsx +++ b/shared/common-adapters/markdown/maybe-mention/team.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as React from 'react' import Text, {type StylesTextCrossPlatform} from '@/common-adapters/text' import {Box2} from '@/common-adapters/box' diff --git a/shared/common-adapters/mention-container.tsx b/shared/common-adapters/mention-container.tsx index 7cd4ab40f54f..f7044658c04c 100644 --- a/shared/common-adapters/mention-container.tsx +++ b/shared/common-adapters/mention-container.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import Mention, {type OwnProps} from './mention' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' const Container = (ownProps: OwnProps) => { let {username} = ownProps diff --git a/shared/common-adapters/mention.tsx b/shared/common-adapters/mention.tsx index 468c66b4297e..973ec7212085 100644 --- a/shared/common-adapters/mention.tsx +++ b/shared/common-adapters/mention.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Styles from '@/styles' import {WithProfileCardPopup} from './profile-card' import Text from './text' diff --git a/shared/common-adapters/name-with-icon.tsx b/shared/common-adapters/name-with-icon.tsx index fdadf76d3ba6..07c7f2c4f3c7 100644 --- a/shared/common-adapters/name-with-icon.tsx +++ b/shared/common-adapters/name-with-icon.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as Styles from '@/styles' import * as C from '@/constants' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import Avatar, {type AvatarSize} from './avatar' import {Box} from './box' import ClickableBox from './clickable-box' @@ -13,8 +13,8 @@ import Text, { type TextTypeBold, } from './text' import ConnectedUsernames from './usernames' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' type Size = 'smaller' | 'small' | 'default' | 'big' | 'huge' diff --git a/shared/common-adapters/profile-card.tsx b/shared/common-adapters/profile-card.tsx index 933bfa706f49..a053acccd437 100644 --- a/shared/common-adapters/profile-card.tsx +++ b/shared/common-adapters/profile-card.tsx @@ -2,7 +2,7 @@ import * as C from '@/constants' import * as React from 'react' import * as Styles from '@/styles' import * as Platforms from '@/util/platforms' -import * as Tracker from '@/constants/tracker2' +import * as Tracker from '@/stores/tracker2' import type * as T from '@/constants/types' import capitalize from 'lodash/capitalize' import Box, {Box2, Box2Measure} from './box' @@ -12,16 +12,16 @@ import {_setWithProfileCardPopup} from './usernames' import FloatingMenu from './floating-menu' import Icon from './icon' import Meta from './meta' -import {useProfileState} from '@/constants/profile' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' +import {useProfileState} from '@/stores/profile' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' import ProgressIndicator from './progress-indicator' import Text from './text' import WithTooltip from './with-tooltip' import DelayedMounting from './delayed-mounting' import {type default as FollowButtonType} from '../profile/user/actions/follow-button' import type ChatButtonType from '../chat/chat-button' -import {useTrackerState} from '@/constants/tracker2' +import {useTrackerState} from '@/stores/tracker2' import type {MeasureRef} from './measure-ref' const positionFallbacks = ['top center', 'bottom center'] as const diff --git a/shared/common-adapters/proof-broken-banner.tsx b/shared/common-adapters/proof-broken-banner.tsx index 861ead336641..e1ecfd0cb296 100644 --- a/shared/common-adapters/proof-broken-banner.tsx +++ b/shared/common-adapters/proof-broken-banner.tsx @@ -1,8 +1,8 @@ import * as C from '@/constants' import * as React from 'react' import {Banner, BannerParagraph} from './banner' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' const Kb = {Banner} type Props = {users?: Array} diff --git a/shared/common-adapters/reload.tsx b/shared/common-adapters/reload.tsx index a3e150277db7..08fe71c05cd7 100644 --- a/shared/common-adapters/reload.tsx +++ b/shared/common-adapters/reload.tsx @@ -10,7 +10,7 @@ import Button from './button' import Icon from './icon' import type {RPCError} from '@/util/errors' import {settingsFeedbackTab} from '@/constants/settings/util' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const Kb = { Box2, diff --git a/shared/common-adapters/team-with-popup.tsx b/shared/common-adapters/team-with-popup.tsx index 4059c9608948..f907e5e1ca80 100644 --- a/shared/common-adapters/team-with-popup.tsx +++ b/shared/common-adapters/team-with-popup.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import {Box2} from './box' import * as Styles from '@/styles' diff --git a/shared/common-adapters/usernames.tsx b/shared/common-adapters/usernames.tsx index e86fcb564666..570f91b6abab 100644 --- a/shared/common-adapters/usernames.tsx +++ b/shared/common-adapters/usernames.tsx @@ -12,11 +12,11 @@ import Text, { import {backgroundModeIsNegative} from './text.shared' import isArray from 'lodash/isArray' import type {e164ToDisplay as e164ToDisplayType} from '@/util/phone-numbers' -import {useTrackerState} from '@/constants/tracker2' -import {useUsersState} from '@/constants/users' -import {useProfileState} from '@/constants/profile' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useUsersState} from '@/stores/users' +import {useProfileState} from '@/stores/profile' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' export type User = { username: string diff --git a/shared/common-adapters/wave-button.tsx b/shared/common-adapters/wave-button.tsx index 40a33f359a66..63a8ab05699a 100644 --- a/shared/common-adapters/wave-button.tsx +++ b/shared/common-adapters/wave-button.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import {Box2, Box} from './box' import Icon from './icon' diff --git a/shared/constants/archive/util.tsx b/shared/constants/archive/util.tsx deleted file mode 100644 index 3be104f15ecb..000000000000 --- a/shared/constants/archive/util.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import type * as UseArchiveStateType from '../archive' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifySimpleFSSimpleFSArchiveStatusChanged: - case EngineGen.chat1NotifyChatChatArchiveComplete: - case EngineGen.chat1NotifyChatChatArchiveProgress: - { - const {useArchiveState} = require('../archive') as typeof UseArchiveStateType - useArchiveState.getState().dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/autoreset/util.tsx b/shared/constants/autoreset/util.tsx deleted file mode 100644 index ccaa494f61a0..000000000000 --- a/shared/constants/autoreset/util.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyBadgesBadgeState: - { - storeRegistry.getState('autoreset').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/bots/util.tsx b/shared/constants/bots/util.tsx deleted file mode 100644 index 1af60048ec8d..000000000000 --- a/shared/constants/bots/util.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import type * as T from '../types' -import {storeRegistry} from '../store-registry' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyFeaturedBotsFeaturedBotsUpdate: - { - storeRegistry.getState('bots').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} - - -export const getFeaturedSorted = ( - featuredBotsMap: ReadonlyMap -): Array => { - const featured = [...featuredBotsMap.values()] - featured.sort((a: T.RPCGen.FeaturedBot, b: T.RPCGen.FeaturedBot) => { - if (a.rank < b.rank) { - return 1 - } else if (a.rank > b.rank) { - return -1 - } - return 0 - }) - return featured -} diff --git a/shared/constants/chat2/common.tsx b/shared/constants/chat2/common.tsx index 8c63c456b387..c16ed15eb76f 100644 --- a/shared/constants/chat2/common.tsx +++ b/shared/constants/chat2/common.tsx @@ -1,7 +1,7 @@ import * as T from '../types' import {isMobile, isTablet} from '../platform' -import * as Router2 from '../router2' -import {useConfigState} from '../config' +import * as Router2 from '@/stores/router2' +import {useConfigState} from '@/stores/config' export const explodingModeGregorKeyPrefix = 'exploding:' diff --git a/shared/constants/chat2/convostate.tsx b/shared/constants/chat2/convostate.tsx index fe96a91842d7..a1c4d33dd1df 100644 --- a/shared/constants/chat2/convostate.tsx +++ b/shared/constants/chat2/convostate.tsx @@ -47,8 +47,8 @@ import {enumKeys, ignorePromise, shallowEqual} from '../utils' import * as Strings from '@/constants/strings' import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' -import {useCurrentUserState} from '../current-user' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' const {darwinCopyToChatTempUploadFile} = KB2.functions diff --git a/shared/constants/chat2/debug.tsx b/shared/constants/chat2/debug.tsx index ba94fb89a7f8..e91c336a2aca 100644 --- a/shared/constants/chat2/debug.tsx +++ b/shared/constants/chat2/debug.tsx @@ -1,5 +1,5 @@ // Debug utilities for chat -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import type * as T from '@/constants/types' import logger from '@/logger' diff --git a/shared/constants/chat2/meta.tsx b/shared/constants/chat2/meta.tsx index 243060f08637..93b889627441 100644 --- a/shared/constants/chat2/meta.tsx +++ b/shared/constants/chat2/meta.tsx @@ -5,7 +5,7 @@ import * as Teams from '../teams/util' import * as Message from './message' import {base64ToUint8Array, uint8ArrayToHex} from 'uint8array-extras' import {storeRegistry} from '../store-registry' -import {useCurrentUserState} from '../current-user' +import {useCurrentUserState} from '@/stores/current-user' const conversationMemberStatusToMembershipType = (m: T.RPCChat.ConversationMemberStatus) => { switch (m) { @@ -41,9 +41,9 @@ export const unverifiedInboxUIItemToConversationMeta = ( // We only treat implicit adhoc teams as having resetParticipants const resetParticipants: Set = new Set( i.localMetadata && - (i.membersType === T.RPCChat.ConversationMembersType.impteamnative || - i.membersType === T.RPCChat.ConversationMembersType.impteamupgrade) && - i.localMetadata.resetParticipants + (i.membersType === T.RPCChat.ConversationMembersType.impteamnative || + i.membersType === T.RPCChat.ConversationMembersType.impteamupgrade) && + i.localMetadata.resetParticipants ? i.localMetadata.resetParticipants : [] ) @@ -237,7 +237,7 @@ export const inboxUIItemToConversationMeta = ( const resetParticipants = new Set( (i.membersType === T.RPCChat.ConversationMembersType.impteamnative || i.membersType === T.RPCChat.ConversationMembersType.impteamupgrade) && - i.resetParticipants + i.resetParticipants ? i.resetParticipants : [] ) diff --git a/shared/constants/chat2/util.tsx b/shared/constants/chat2/util.tsx index a1e5b2c74fc6..e69de29bb2d1 100644 --- a/shared/constants/chat2/util.tsx +++ b/shared/constants/chat2/util.tsx @@ -1,61 +0,0 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' - -export const onEngineConnected = () => { - const f = async () => { - try { - await T.RPCGen.delegateUiCtlRegisterChatUIRpcPromise() - await T.RPCGen.delegateUiCtlRegisterLogUIRpcPromise() - console.log('Registered Chat UI') - } catch (error) { - console.warn('Error in registering Chat UI:', error) - } - } - ignorePromise(f()) -} - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.chat1ChatUiChatInboxFailed: - case EngineGen.chat1NotifyChatChatSetConvSettings: - case EngineGen.chat1NotifyChatChatAttachmentUploadStart: - case EngineGen.chat1NotifyChatChatPromptUnfurl: - case EngineGen.chat1NotifyChatChatPaymentInfo: - case EngineGen.chat1NotifyChatChatRequestInfo: - case EngineGen.chat1NotifyChatChatAttachmentDownloadProgress: - case EngineGen.chat1NotifyChatChatAttachmentDownloadComplete: - case EngineGen.chat1NotifyChatChatAttachmentUploadProgress: - case EngineGen.chat1ChatUiChatCommandMarkdown: - case EngineGen.chat1ChatUiChatGiphyToggleResultWindow: - case EngineGen.chat1ChatUiChatCommandStatus: - case EngineGen.chat1ChatUiChatBotCommandsUpdateStatus: - case EngineGen.chat1ChatUiChatGiphySearchResults: - case EngineGen.chat1NotifyChatChatParticipantsInfo: - case EngineGen.chat1ChatUiChatMaybeMentionUpdate: - case EngineGen.chat1NotifyChatChatConvUpdate: - case EngineGen.chat1ChatUiChatCoinFlipStatus: - case EngineGen.chat1NotifyChatChatThreadsStale: - case EngineGen.chat1NotifyChatChatSubteamRename: - case EngineGen.chat1NotifyChatChatTLFFinalize: - case EngineGen.chat1NotifyChatChatIdentifyUpdate: - case EngineGen.chat1ChatUiChatInboxUnverified: - case EngineGen.chat1NotifyChatChatInboxSyncStarted: - case EngineGen.chat1NotifyChatChatInboxSynced: - case EngineGen.chat1ChatUiChatInboxLayout: - case EngineGen.chat1NotifyChatChatInboxStale: - case EngineGen.chat1ChatUiChatInboxConversation: - case EngineGen.chat1NotifyChatNewChatActivity: - case EngineGen.chat1NotifyChatChatTypingUpdate: - case EngineGen.chat1NotifyChatChatSetConvRetention: - case EngineGen.chat1NotifyChatChatSetTeamRetention: - case EngineGen.keybase1NotifyBadgesBadgeState: - case EngineGen.keybase1GregorUIPushState: - { - storeRegistry.getState('chat').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/deeplinks/index.tsx b/shared/constants/deeplinks/index.tsx index a81ec61f4f5f..998f184dc780 100644 --- a/shared/constants/deeplinks/index.tsx +++ b/shared/constants/deeplinks/index.tsx @@ -1,15 +1,14 @@ import * as Crypto from '../crypto/util' import * as Tabs from '../tabs' import {isPathSaltpackEncrypted, isPathSaltpackSigned} from '@/util/path' -import * as EngineGen from '@/actions/engine-gen-gen' import type HiddenString from '@/util/hidden-string' import URL from 'url-parse' import logger from '@/logger' import * as T from '@/constants/types' import {navigateAppend, switchTab} from '../router2/util' import {storeRegistry} from '../store-registry' -import {useCryptoState} from '../crypto' -import {useConfigState} from '../config' +import {useCryptoState} from '@/stores/crypto' +import {useConfigState} from '@/stores/config' const prefix = 'keybase://' export const linkFromConvAndMessage = (conv: string, messageID: number) => @@ -38,77 +37,77 @@ const validTeamnamePart = (s: string): boolean => { } const validTeamname = (s: string) => s.split('.').every(validTeamnamePart) - const handleShowUserProfileLink = (username: string) => { - switchTab(Tabs.peopleTab) - storeRegistry.getState('profile').dispatch.showUserProfile(username) - } +const handleShowUserProfileLink = (username: string) => { + switchTab(Tabs.peopleTab) + storeRegistry.getState('profile').dispatch.showUserProfile(username) +} - const isKeybaseIoUrl = (url: URL) => { - const {protocol} = url - if (protocol !== 'http:' && protocol !== 'https:') return false - if (url.username || url.password) return false - const {hostname} = url - if (hostname !== 'keybase.io' && hostname !== 'www.keybase.io') return false - const {port} = url - if (port) { - if (protocol === 'http:' && port !== '80') return false - if (protocol === 'https:' && port !== '443') return false - } - return true +const isKeybaseIoUrl = (url: URL) => { + const {protocol} = url + if (protocol !== 'http:' && protocol !== 'https:') return false + if (url.username || url.password) return false + const {hostname} = url + if (hostname !== 'keybase.io' && hostname !== 'www.keybase.io') return false + const {port} = url + if (port) { + if (protocol === 'http:' && port !== '80') return false + if (protocol === 'https:' && port !== '443') return false } + return true +} - const urlToUsername = (url: URL) => { - if (!isKeybaseIoUrl(url)) { - return null - } - // Adapted username regexp (see libkb/checkers.go) with a leading /, an - // optional trailing / and a dash for custom links. - const match = url.pathname.match(/^\/((?:[a-zA-Z0-9][a-zA-Z0-9_-]?)+)\/?$/) - if (!match) { - return null - } - const usernameMatch = match[1] - if (!usernameMatch || usernameMatch.length < 2 || usernameMatch.length > 16) { - return null - } - // Ignore query string and hash parameters. - return usernameMatch.toLowerCase() +const urlToUsername = (url: URL) => { + if (!isKeybaseIoUrl(url)) { + return null } - - const urlToTeamDeepLink = (url: URL) => { - if (!isKeybaseIoUrl(url)) { - return null - } - // Similar regexp to username but allow `.` for subteams - const match = url.pathname.match(/^\/team\/((?:[a-zA-Z0-9][a-zA-Z0-9_.-]?)+)\/?$/) - if (!match) { - return null - } - const teamName = match[1] - if (!teamName || teamName.length < 2 || teamName.length > 255) { - return null - } - // `url.query` has a wrong type in @types/url-parse. It's a `string` in the - // code, but @types claim it's a {[k: string]: string | undefined}. - const queryString = url.query as unknown as string - // URLSearchParams is not available in react-native. See if any of recognized - // query parameters is passed using regular expressions. - const action = (['add_or_invite', 'manage_settings'] satisfies readonly TeamPageAction[]).find( - x => queryString.search(`[?&]applink=${x}([?&].+)?$`) !== -1 - ) - return {action, teamName} + // Adapted username regexp (see libkb/checkers.go) with a leading /, an + // optional trailing / and a dash for custom links. + const match = url.pathname.match(/^\/((?:[a-zA-Z0-9][a-zA-Z0-9_-]?)+)\/?$/) + if (!match) { + return null + } + const usernameMatch = match[1] + if (!usernameMatch || usernameMatch.length < 2 || usernameMatch.length > 16) { + return null } + // Ignore query string and hash parameters. + return usernameMatch.toLowerCase() +} - const handleTeamPageLink = (teamname: string, action?: TeamPageAction) => { - storeRegistry - .getState('teams') - .dispatch.showTeamByName( - teamname, - action === 'manage_settings' ? 'settings' : undefined, - action === 'join' ? true : undefined, - action === 'add_or_invite' ? true : undefined - ) +const urlToTeamDeepLink = (url: URL) => { + if (!isKeybaseIoUrl(url)) { + return null } + // Similar regexp to username but allow `.` for subteams + const match = url.pathname.match(/^\/team\/((?:[a-zA-Z0-9][a-zA-Z0-9_.-]?)+)\/?$/) + if (!match) { + return null + } + const teamName = match[1] + if (!teamName || teamName.length < 2 || teamName.length > 255) { + return null + } + // `url.query` has a wrong type in @types/url-parse. It's a `string` in the + // code, but @types claim it's a {[k: string]: string | undefined}. + const queryString = url.query as unknown as string + // URLSearchParams is not available in react-native. See if any of recognized + // query parameters is passed using regular expressions. + const action = (['add_or_invite', 'manage_settings'] satisfies readonly TeamPageAction[]).find( + x => queryString.search(`[?&]applink=${x}([?&].+)?$`) !== -1 + ) + return {action, teamName} +} + +const handleTeamPageLink = (teamname: string, action?: TeamPageAction) => { + storeRegistry + .getState('teams') + .dispatch.showTeamByName( + teamname, + action === 'manage_settings' ? 'settings' : undefined, + action === 'join' ? true : undefined, + action === 'add_or_invite' ? true : undefined + ) +} export const handleAppLink = (link: string) => { if (link.startsWith('keybase://')) { @@ -147,9 +146,7 @@ export const handleKeybaseLink = (link: string) => { switch (parts[0]) { case 'profile': if (parts[1] === 'new-proof' && (parts.length === 3 || parts.length === 4)) { - parts.length === 4 && - parts[3] && - storeRegistry.getState('profile').dispatch.showUserProfile(parts[3]) + parts.length === 4 && parts[3] && storeRegistry.getState('profile').dispatch.showUserProfile(parts[3]) storeRegistry.getState('profile').dispatch.addProof(parts[2]!, 'appLink') return } else if (parts[1] === 'show' && parts.length === 3) { @@ -288,17 +285,3 @@ export const handleSaltPackOpen = (_path: string | HiddenString) => { useCryptoState.getState().dispatch.onSaltpackOpenFile(operation, path) switchTab(Tabs.cryptoTab) } - -export const onEngineIncomingImpl = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyServiceHandleKeybaseLink: { - const {link, deferred} = action.payload.params - if (deferred && !link.startsWith('keybase://team-invite-link/')) { - return - } - handleKeybaseLink(link) - break - } - default: - } -} diff --git a/shared/constants/deeplinks/util.tsx b/shared/constants/deeplinks/util.tsx deleted file mode 100644 index e5f2d279fcc6..000000000000 --- a/shared/constants/deeplinks/util.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import {onEngineIncomingImpl} from './index' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyServiceHandleKeybaseLink: - { - onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/devices/util.tsx b/shared/constants/devices/util.tsx deleted file mode 100644 index 23b3694282b6..000000000000 --- a/shared/constants/devices/util.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' - -let loaded = false - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyBadgesBadgeState: - { - const {badgeState} = action.payload.params - const {newDevices, revokedDevices} = badgeState - const hasValue = (newDevices?.length ?? 0) + (revokedDevices?.length ?? 0) > 0 - if (loaded || hasValue) { - loaded = true - storeRegistry.getState('devices').dispatch.onEngineIncomingImpl(action) - } - } - break - default: - } -} diff --git a/shared/constants/followers/util.tsx b/shared/constants/followers/util.tsx deleted file mode 100644 index 34ea577cab45..000000000000 --- a/shared/constants/followers/util.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import isEqual from 'lodash/isEqual' -import {useCurrentUserState} from '../current-user' -import {useFollowerState} from '../followers' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyTrackingTrackingChanged: { - const {isTracking, username} = action.payload.params - useFollowerState.getState().dispatch.updateFollowing(username, isTracking) - break - } - case EngineGen.keybase1NotifyTrackingTrackingInfo: { - const {uid, followers: _newFollowers, followees: _newFollowing} = action.payload.params - if (useCurrentUserState.getState().uid !== uid) { - return - } - const newFollowers = new Set(_newFollowers) - const newFollowing = new Set(_newFollowing) - const {following: oldFollowing, followers: oldFollowers, dispatch} = useFollowerState.getState() - const following = isEqual(newFollowing, oldFollowing) ? oldFollowing : newFollowing - const followers = isEqual(newFollowers, oldFollowers) ? oldFollowers : newFollowers - dispatch.replace(followers, following) - break - } - default: - } -} - diff --git a/shared/constants/fs/common.native.tsx b/shared/constants/fs/common.native.tsx index c75025efc827..920f0561993f 100644 --- a/shared/constants/fs/common.native.tsx +++ b/shared/constants/fs/common.native.tsx @@ -3,10 +3,10 @@ import {ignorePromise} from '../utils' import {wrapErrors} from '@/util/debug' import * as T from '../types' import * as Styles from '@/styles' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import {launchImageLibraryAsync} from '@/util/expo-image-picker.native' import {saveAttachmentToCameraRoll, showShareActionSheet} from '../platform-specific' -import {useFSState} from '.' +import {useFSState} from '@/stores/fs' export default function initNative() { useFSState.setState(s => { diff --git a/shared/constants/fs/platform-specific.android.tsx b/shared/constants/fs/platform-specific.android.tsx index 8e7f3ff2a04b..a31524a9b47e 100644 --- a/shared/constants/fs/platform-specific.android.tsx +++ b/shared/constants/fs/platform-specific.android.tsx @@ -1,9 +1,9 @@ import * as T from '../types' import {ignorePromise, wrapErrors} from '../utils' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import logger from '@/logger' import nativeInit from './common.native' -import {useFSState} from '.' +import {useFSState} from '@/stores/fs' import {androidAddCompleteDownload, fsCacheDir, fsDownloadDir} from 'react-native-kb' const finishedRegularDownloadIDs = new Set() @@ -26,43 +26,41 @@ export default function initPlatformSpecific() { // needs to be called, TODO could make this better s.dispatch.dynamic.afterKbfsDaemonRpcStatusChanged() - s.dispatch.dynamic.finishedRegularDownloadMobile = wrapErrors( - (downloadID: string, mimeType: string) => { - const f = async () => { - // This is fired from a hook and can happen more than once per downloadID. - // So just deduplicate them here. This is small enough and won't happen - // constantly, so don't worry about clearing them. - if (finishedRegularDownloadIDs.has(downloadID)) { - return - } - finishedRegularDownloadIDs.add(downloadID) + s.dispatch.dynamic.finishedRegularDownloadMobile = wrapErrors((downloadID: string, mimeType: string) => { + const f = async () => { + // This is fired from a hook and can happen more than once per downloadID. + // So just deduplicate them here. This is small enough and won't happen + // constantly, so don't worry about clearing them. + if (finishedRegularDownloadIDs.has(downloadID)) { + return + } + finishedRegularDownloadIDs.add(downloadID) - const {downloads} = useFSState.getState() + const {downloads} = useFSState.getState() - const downloadState = downloads.state.get(downloadID) || FS.emptyDownloadState - const downloadInfo = downloads.info.get(downloadID) || FS.emptyDownloadInfo - if (downloadState === FS.emptyDownloadState || downloadInfo === FS.emptyDownloadInfo) { - logger.warn('missing download', downloadID) - return - } - if (downloadState.error) { - return - } - try { - await androidAddCompleteDownload({ - description: `Keybase downloaded ${downloadInfo.filename}`, - mime: mimeType, - path: downloadState.localPath, - showNotification: true, - title: downloadInfo.filename, - }) - } catch { - logger.warn('Failed to addCompleteDownload') - } - // No need to dismiss here as the download wrapper does it for Android. + const downloadState = downloads.state.get(downloadID) || FS.emptyDownloadState + const downloadInfo = downloads.info.get(downloadID) || FS.emptyDownloadInfo + if (downloadState === FS.emptyDownloadState || downloadInfo === FS.emptyDownloadInfo) { + logger.warn('missing download', downloadID) + return + } + if (downloadState.error) { + return } - ignorePromise(f()) + try { + await androidAddCompleteDownload({ + description: `Keybase downloaded ${downloadInfo.filename}`, + mime: mimeType, + path: downloadState.localPath, + showNotification: true, + title: downloadInfo.filename, + }) + } catch { + logger.warn('Failed to addCompleteDownload') + } + // No need to dismiss here as the download wrapper does it for Android. } - ) + ignorePromise(f()) + }) }) } diff --git a/shared/constants/fs/platform-specific.desktop.tsx b/shared/constants/fs/platform-specific.desktop.tsx index 71bee000e649..557910c110af 100644 --- a/shared/constants/fs/platform-specific.desktop.tsx +++ b/shared/constants/fs/platform-specific.desktop.tsx @@ -1,15 +1,16 @@ import * as T from '@/constants/types' import {ignorePromise, wrapErrors} from '../utils' -import * as Constants from '../fs' +import * as Constants from '@/stores/fs' import * as Tabs from '../tabs' import {isWindows, isLinux, pathSep, isDarwin} from '../platform.desktop' import logger from '@/logger' import * as Path from '@/util/path' import KB2 from '@/util/electron.desktop' import {uint8ArrayToHex} from 'uint8array-extras' -import {useFSState} from '.' import {navigateAppend} from '../router2/util' -import {useConfigState} from '../config' +import {useConfigState} from '@/stores/config' + +const useFSState = Constants.useFSState const {openPathInFinder, openURL, getPathType, selectFilesToUploadDialog} = KB2.functions const {darwinCopyToKBFSTempUploadFile, relaunchApp, uninstallKBFSDialog, uninstallDokanDialog} = KB2.functions diff --git a/shared/constants/fs/util.tsx b/shared/constants/fs/util.tsx index e680702022f8..d57ccfd6c7cc 100644 --- a/shared/constants/fs/util.tsx +++ b/shared/constants/fs/util.tsx @@ -1,25 +1,9 @@ -import * as EngineGen from '@/actions/engine-gen-gen' import type * as React from 'react' import * as Tabs from '../tabs' import * as T from '../types' import {isLinux, isMobile} from '../platform' import {settingsFsTab} from '../settings/util' import {navigateAppend} from '../router2/util' -import {storeRegistry} from '../store-registry' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyFSFSOverallSyncStatusChanged: - case EngineGen.keybase1NotifyFSFSSubscriptionNotifyPath: - case EngineGen.keybase1NotifyFSFSSubscriptionNotify: - { - storeRegistry.getState('fs').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} - export const makeActionForOpenPathInFilesTab = ( // TODO: remove the second arg when we are done with migrating to nav2 path: T.FS.Path diff --git a/shared/constants/git/util.tsx b/shared/constants/git/util.tsx deleted file mode 100644 index c72418bcf735..000000000000 --- a/shared/constants/git/util.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' - -let loadedStore = false -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyBadgesBadgeState: - { - const {badgeState} = action.payload.params - const badges = new Set(badgeState.newGitRepoGlobalUniqueIDs) - // don't bother loading the store if no badges - if (loadedStore || badges.size) { - loadedStore = true - storeRegistry.getState('git').dispatch.onEngineIncomingImpl(action) - } - } - break - default: - } -} diff --git a/shared/constants/index.tsx b/shared/constants/index.tsx index b3359e15383d..7911ee17773b 100644 --- a/shared/constants/index.tsx +++ b/shared/constants/index.tsx @@ -1,10 +1,10 @@ export * from './platform' export * from './values' export * from './strings' -export {useRouterState, makeScreen} from './router2' -export * as Router2 from './router2' +export {useRouterState, makeScreen} from '@/stores/router2' +export * as Router2 from '@/stores/router2' export * as Tabs from './tabs' -export {useWaitingState} from './waiting' -export * as Waiting from './waiting' +export {useWaitingState} from '@/stores/waiting' +export * as Waiting from '@/stores/waiting' export * as PlatformSpecific from './platform-specific' export * from './utils' diff --git a/shared/constants/init/index.desktop.tsx b/shared/constants/init/index.desktop.tsx index 90e9d5834292..c7ba7e02fb83 100644 --- a/shared/constants/init/index.desktop.tsx +++ b/shared/constants/init/index.desktop.tsx @@ -1,24 +1,24 @@ // links all the stores together, stores never import this -import * as Chat from '../chat2' -import {ignorePromise} from '../utils' -import {useConfigState} from '../config' -import * as ConfigConstants from '../config' -import {useDaemonState} from '../daemon' -import {useFSState} from '../fs' -import {useProfileState} from '../profile' -import {useRouterState} from '../router2' +import * as Chat from '@/stores/chat2' +import {ignorePromise} from '@/constants/utils' +import {useConfigState} from '@/stores/config' +import * as ConfigConstants from '@/stores/config' +import {useDaemonState} from '@/stores/daemon' +import {useFSState} from '@/stores/fs' +import {useProfileState} from '@/stores/profile' +import {useRouterState} from '@/stores/router2' import * as EngineGen from '@/actions/engine-gen-gen' -import * as T from '../types' -import InputMonitor from '../platform-specific/input-monitor.desktop' +import * as T from '@/constants/types' +import InputMonitor from '@/constants/platform-specific/input-monitor.desktop' import KB2 from '@/util/electron.desktop' import logger from '@/logger' import type {RPCError} from '@/util/errors' import {getEngine} from '@/engine' -import {isLinux, isWindows} from '../platform.desktop' -import {kbfsNotification} from '../platform-specific/kbfs-notifications' +import {isLinux, isWindows} from '@/constants/platform.desktop' +import {kbfsNotification} from '@/constants/platform-specific/kbfs-notifications' import {skipAppFocusActions} from '@/local-debug.desktop' import NotifyPopup from '@/util/notify-popup' -import {noKBFSFailReason} from '../config/util' +import {noKBFSFailReason} from '@/constants/config/util' import {initSharedSubscriptions, _onEngineIncoming} from './shared' import {wrapErrors} from '@/util/debug' diff --git a/shared/constants/init/index.native.tsx b/shared/constants/init/index.native.tsx index 39a02773ae59..380f554e8503 100644 --- a/shared/constants/init/index.native.tsx +++ b/shared/constants/init/index.native.tsx @@ -1,27 +1,27 @@ // links all the stores together, stores never import this import {ignorePromise, neverThrowPromiseFunc, timeoutPromise} from '../utils' -import {useChatState} from '../chat2' -import {useConfigState} from '../config' -import {useCurrentUserState} from '../current-user' -import {useDaemonState} from '../daemon' -import {useDarkModeState} from '../darkmode' -import {useFSState} from '../fs' -import {useProfileState} from '../profile' -import {useRouterState} from '../router2' -import {useSettingsContactsState} from '../settings-contacts' -import * as T from '../types' +import {useChatState} from '@/stores/chat2' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' +import {useDaemonState} from '@/stores/daemon' +import {useDarkModeState} from '@/stores/darkmode' +import {useFSState} from '@/stores/fs' +import {useProfileState} from '@/stores/profile' +import {useRouterState} from '@/stores/router2' +import {useSettingsContactsState} from '@/stores/settings-contacts' +import * as T from '@/constants/types' import * as Clipboard from 'expo-clipboard' import * as EngineGen from '@/actions/engine-gen-gen' import * as ExpoLocation from 'expo-location' import * as ExpoTaskManager from 'expo-task-manager' -import * as Tabs from '../tabs' +import * as Tabs from '@/constants/tabs' import * as NetInfo from '@react-native-community/netinfo' import NotifyPopup from '@/util/notify-popup' import logger from '@/logger' import {Alert, Linking} from 'react-native' -import {isAndroid} from '../platform.native' +import {isAndroid} from '@/constants/platform.native' import {wrapErrors} from '@/util/debug' -import {getTab, getVisiblePath, logState} from '../router2' +import {getTab, getVisiblePath, logState} from '@/stores/router2' import {launchImageLibraryAsync} from '@/util/expo-image-picker.native' import {setupAudioMode} from '@/util/audio.native' import { diff --git a/shared/constants/init/shared.tsx b/shared/constants/init/shared.tsx index 8ed40061299a..7be982c97f36 100644 --- a/shared/constants/init/shared.tsx +++ b/shared/constants/init/shared.tsx @@ -1,50 +1,88 @@ -import type * as EngineGen from '@/actions/engine-gen-gen' +import * as EngineGen from '@/actions/engine-gen-gen' import logger from '@/logger' -import {serverConfigFileName} from '../platform' +import {isMobile, serverConfigFileName} from '../platform' import * as T from '../types' import {ignorePromise} from '../utils' -import * as ArchiveUtil from '../archive/util' -import * as AutoResetUtil from '../autoreset/util' -import * as AvatarUtil from '@/common-adapters/avatar/util' -import * as BotsUtil from '../bots/util' -import {useChatState} from '../chat2' -import {getSelectedConversation} from '../chat2/common' -import * as ChatUtil from '../chat2/util' -import {useConfigState} from '../config' -import {useCurrentUserState} from '../current-user' -import {useDaemonState} from '../daemon' -import {useDarkModeState} from '../darkmode' -import * as DeepLinksUtil from '../deeplinks/util' -import * as DevicesUtil from '../devices/util' -import * as FollowerUtil from '../followers/util' -import * as FSUtil from '../fs/util' -import * as GitUtil from '../git/util' -import * as NotifUtil from '../notifications/util' -import * as PeopleUtil from '../people/util' -import * as PinentryUtil from '../pinentry/util' -import {useProvisionState} from '../provision' +import type * as UseArchiveStateType from '@/stores/archive' +import type * as UseAutoResetStateType from '@/stores/autoreset' +import type * as UseDevicesStateType from '@/stores/devices' +import {useAvatarState} from '@/common-adapters/avatar/store' +import type * as UseBotsStateType from '@/stores/bots' +import {useChatState} from '@/stores/chat2' +import {getSelectedConversation} from '@/constants/chat2/common' +import type * as UseChatStateType from '@/stores/chat2' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' +import {useDaemonState} from '@/stores/daemon' +import {useDarkModeState} from '@/stores/darkmode' +import {handleKeybaseLink} from '../deeplinks' +import {useFollowerState} from '@/stores/followers' +import isEqual from 'lodash/isEqual' +import type * as UseFSStateType from '@/stores/fs' +import type * as UseGitStateType from '@/stores/git' +import type * as UseNotificationsStateType from '@/stores/notifications' +import type * as UsePeopleStateType from '@/stores/people' +import type * as UsePinentryStateType from '@/stores/pinentry' +import {useProvisionState} from '@/stores/provision' import {storeRegistry} from '../store-registry' -import {useSettingsContactsState} from '../settings-contacts' -import * as SettingsUtil from '../settings/util' -import * as SignupUtil from '../signup/util' -import {useTeamsState} from '../teams' -import * as TeamsUtil from '../teams/util' -import * as TrackerUtil from '../tracker2/util' -import * as UnlockFoldersUtil from '../unlock-folders/util' -import * as UsersUtil from '../users/util' -import {useWhatsNewState} from '../whats-new' +import {useSettingsContactsState} from '@/stores/settings-contacts' +import type * as UseSignupStateType from '@/stores/signup' +import type * as UseTeamsStateType from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' +import type * as UseTracker2StateType from '@/stores/tracker2' +import type * as UseUnlockFoldersStateType from '@/stores/unlock-folders' +import type * as UseUsersStateType from '@/stores/users' +import {useWhatsNewState} from '@/stores/whats-new' let _emitStartupOnLoadDaemonConnectedOnce = false +let _devicesLoaded = false +let _gitLoaded = false export const onEngineConnected = () => { - ChatUtil.onEngineConnected() + { + const registerUIs = async () => { + try { + await T.RPCGen.delegateUiCtlRegisterChatUIRpcPromise() + await T.RPCGen.delegateUiCtlRegisterLogUIRpcPromise() + logger.info('Registered Chat UI') + await T.RPCGen.delegateUiCtlRegisterHomeUIRpcPromise() + logger.info('Registered home UI') + await T.RPCGen.delegateUiCtlRegisterSecretUIRpcPromise() + logger.info('Registered secret ui') + await T.RPCGen.delegateUiCtlRegisterIdentify3UIRpcPromise() + logger.info('Registered identify ui') + await T.RPCGen.delegateUiCtlRegisterRekeyUIRpcPromise() + logger.info('Registered rekey ui') + } catch (error) { + logger.error('Error in registering UIs:', error) + } + } + ignorePromise(registerUIs()) + } useConfigState.getState().dispatch.onEngineConnected() storeRegistry.getState('daemon').dispatch.startHandshake() - NotifUtil.onEngineConnected() - PeopleUtil.onEngineConnected() - PinentryUtil.onEngineConnected() - TrackerUtil.onEngineConnected() - UnlockFoldersUtil.onEngineConnected() + { + const notifyCtl = async () => { + try { + // prettier-ignore + await T.RPCGen.notifyCtlSetNotificationsRpcPromise({ + channels: { + allowChatNotifySkips: true, app: true, audit: true, badges: true, chat: true, chatarchive: true, + chatattachments: true, chatdev: false, chatemoji: false, chatemojicross: false, chatkbfsedits: false, + deviceclone: false, ephemeral: false, favorites: false, featuredBots: true, kbfs: true, kbfsdesktop: !isMobile, + kbfslegacy: false, kbfsrequest: false, kbfssubscription: true, keyfamily: false, notifysimplefs: true, + paperkeys: false, pgp: true, reachability: true, runtimestats: true, saltpack: true, service: true, session: true, + team: true, teambot: false, tracking: true, users: true, wallet: false, + }, + }) + } catch (error) { + if (error) { + logger.warn('error in toggling notifications: ', error) + } + } + } + ignorePromise(notifyCtl()) + } } export const onEngineDisconnected = () => { @@ -241,25 +279,223 @@ export const initSharedSubscriptions = () => { }) } +// This is to defer loading stores we don't need immediately. export const _onEngineIncoming = (action: EngineGen.Actions) => { - ArchiveUtil.onEngineIncoming(action) - AutoResetUtil.onEngineIncoming(action) - AvatarUtil.onEngineIncoming(action) - BotsUtil.onEngineIncoming(action) - ChatUtil.onEngineIncoming(action) + switch (action.type) { + case EngineGen.keybase1NotifySimpleFSSimpleFSArchiveStatusChanged: + case EngineGen.chat1NotifyChatChatArchiveComplete: + case EngineGen.chat1NotifyChatChatArchiveProgress: + { + const {useArchiveState} = require('@/stores/archive') as typeof UseArchiveStateType + useArchiveState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1NotifyBadgesBadgeState: + { + const {useAutoResetState} = require('@/stores/autoreset') as typeof UseAutoResetStateType + useAutoResetState.getState().dispatch.onEngineIncomingImpl(action) + + const {badgeState} = action.payload.params + const {newDevices, revokedDevices} = badgeState + const hasValue = (newDevices?.length ?? 0) + (revokedDevices?.length ?? 0) > 0 + if (_devicesLoaded || hasValue) { + _devicesLoaded = true + const {useDevicesState} = require('@/stores/devices') as typeof UseDevicesStateType + useDevicesState.getState().dispatch.onEngineIncomingImpl(action) + } + + const badges = new Set(badgeState.newGitRepoGlobalUniqueIDs) + if (_gitLoaded || badges.size) { + _gitLoaded = true + const {useGitState} = require('@/stores/git') as typeof UseGitStateType + useGitState.getState().dispatch.onEngineIncomingImpl(action) + } + + const {useNotifState} = require('@/stores/notifications') as typeof UseNotificationsStateType + useNotifState.getState().dispatch.onEngineIncomingImpl(action) + + const {useTeamsState} = require('@/stores/teams') as typeof UseTeamsStateType + useTeamsState.getState().dispatch.onEngineIncomingImpl(action) + + const {useChatState} = require('@/stores/chat2') as typeof UseChatStateType + useChatState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.chat1ChatUiChatShowManageChannels: + case EngineGen.keybase1NotifyTeamTeamMetadataUpdate: + case EngineGen.chat1NotifyChatChatWelcomeMessageLoaded: + case EngineGen.keybase1NotifyTeamTeamTreeMembershipsPartial: + case EngineGen.keybase1NotifyTeamTeamTreeMembershipsDone: + case EngineGen.keybase1NotifyTeamTeamRoleMapChanged: + case EngineGen.keybase1NotifyTeamTeamChangedByID: + case EngineGen.keybase1NotifyTeamTeamDeleted: + case EngineGen.keybase1NotifyTeamTeamExit: + case EngineGen.keybase1GregorUIPushState: + { + const {useTeamsState} = require('@/stores/teams') as typeof UseTeamsStateType + useTeamsState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1NotifyFeaturedBotsFeaturedBotsUpdate: + { + const {useBotsState} = require('@/stores/bots') as typeof UseBotsStateType + useBotsState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1NotifyFSFSOverallSyncStatusChanged: + case EngineGen.keybase1NotifyFSFSSubscriptionNotifyPath: + case EngineGen.keybase1NotifyFSFSSubscriptionNotify: + { + const {useFSState} = require('@/stores/fs') as typeof UseFSStateType + useFSState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1NotifyAuditRootAuditError: + case EngineGen.keybase1NotifyAuditBoxAuditError: + { + const {useNotifState} = require('@/stores/notifications') as typeof UseNotificationsStateType + useNotifState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1HomeUIHomeUIRefresh: + case EngineGen.keybase1NotifyEmailAddressEmailAddressVerified: + { + const {usePeopleState} = require('@/stores/people') as typeof UsePeopleStateType + usePeopleState.getState().dispatch.onEngineIncomingImpl(action) + const emailAddress = action.payload.params?.emailAddress + if (emailAddress) { + storeRegistry.getState('settings-email').dispatch.notifyEmailVerified(emailAddress) + } + const {useSignupState} = require('@/stores/signup') as typeof UseSignupStateType + useSignupState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1SecretUiGetPassphrase: + { + const {usePinentryState} = require('@/stores/pinentry') as typeof UsePinentryStateType + usePinentryState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1NotifyUsersPasswordChanged: + { + const randomPW = action.payload.params.state === T.RPCGen.PassphraseState.random + storeRegistry.getState('settings-password').dispatch.notifyUsersPasswordChanged(randomPW) + } + break + case EngineGen.keybase1NotifyPhoneNumberPhoneNumbersChanged: { + const {list} = action.payload.params + storeRegistry + .getState('settings-phone') + .dispatch.notifyPhoneNumberPhoneNumbersChanged(list ?? undefined) + break + } + case EngineGen.keybase1NotifyEmailAddressEmailsChanged: { + const list = action.payload.params.list ?? [] + storeRegistry.getState('settings-email').dispatch.notifyEmailAddressEmailsChanged(list) + break + } + case EngineGen.chat1ChatUiChatInboxFailed: + case EngineGen.chat1NotifyChatChatSetConvSettings: + case EngineGen.chat1NotifyChatChatAttachmentUploadStart: + case EngineGen.chat1NotifyChatChatPromptUnfurl: + case EngineGen.chat1NotifyChatChatPaymentInfo: + case EngineGen.chat1NotifyChatChatRequestInfo: + case EngineGen.chat1NotifyChatChatAttachmentDownloadProgress: + case EngineGen.chat1NotifyChatChatAttachmentDownloadComplete: + case EngineGen.chat1NotifyChatChatAttachmentUploadProgress: + case EngineGen.chat1ChatUiChatCommandMarkdown: + case EngineGen.chat1ChatUiChatGiphyToggleResultWindow: + case EngineGen.chat1ChatUiChatCommandStatus: + case EngineGen.chat1ChatUiChatBotCommandsUpdateStatus: + case EngineGen.chat1ChatUiChatGiphySearchResults: + case EngineGen.chat1NotifyChatChatParticipantsInfo: + case EngineGen.chat1ChatUiChatMaybeMentionUpdate: + case EngineGen.chat1NotifyChatChatConvUpdate: + case EngineGen.chat1ChatUiChatCoinFlipStatus: + case EngineGen.chat1NotifyChatChatThreadsStale: + case EngineGen.chat1NotifyChatChatSubteamRename: + case EngineGen.chat1NotifyChatChatTLFFinalize: + case EngineGen.chat1NotifyChatChatIdentifyUpdate: + case EngineGen.chat1ChatUiChatInboxUnverified: + case EngineGen.chat1NotifyChatChatInboxSyncStarted: + case EngineGen.chat1NotifyChatChatInboxSynced: + case EngineGen.chat1ChatUiChatInboxLayout: + case EngineGen.chat1NotifyChatChatInboxStale: + case EngineGen.chat1ChatUiChatInboxConversation: + case EngineGen.chat1NotifyChatNewChatActivity: + case EngineGen.chat1NotifyChatChatTypingUpdate: + case EngineGen.chat1NotifyChatChatSetConvRetention: + case EngineGen.chat1NotifyChatChatSetTeamRetention: + { + const {useChatState} = require('@/stores/chat2') as typeof UseChatStateType + useChatState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1NotifyServiceHandleKeybaseLink: + { + const {link, deferred} = action.payload.params + if (deferred && !link.startsWith('keybase://team-invite-link/')) { + return + } + handleKeybaseLink(link) + } + break + case EngineGen.keybase1NotifyTeamAvatarUpdated: { + const {name} = action.payload.params + useAvatarState.getState().dispatch.updated(name) + break + } + case EngineGen.keybase1NotifyTrackingTrackingChanged: { + const {isTracking, username} = action.payload.params + useFollowerState.getState().dispatch.updateFollowing(username, isTracking) + const {useTrackerState} = require('@/stores/tracker2') as typeof UseTracker2StateType + useTrackerState.getState().dispatch.onEngineIncomingImpl(action) + break + } + case EngineGen.keybase1NotifyTrackingTrackingInfo: { + const {uid, followers: _newFollowers, followees: _newFollowing} = action.payload.params + if (useCurrentUserState.getState().uid !== uid) { + break + } + const newFollowers = new Set(_newFollowers) + const newFollowing = new Set(_newFollowing) + const {following: oldFollowing, followers: oldFollowers, dispatch} = useFollowerState.getState() + const following = isEqual(newFollowing, oldFollowing) ? oldFollowing : newFollowing + const followers = isEqual(newFollowers, oldFollowers) ? oldFollowers : newFollowers + dispatch.replace(followers, following) + break + } + case EngineGen.keybase1Identify3UiIdentify3Result: + case EngineGen.keybase1Identify3UiIdentify3ShowTracker: + case EngineGen.keybase1NotifyUsersUserChanged: + case EngineGen.keybase1NotifyTrackingNotifyUserBlocked: + case EngineGen.keybase1Identify3UiIdentify3UpdateRow: + case EngineGen.keybase1Identify3UiIdentify3UserReset: + case EngineGen.keybase1Identify3UiIdentify3UpdateUserCard: + case EngineGen.keybase1Identify3UiIdentify3Summary: + { + const {useTrackerState} = require('@/stores/tracker2') as typeof UseTracker2StateType + useTrackerState.getState().dispatch.onEngineIncomingImpl(action) + } + { + const {useUsersState} = require('@/stores/users') as typeof UseUsersStateType + useUsersState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1NotifyUsersIdentifyUpdate: + { + const {useUsersState} = require('@/stores/users') as typeof UseUsersStateType + useUsersState.getState().dispatch.onEngineIncomingImpl(action) + } + break + case EngineGen.keybase1RekeyUIRefresh: + case EngineGen.keybase1RekeyUIDelegateRekeyUI: + { + const {useUnlockFoldersState} = require('@/stores/unlock-folders') as typeof UseUnlockFoldersStateType + useUnlockFoldersState.getState().dispatch.onEngineIncomingImpl(action) + } + break + default: + } useConfigState.getState().dispatch.onEngineIncoming(action) - DeepLinksUtil.onEngineIncoming(action) - DevicesUtil.onEngineIncoming(action) - FollowerUtil.onEngineIncoming(action) - FSUtil.onEngineIncoming(action) - GitUtil.onEngineIncoming(action) - NotifUtil.onEngineIncoming(action) - PeopleUtil.onEngineIncoming(action) - PinentryUtil.onEngineIncoming(action) - SettingsUtil.onEngineIncoming(action) - SignupUtil.onEngineIncoming(action) - TeamsUtil.onEngineIncoming(action) - TrackerUtil.onEngineIncoming(action) - UnlockFoldersUtil.onEngineIncoming(action) - UsersUtil.onEngineIncoming(action) } diff --git a/shared/constants/notifications/util.tsx b/shared/constants/notifications/util.tsx index acc95a39dbf0..e69de29bb2d1 100644 --- a/shared/constants/notifications/util.tsx +++ b/shared/constants/notifications/util.tsx @@ -1,69 +0,0 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' -import {isMobile} from '../platform' -import logger from '@/logger' - -export const onEngineConnected = () => { - const f = async () => { - try { - await T.RPCGen.notifyCtlSetNotificationsRpcPromise({ - channels: { - allowChatNotifySkips: true, - app: true, - audit: true, - badges: true, - chat: true, - chatarchive: true, - chatattachments: true, - chatdev: false, - chatemoji: false, - chatemojicross: false, - chatkbfsedits: false, - deviceclone: false, - ephemeral: false, - favorites: false, - featuredBots: true, - kbfs: true, - kbfsdesktop: !isMobile, - kbfslegacy: false, - kbfsrequest: false, - kbfssubscription: true, - keyfamily: false, - notifysimplefs: true, - paperkeys: false, - pgp: true, - reachability: true, - runtimestats: true, - saltpack: true, - service: true, - session: true, - team: true, - teambot: false, - tracking: true, - users: true, - wallet: false, - }, - }) - } catch (error) { - if (error) { - logger.warn('error in toggling notifications: ', error) - } - } - } - ignorePromise(f()) -} - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyAuditRootAuditError: - case EngineGen.keybase1NotifyAuditBoxAuditError: - case EngineGen.keybase1NotifyBadgesBadgeState: - { - storeRegistry.getState('notifications').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/people/util.tsx b/shared/constants/people/util.tsx index 8deb5593c959..e69de29bb2d1 100644 --- a/shared/constants/people/util.tsx +++ b/shared/constants/people/util.tsx @@ -1,28 +0,0 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' - -export const onEngineConnected = () => { - const f = async () => { - try { - await T.RPCGen.delegateUiCtlRegisterHomeUIRpcPromise() - console.log('Registered home UI') - } catch (error) { - console.warn('Error in registering home UI:', error) - } - } - ignorePromise(f()) -} - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1HomeUIHomeUIRefresh: - case EngineGen.keybase1NotifyEmailAddressEmailAddressVerified: - { - storeRegistry.getState('people').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/pinentry/util.tsx b/shared/constants/pinentry/util.tsx deleted file mode 100644 index 5bc792128d6e..000000000000 --- a/shared/constants/pinentry/util.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' -import * as EngineGen from '@/actions/engine-gen-gen' -import {usePinentryState} from '../pinentry' -import logger from '@/logger' - -export const onEngineConnected = () => { - const f = async () => { - try { - await T.RPCGen.delegateUiCtlRegisterSecretUIRpcPromise() - logger.info('Registered secret ui') - } catch (error) { - logger.warn('error in registering secret ui: ', error) - } - } - ignorePromise(f()) -} - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1SecretUiGetPassphrase: - { - usePinentryState.getState().dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/platform-specific/kbfs-notifications.tsx b/shared/constants/platform-specific/kbfs-notifications.tsx index 6d5b97e4a18b..1ee3f17113f6 100644 --- a/shared/constants/platform-specific/kbfs-notifications.tsx +++ b/shared/constants/platform-specific/kbfs-notifications.tsx @@ -1,5 +1,5 @@ import {pathSep} from '@/constants/platform' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' import capitalize from 'lodash/capitalize' import * as T from '@/constants/types' import {parseFolderNameToUsers} from '@/util/kbfs' diff --git a/shared/constants/platform-specific/push.native.tsx b/shared/constants/platform-specific/push.native.tsx index 25f3ed270787..60d5fb4df93b 100644 --- a/shared/constants/platform-specific/push.native.tsx +++ b/shared/constants/platform-specific/push.native.tsx @@ -10,8 +10,8 @@ import { removeAllPendingNotificationRequests, } from 'react-native-kb' import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' -import {useLogoutState} from '../logout' +import {useConfigState} from '@/stores/config' +import {useLogoutState} from '@/stores/logout' type DataCommon = { userInteraction: boolean diff --git a/shared/constants/push.native.tsx b/shared/constants/push.native.tsx index 9e7995bfade6..7f115f028fe5 100644 --- a/shared/constants/push.native.tsx +++ b/shared/constants/push.native.tsx @@ -1,24 +1,24 @@ -import * as Tabs from './tabs' -import * as S from './strings' -import {ignorePromise, neverThrowPromiseFunc, timeoutPromise} from './utils' -import {navigateAppend, navUpToScreen, switchTab} from './router2/util' -import {storeRegistry} from './store-registry' -import {useConfigState} from './config' -import {useCurrentUserState} from './current-user' -import {useLogoutState} from './logout' -import {useWaitingState} from './waiting' +import * as Tabs from '@/constants/tabs' +import * as S from '@/constants/strings' +import {ignorePromise, neverThrowPromiseFunc, timeoutPromise} from '@/constants/utils' +import {navigateAppend, navUpToScreen, switchTab} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' +import {useLogoutState} from '@/stores/logout' +import {useWaitingState} from '@/stores/waiting' import * as Z from '@/util/zustand' import logger from '@/logger' -import * as T from './types' +import * as T from '@/constants/types' import {isDevApplePushToken} from '@/local-debug' -import {isIOS} from './platform' +import {isIOS} from '@/constants/platform' import { iosGetHasShownPushPrompt, checkPushPermissions, requestPushPermissions, removeAllPendingNotificationRequests, } from 'react-native-kb' -import {type Store, type State} from './push' +import {type Store, type State} from '@/constants/push' export const tokenType = isIOS ? (isDevApplePushToken ? 'appledev' : 'apple') : 'androidplay' diff --git a/shared/constants/rpc-utils.tsx b/shared/constants/rpc-utils.tsx index 5969509c5d03..8c5993554391 100644 --- a/shared/constants/rpc-utils.tsx +++ b/shared/constants/rpc-utils.tsx @@ -1,6 +1,12 @@ import * as T from './types' import {uint8ArrayToString} from 'uint8array-extras' -import {type Device} from './provision' + +type Device = { + deviceNumberOfType: number + id: T.Devices.DeviceID + name: string + type: T.Devices.DeviceType +} export const bodyToJSON = (body?: Uint8Array): unknown => { if (!body) return undefined @@ -27,4 +33,3 @@ export const rpcDeviceToDevice = (d: T.RPCGen.Device): Device => { throw new Error('Invalid device type detected: ' + type) } } - diff --git a/shared/constants/settings/util.tsx b/shared/constants/settings/util.tsx index 281dc0582fd5..b54c44d6f26e 100644 --- a/shared/constants/settings/util.tsx +++ b/shared/constants/settings/util.tsx @@ -1,6 +1,3 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' - export const traceInProgressKey = 'settings:traceInProgress' export const processorProfileInProgressKey = 'settings:processorProfileInProgress' @@ -47,17 +44,3 @@ export type SettingsTab = | typeof settingsCryptoTab | typeof settingsContactsTab | typeof settingsWhatsNewTab - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyEmailAddressEmailAddressVerified: - case EngineGen.keybase1NotifyUsersPasswordChanged: - case EngineGen.keybase1NotifyPhoneNumberPhoneNumbersChanged: - case EngineGen.keybase1NotifyEmailAddressEmailsChanged: - { - storeRegistry.getState('settings').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/signup/util.tsx b/shared/constants/signup/util.tsx deleted file mode 100644 index 7c58483bdb13..000000000000 --- a/shared/constants/signup/util.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyEmailAddressEmailAddressVerified: - { - storeRegistry.getState('signup').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/store-registry.tsx b/shared/constants/store-registry.tsx index 1d04affa5e76..d45249872caa 100644 --- a/shared/constants/store-registry.tsx +++ b/shared/constants/store-registry.tsx @@ -1,33 +1,36 @@ // used to allow non-circular cross-calls between stores // ONLY for zustand stores -import type * as T from './types' -import type * as TBType from './team-building' -import type * as ConvoStateType from './chat2/convostate' -import type {ConvoState} from './chat2/convostate' -import type {State as AutoResetState, useAutoResetState} from './autoreset' -import type {State as BotsState, useBotsState} from './bots' -import type {State as ChatState, useChatState} from './chat2' -import type {State as DaemonState, useDaemonState} from './daemon' -import type {State as DevicesState, useDevicesState} from './devices' -import type {State as FSState, useFSState} from './fs' -import type {State as GitState, useGitState} from './git' -import type {State as NotificationsState, useNotifState} from './notifications' -import type {State as PeopleState, usePeopleState} from './people' -import type {State as ProfileState, useProfileState} from './profile' -import type {State as ProvisionState, useProvisionState} from './provision' -import type {State as PushState, usePushState} from './push' -import type {State as RecoverPasswordState, useState as useRecoverPasswordState} from './recover-password' -import type {State as SettingsState, useSettingsState} from './settings' -import type {State as SettingsChatState, useSettingsChatState} from './settings-chat' -import type {State as SettingsContactsState, useSettingsContactsState} from './settings-contacts' -import type {State as SettingsEmailState, useSettingsEmailState} from './settings-email' -import type {State as SettingsPasswordState, usePWState} from './settings-password' -import type {State as SettingsPhoneState, useSettingsPhoneState} from './settings-phone' -import type {State as SignupState, useSignupState} from './signup' -import type {State as TeamsState, useTeamsState} from './teams' -import type {State as Tracker2State, useTrackerState} from './tracker2' -import type {State as UnlockFoldersState, useUnlockFoldersState} from './unlock-folders' -import type {State as UsersState, useUsersState} from './users' +import type * as T from '@/constants/types' +import type * as TBType from '@/stores/team-building' +import type * as ConvoStateType from '@/constants/chat2/convostate' +import type {ConvoState} from '@/constants/chat2/convostate' +import type {State as AutoResetState, useAutoResetState} from '@/stores/autoreset' +import type {State as BotsState, useBotsState} from '@/stores/bots' +import type {State as ChatState, useChatState} from '@/stores/chat2' +import type {State as DaemonState, useDaemonState} from '@/stores/daemon' +import type {State as DevicesState, useDevicesState} from '@/stores/devices' +import type {State as FSState, useFSState} from '@/stores/fs' +import type {State as GitState, useGitState} from '@/stores/git' +import type {State as NotificationsState, useNotifState} from '@/stores/notifications' +import type {State as PeopleState, usePeopleState} from '@/stores/people' +import type {State as ProfileState, useProfileState} from '@/stores/profile' +import type {State as ProvisionState, useProvisionState} from '@/stores/provision' +import type {State as PushState, usePushState} from '@/constants/push' +import type { + State as RecoverPasswordState, + useState as useRecoverPasswordState, +} from '@/stores/recover-password' +import type {State as SettingsState, useSettingsState} from '@/stores/settings' +import type {State as SettingsChatState, useSettingsChatState} from '@/stores/settings-chat' +import type {State as SettingsContactsState, useSettingsContactsState} from '@/stores/settings-contacts' +import type {State as SettingsEmailState, useSettingsEmailState} from '@/stores/settings-email' +import type {State as SettingsPasswordState, usePWState} from '@/stores/settings-password' +import type {State as SettingsPhoneState, useSettingsPhoneState} from '@/stores/settings-phone' +import type {State as SignupState, useSignupState} from '@/stores/signup' +import type {State as TeamsState, useTeamsState} from '@/stores/teams' +import type {State as Tracker2State, useTrackerState} from '@/stores/tracker2' +import type {State as UnlockFoldersState, useUnlockFoldersState} from '@/stores/unlock-folders' +import type {State as UsersState, useUsersState} from '@/stores/users' type StoreName = | 'autoreset' @@ -114,99 +117,99 @@ class StoreRegistry { /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return */ switch (storeName) { case 'autoreset': { - const {useAutoResetState} = require('./autoreset') + const {useAutoResetState} = require('@/stores/autoreset') return useAutoResetState } case 'bots': { - const {useBotsState} = require('./bots') + const {useBotsState} = require('@/stores/bots') return useBotsState } case 'chat': { - const {useChatState} = require('./chat2') + const {useChatState} = require('@/stores/chat2') return useChatState } case 'daemon': { - const {useDaemonState} = require('./daemon') + const {useDaemonState} = require('@/stores/daemon') return useDaemonState } case 'devices': { - const {useDevicesState} = require('./devices') + const {useDevicesState} = require('@/stores/devices') return useDevicesState } case 'fs': { - const {useFSState} = require('./fs') + const {useFSState} = require('@/stores/fs') return useFSState } case 'git': { - const {useGitState} = require('./git') + const {useGitState} = require('@/stores/git') return useGitState } case 'notifications': { - const {useNotifState} = require('./notifications') + const {useNotifState} = require('@/stores/notifications') return useNotifState } case 'people': { - const {usePeopleState} = require('./people') + const {usePeopleState} = require('@/stores/people') return usePeopleState } case 'profile': { - const {useProfileState} = require('./profile') + const {useProfileState} = require('@/stores/profile') return useProfileState } case 'provision': { - const {useProvisionState} = require('./provision') + const {useProvisionState} = require('@/stores/provision') return useProvisionState } case 'push': { - const {usePushState} = require('./push') + const {usePushState} = require('@/constants/push') return usePushState } case 'recover-password': { - const {useState} = require('./recover-password') + const {useState} = require('@/stores/recover-password') return useState } case 'settings': { - const {useSettingsState} = require('./settings') + const {useSettingsState} = require('@/stores/settings') return useSettingsState } case 'settings-chat': { - const {useSettingsChatState} = require('./settings-chat') + const {useSettingsChatState} = require('@/stores/settings-chat') return useSettingsChatState } case 'settings-contacts': { - const {useSettingsContactsState} = require('./settings-contacts') + const {useSettingsContactsState} = require('@/stores/settings-contacts') return useSettingsContactsState } case 'settings-email': { - const {useSettingsEmailState} = require('./settings-email') + const {useSettingsEmailState} = require('@/stores/settings-email') return useSettingsEmailState } case 'settings-password': { - const {usePWState} = require('./settings-password') + const {usePWState} = require('@/stores/settings-password') return usePWState } case 'settings-phone': { - const {useSettingsPhoneState} = require('./settings-phone') + const {useSettingsPhoneState} = require('@/stores/settings-phone') return useSettingsPhoneState } case 'signup': { - const {useSignupState} = require('./signup') + const {useSignupState} = require('@/stores/signup') return useSignupState } case 'teams': { - const {useTeamsState} = require('./teams') + const {useTeamsState} = require('@/stores/teams') return useTeamsState } case 'tracker2': { - const {useTrackerState} = require('./tracker2') + const {useTrackerState} = require('@/stores/tracker2') return useTrackerState } case 'unlock-folders': { - const {useUnlockFoldersState} = require('./unlock-folders') + const {useUnlockFoldersState} = require('@/stores/unlock-folders') return useUnlockFoldersState } case 'users': { - const {useUsersState} = require('./users') + const {useUsersState} = require('@/stores/users') return useUsersState } default: @@ -219,13 +222,13 @@ class StoreRegistry { } getTBStore(name: T.TB.AllowedNamespace): TBType.State { - const {createTBStore} = require('./team-building') as typeof TBType + const {createTBStore} = require('@/stores/team-building') as typeof TBType const store = createTBStore(name) return store.getState() } getConvoState(id: T.Chat.ConversationIDKey): ConvoState { - const {getConvoState} = require('./chat2/convostate') as typeof ConvoStateType + const {getConvoState} = require('@/constants/chat2/convostate') as typeof ConvoStateType return getConvoState(id) } } diff --git a/shared/constants/teams/util.tsx b/shared/constants/teams/util.tsx index 48167c472d34..ce11cc0f9c40 100644 --- a/shared/constants/teams/util.tsx +++ b/shared/constants/teams/util.tsx @@ -1,29 +1,6 @@ -import * as EngineGen from '@/actions/engine-gen-gen' import * as T from '../types' -import {storeRegistry} from '../store-registry' import invert from 'lodash/invert' -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.chat1ChatUiChatShowManageChannels: - case EngineGen.keybase1NotifyTeamTeamMetadataUpdate: - case EngineGen.chat1NotifyChatChatWelcomeMessageLoaded: - case EngineGen.keybase1NotifyTeamTeamTreeMembershipsPartial: - case EngineGen.keybase1NotifyTeamTeamTreeMembershipsDone: - case EngineGen.keybase1NotifyTeamTeamRoleMapChanged: - case EngineGen.keybase1NotifyTeamTeamChangedByID: - case EngineGen.keybase1NotifyTeamTeamDeleted: - case EngineGen.keybase1NotifyTeamTeamExit: - case EngineGen.keybase1NotifyBadgesBadgeState: - case EngineGen.keybase1GregorUIPushState: - { - storeRegistry.getState('teams').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} - export const makeRetentionPolicy = ( r?: Partial ): T.Retention.RetentionPolicy => ({ diff --git a/shared/constants/tracker2/util.tsx b/shared/constants/tracker2/util.tsx index e6adb67ec4c6..e69de29bb2d1 100644 --- a/shared/constants/tracker2/util.tsx +++ b/shared/constants/tracker2/util.tsx @@ -1,36 +0,0 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' -import logger from '@/logger' - -export const onEngineConnected = () => { - const f = async () => { - try { - await T.RPCGen.delegateUiCtlRegisterIdentify3UIRpcPromise() - logger.info('Registered identify ui') - } catch (error) { - logger.warn('error in registering identify ui: ', error) - } - } - ignorePromise(f()) -} - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyTrackingTrackingChanged: - case EngineGen.keybase1Identify3UiIdentify3Result: - case EngineGen.keybase1Identify3UiIdentify3ShowTracker: - case EngineGen.keybase1NotifyUsersUserChanged: - case EngineGen.keybase1NotifyTrackingNotifyUserBlocked: - case EngineGen.keybase1Identify3UiIdentify3UpdateRow: - case EngineGen.keybase1Identify3UiIdentify3UserReset: - case EngineGen.keybase1Identify3UiIdentify3UpdateUserCard: - case EngineGen.keybase1Identify3UiIdentify3Summary: - { - storeRegistry.getState('tracker2').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/unlock-folders/util.tsx b/shared/constants/unlock-folders/util.tsx index 89d12305fd44..e69de29bb2d1 100644 --- a/shared/constants/unlock-folders/util.tsx +++ b/shared/constants/unlock-folders/util.tsx @@ -1,30 +0,0 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' -import logger from '@/logger' - -export const onEngineConnected = () => { - const f = async () => { - try { - await T.RPCGen.delegateUiCtlRegisterRekeyUIRpcPromise() - logger.info('Registered rekey ui') - } catch (error) { - logger.warn('error in registering rekey ui: ') - logger.debug('error in registering rekey ui: ', error) - } - } - ignorePromise(f()) -} - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1RekeyUIRefresh: - case EngineGen.keybase1RekeyUIDelegateRekeyUI: - { - storeRegistry.getState('unlock-folders').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/constants/users/util.tsx b/shared/constants/users/util.tsx index cd70c647ccb5..e69de29bb2d1 100644 --- a/shared/constants/users/util.tsx +++ b/shared/constants/users/util.tsx @@ -1,14 +0,0 @@ -import * as EngineGen from '@/actions/engine-gen-gen' -import {storeRegistry} from '../store-registry' - -export const onEngineIncoming = (action: EngineGen.Actions) => { - switch (action.type) { - case EngineGen.keybase1NotifyUsersIdentifyUpdate: - case EngineGen.keybase1NotifyTrackingNotifyUserBlocked: - { - storeRegistry.getState('users').dispatch.onEngineIncomingImpl(action) - } - break - default: - } -} diff --git a/shared/crypto/input.tsx b/shared/crypto/input.tsx index 575de4122740..2a04e94765a3 100644 --- a/shared/crypto/input.tsx +++ b/shared/crypto/input.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import * as React from 'react' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import type {IconType} from '@/common-adapters/icon.constants-gen' import capitalize from 'lodash/capitalize' import {pickFiles} from '@/util/pick-files' diff --git a/shared/crypto/operations/decrypt.tsx b/shared/crypto/operations/decrypt.tsx index 4f553f9e7b06..61060317259c 100644 --- a/shared/crypto/operations/decrypt.tsx +++ b/shared/crypto/operations/decrypt.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import * as Kb from '@/common-adapters' import * as React from 'react' import {Input, DragAndDrop, InputActionsBar, OperationBanner} from '../input' diff --git a/shared/crypto/operations/encrypt.tsx b/shared/crypto/operations/encrypt.tsx index 856c4b40cb0c..7be3f776cec8 100644 --- a/shared/crypto/operations/encrypt.tsx +++ b/shared/crypto/operations/encrypt.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import * as Kb from '@/common-adapters' import * as React from 'react' import Recipients from '../recipients' diff --git a/shared/crypto/operations/sign.tsx b/shared/crypto/operations/sign.tsx index 5ec68a46802e..7b0267c7f2a5 100644 --- a/shared/crypto/operations/sign.tsx +++ b/shared/crypto/operations/sign.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import * as React from 'react' import * as Kb from '@/common-adapters' import openURL from '@/util/open-url' diff --git a/shared/crypto/operations/verify.tsx b/shared/crypto/operations/verify.tsx index 3b64988b45a3..56decc162d9d 100644 --- a/shared/crypto/operations/verify.tsx +++ b/shared/crypto/operations/verify.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import * as Kb from '@/common-adapters' import * as React from 'react' import {Input, InputActionsBar, DragAndDrop, OperationBanner} from '../input' diff --git a/shared/crypto/output.tsx b/shared/crypto/output.tsx index d349ae39efe5..ca6efb87d482 100644 --- a/shared/crypto/output.tsx +++ b/shared/crypto/output.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Crypto from '@/constants/crypto' +import * as Chat from '@/stores/chat2' +import * as Crypto from '@/stores/crypto' import * as Kb from '@/common-adapters' import * as Path from '@/util/path' import * as React from 'react' @@ -8,9 +8,9 @@ import capitalize from 'lodash/capitalize' import type * as T from '@/constants/types' import {pickFiles} from '@/util/pick-files' import type HiddenString from '@/util/hidden-string' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' -import {useConfigState} from '@/constants/config' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' +import {useConfigState} from '@/stores/config' type OutputProps = {operation: T.Crypto.Operations} type OutputActionsBarProps = {operation: T.Crypto.Operations} diff --git a/shared/crypto/recipients.tsx b/shared/crypto/recipients.tsx index a4ad222b2a2d..a7ac327df09f 100644 --- a/shared/crypto/recipients.tsx +++ b/shared/crypto/recipients.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import * as Kb from '@/common-adapters' const placeholder = 'Search people' diff --git a/shared/crypto/sub-nav/index.desktop.tsx b/shared/crypto/sub-nav/index.desktop.tsx index 7cd6cdfdd883..47e4b97a6486 100644 --- a/shared/crypto/sub-nav/index.desktop.tsx +++ b/shared/crypto/sub-nav/index.desktop.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import * as Kb from '@/common-adapters' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import * as Common from '@/router-v2/common.desktop' import LeftNav from './left-nav.desktop' import { diff --git a/shared/crypto/sub-nav/index.native.tsx b/shared/crypto/sub-nav/index.native.tsx index c41261148096..f2ee824bec3b 100644 --- a/shared/crypto/sub-nav/index.native.tsx +++ b/shared/crypto/sub-nav/index.native.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import * as Kb from '@/common-adapters' import NavRow from './nav-row' diff --git a/shared/crypto/sub-nav/left-nav.desktop.tsx b/shared/crypto/sub-nav/left-nav.desktop.tsx index e44a26459acd..5dc1b78e412a 100644 --- a/shared/crypto/sub-nav/left-nav.desktop.tsx +++ b/shared/crypto/sub-nav/left-nav.desktop.tsx @@ -1,6 +1,6 @@ import type * as React from 'react' import * as Kb from '@/common-adapters' -import * as Crypto from '@/constants/crypto' +import * as Crypto from '@/stores/crypto' import NavRow from './nav-row' type Row = (typeof Crypto.Tabs)[number] & { diff --git a/shared/desktop/app/menu-bar.desktop.tsx b/shared/desktop/app/menu-bar.desktop.tsx index cbc76a7e902f..bca0da6b42de 100644 --- a/shared/desktop/app/menu-bar.desktop.tsx +++ b/shared/desktop/app/menu-bar.desktop.tsx @@ -8,7 +8,7 @@ import {menubar} from 'menubar' import {showDevTools, skipSecondaryDevtools} from '@/local-debug' import {getMainWindow} from './main-window.desktop' import {assetRoot, htmlPrefix} from './html-root.desktop' -import type {BadgeType} from '@/constants/notifications' +import type {BadgeType} from '@/stores/notifications' const getIcons = (iconType: BadgeType, badges: number) => { const size = isWindows ? 16 : 22 diff --git a/shared/desktop/remote/use-serialize-props.desktop.tsx b/shared/desktop/remote/use-serialize-props.desktop.tsx index 4bd25aacfdf1..3327ea8f6428 100644 --- a/shared/desktop/remote/use-serialize-props.desktop.tsx +++ b/shared/desktop/remote/use-serialize-props.desktop.tsx @@ -5,7 +5,7 @@ import * as React from 'react' import * as C from '@/constants' import KB2 from '@/util/electron.desktop' import isEqual from 'lodash/isEqual' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const {rendererNewProps} = KB2.functions diff --git a/shared/desktop/renderer/main.desktop.tsx b/shared/desktop/renderer/main.desktop.tsx index 640693e7a1bd..f216bfdfa816 100644 --- a/shared/desktop/renderer/main.desktop.tsx +++ b/shared/desktop/renderer/main.desktop.tsx @@ -3,7 +3,7 @@ import './globals.desktop' import {isDarwin, isWindows} from '@/constants/platform' import '@/util/why-did-you-render' import KB2, {waitOnKB2Loaded} from '@/util/electron.desktop' -import * as DarkMode from '@/constants/darkmode' +import * as DarkMode from '@/stores/darkmode' waitOnKB2Loaded(() => { const {setSystemSupported, setSystemDarkMode} = DarkMode.useDarkModeState.getState().dispatch diff --git a/shared/desktop/renderer/main2.desktop.tsx b/shared/desktop/renderer/main2.desktop.tsx index 806f02d32eae..9a4faab9139f 100644 --- a/shared/desktop/renderer/main2.desktop.tsx +++ b/shared/desktop/renderer/main2.desktop.tsx @@ -12,8 +12,8 @@ import {initDesktopStyles} from '@/styles/index.desktop' import {isWindows} from '@/constants/platform' import KB2 from '@/util/electron.desktop' import {ignorePromise} from '@/constants/utils' -import {useConfigState} from '@/constants/config' -import {usePinentryState} from '@/constants/pinentry' +import {useConfigState} from '@/stores/config' +import {usePinentryState} from '@/stores/pinentry' import * as T from '@/constants/types' import {RPCError} from '@/util/errors' import {switchTab} from '@/constants/router2/util' @@ -25,7 +25,7 @@ import {debugWarning} from '@/util/debug-warning' import type {default as NewMainType} from '../../app/main.desktop' import {setServiceDecoration} from '@/common-adapters/markdown/react' import ServiceDecoration from '@/common-adapters/markdown/service-decoration' -import {useDarkModeState} from '@/constants/darkmode' +import {useDarkModeState} from '@/stores/darkmode' import {initPlatformListener, onEngineIncoming} from '@/constants/init/index.desktop' setServiceDecoration(ServiceDecoration) diff --git a/shared/devices/add-device.tsx b/shared/devices/add-device.tsx index 3b5726f11013..e27c6efffcc5 100644 --- a/shared/devices/add-device.tsx +++ b/shared/devices/add-device.tsx @@ -1,8 +1,8 @@ import * as C from '@/constants' -import * as Devices from '@/constants/devices' +import * as Devices from '@/stores/devices' import * as React from 'react' import * as Kb from '@/common-adapters' -import {useProvisionState} from '@/constants/provision' +import {useProvisionState} from '@/stores/provision' type OwnProps = { highlight?: Array<'computer' | 'phone' | 'paper key'> diff --git a/shared/devices/device-icon.tsx b/shared/devices/device-icon.tsx index 0121619b3fd5..cc698e7fe61d 100644 --- a/shared/devices/device-icon.tsx +++ b/shared/devices/device-icon.tsx @@ -1,5 +1,5 @@ -import type * as Provision from '@/constants/provision' -import * as Devices from '@/constants/devices' +import type * as Provision from '@/stores/provision' +import * as Devices from '@/stores/devices' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import type {IconStyle} from '@/common-adapters/icon' diff --git a/shared/devices/device-page.tsx b/shared/devices/device-page.tsx index dff22308c890..f270c62a1b27 100644 --- a/shared/devices/device-page.tsx +++ b/shared/devices/device-page.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Devices from '@/constants/devices' +import * as Devices from '@/stores/devices' import * as Kb from '@/common-adapters' import * as React from 'react' import type * as T from '@/constants/types' diff --git a/shared/devices/device-revoke.tsx b/shared/devices/device-revoke.tsx index 0d4ead70adde..90e0850a35fe 100644 --- a/shared/devices/device-revoke.tsx +++ b/shared/devices/device-revoke.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import {useConfigState} from '@/constants/config' -import * as Devices from '@/constants/devices' +import {useConfigState} from '@/stores/config' +import * as Devices from '@/stores/devices' import * as Kb from '@/common-adapters' import * as React from 'react' import * as T from '@/constants/types' -import {settingsDevicesTab} from '@/constants/settings' -import {useCurrentUserState} from '@/constants/current-user' +import {settingsDevicesTab} from '@/stores/settings' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {deviceID: string} diff --git a/shared/devices/index.tsx b/shared/devices/index.tsx index ebef2b008e50..4df196248347 100644 --- a/shared/devices/index.tsx +++ b/shared/devices/index.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Devices from '@/constants/devices' +import * as Devices from '@/stores/devices' import * as Kb from '@/common-adapters' import * as React from 'react' import DeviceRow, {NewContext} from './row' diff --git a/shared/devices/nav-header.tsx b/shared/devices/nav-header.tsx index 2176976bb9c3..66506b11fbe8 100644 --- a/shared/devices/nav-header.tsx +++ b/shared/devices/nav-header.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' -import type * as DevicesType from '@/constants/devices' +import type * as DevicesType from '@/stores/devices' import * as Kb from '@/common-adapters' import * as React from 'react' export const HeaderTitle = () => { - const Devices = require('@/constants/devices') as typeof DevicesType + const Devices = require('@/stores/devices') as typeof DevicesType const numActive = Devices.useActiveDeviceCounts() const numRevoked = Devices.useRevokedDeviceCounts() return ( diff --git a/shared/devices/row.tsx b/shared/devices/row.tsx index 5a384bbb9d81..3817ce3ef759 100644 --- a/shared/devices/row.tsx +++ b/shared/devices/row.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Devices from '@/constants/devices' +import * as Devices from '@/stores/devices' import * as Kb from '@/common-adapters' import * as React from 'react' import DeviceIcon from './device-icon' diff --git a/shared/fs/banner/conflict-banner.tsx b/shared/fs/banner/conflict-banner.tsx index 09898a2b91e6..c39440d9d96c 100644 --- a/shared/fs/banner/conflict-banner.tsx +++ b/shared/fs/banner/conflict-banner.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import openUrl from '@/util/open-url' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type OwnProps = { path: T.FS.Path diff --git a/shared/fs/banner/public-reminder.tsx b/shared/fs/banner/public-reminder.tsx index 16783c602a96..717e78175cf4 100644 --- a/shared/fs/banner/public-reminder.tsx +++ b/shared/fs/banner/public-reminder.tsx @@ -1,8 +1,8 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type Props = { path: T.FS.Path diff --git a/shared/fs/banner/reset-banner.tsx b/shared/fs/banner/reset-banner.tsx index 91e09bfd1b13..ab2366b4175d 100644 --- a/shared/fs/banner/reset-banner.tsx +++ b/shared/fs/banner/reset-banner.tsx @@ -4,10 +4,10 @@ import * as T from '@/constants/types' import {folderNameWithoutUsers} from '@/util/kbfs' import * as Kb from '@/common-adapters' import * as RowTypes from '@/fs/browser/rows/types' -import {useTrackerState} from '@/constants/tracker2' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' -import {useProfileState} from '@/constants/profile' +import {useTrackerState} from '@/stores/tracker2' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' +import {useProfileState} from '@/stores/profile' type OwnProps = {path: T.FS.Path} diff --git a/shared/fs/banner/system-file-manager-integration-banner/container.tsx b/shared/fs/banner/system-file-manager-integration-banner/container.tsx index 02877de920b0..0114e131cbad 100644 --- a/shared/fs/banner/system-file-manager-integration-banner/container.tsx +++ b/shared/fs/banner/system-file-manager-integration-banner/container.tsx @@ -3,8 +3,8 @@ import * as C from '@/constants' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import * as Kbfs from '@/fs/common' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type OwnProps = {alwaysShow?: boolean} diff --git a/shared/fs/banner/system-file-manager-integration-banner/kext-permission-popup.tsx b/shared/fs/banner/system-file-manager-integration-banner/kext-permission-popup.tsx index 759aa1d2fe21..7898cf2ca82c 100644 --- a/shared/fs/banner/system-file-manager-integration-banner/kext-permission-popup.tsx +++ b/shared/fs/banner/system-file-manager-integration-banner/kext-permission-popup.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import * as C from '@/constants' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const InstallSecurityPrefs = () => { const driverStatus = useFSState(s => s.sfmi.driverStatus) diff --git a/shared/fs/browser/destination-picker.tsx b/shared/fs/browser/destination-picker.tsx index 9a407bb950b8..b00bdd56608b 100644 --- a/shared/fs/browser/destination-picker.tsx +++ b/shared/fs/browser/destination-picker.tsx @@ -8,8 +8,8 @@ import NavHeaderTitle from '@/fs/nav-header/title' import Root from './root' import Rows from './rows/rows-container' import {OriginalOrCompressedButton} from '@/incoming-share' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type OwnProps = {index: number} diff --git a/shared/fs/browser/index.tsx b/shared/fs/browser/index.tsx index c4e8df63334d..b8dff985b6d0 100644 --- a/shared/fs/browser/index.tsx +++ b/shared/fs/browser/index.tsx @@ -10,8 +10,8 @@ import PublicReminder from '../banner/public-reminder' import Root from './root' import Rows from './rows/rows-container' import {asRows as resetBannerAsRows} from '../banner/reset-banner' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type OwnProps = {path: T.FS.Path} diff --git a/shared/fs/browser/offline.tsx b/shared/fs/browser/offline.tsx index 51f045b4fdba..3a3273e64ffe 100644 --- a/shared/fs/browser/offline.tsx +++ b/shared/fs/browser/offline.tsx @@ -1,8 +1,8 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import TopBar from '../top-bar' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type Props = { path: T.FS.Path diff --git a/shared/fs/browser/root.tsx b/shared/fs/browser/root.tsx index af39fbc45ea1..1a1cef90548c 100644 --- a/shared/fs/browser/root.tsx +++ b/shared/fs/browser/root.tsx @@ -5,9 +5,9 @@ import TlfType from './rows/tlf-type' import Tlf from './rows/tlf' import SfmiBanner from '../banner/system-file-manager-integration-banner/container' import {WrapRow} from './rows/rows' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' type Props = { destinationPickerIndex?: number diff --git a/shared/fs/browser/rows/editing.tsx b/shared/fs/browser/rows/editing.tsx index e6e19567d756..99ac037113a7 100644 --- a/shared/fs/browser/rows/editing.tsx +++ b/shared/fs/browser/rows/editing.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import {rowStyles} from './common' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type Props = { editID: T.FS.EditID diff --git a/shared/fs/browser/rows/rows-container.tsx b/shared/fs/browser/rows/rows-container.tsx index 9c3852859b96..37019066d45d 100644 --- a/shared/fs/browser/rows/rows-container.tsx +++ b/shared/fs/browser/rows/rows-container.tsx @@ -4,9 +4,9 @@ import * as RowTypes from './types' import {sortRowItems, type SortableRowItem} from './sort' import Rows, {type Props} from './rows' import {asRows as topBarAsRow} from '../../top-bar' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = { path: T.FS.Path // path to the parent folder containering the rows, diff --git a/shared/fs/browser/rows/still.tsx b/shared/fs/browser/rows/still.tsx index c5b1655ff3b4..f0a2ad9abbef 100644 --- a/shared/fs/browser/rows/still.tsx +++ b/shared/fs/browser/rows/still.tsx @@ -4,8 +4,8 @@ import {useOpen} from '@/fs/common/use-open' import {rowStyles, StillCommon} from './common' import * as Kb from '@/common-adapters' import {LastModifiedLine, Filename} from '@/fs/common' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type OwnProps = { destinationPickerIndex?: number diff --git a/shared/fs/browser/rows/tlf-type.tsx b/shared/fs/browser/rows/tlf-type.tsx index 908334f54352..e60d181d6f39 100644 --- a/shared/fs/browser/rows/tlf-type.tsx +++ b/shared/fs/browser/rows/tlf-type.tsx @@ -1,6 +1,6 @@ import * as T from '@/constants/types' import {useOpen} from '@/fs/common/use-open' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import {rowStyles, StillCommon} from './common' import * as Kb from '@/common-adapters' diff --git a/shared/fs/browser/rows/tlf.tsx b/shared/fs/browser/rows/tlf.tsx index 001ba2b64cdd..1092deddbaff 100644 --- a/shared/fs/browser/rows/tlf.tsx +++ b/shared/fs/browser/rows/tlf.tsx @@ -3,9 +3,9 @@ import {useOpen} from '@/fs/common/use-open' import {rowStyles, StillCommon} from './common' import * as Kb from '@/common-adapters' import {useFsPathMetadata, TlfInfoLine, Filename} from '@/fs/common' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' export type OwnProps = { destinationPickerIndex?: number diff --git a/shared/fs/common/errs-container.tsx b/shared/fs/common/errs-container.tsx index 7e86e484dd46..ae768869412a 100644 --- a/shared/fs/common/errs-container.tsx +++ b/shared/fs/common/errs-container.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as C from '@/constants' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const ErrsContainer = () => { const {_errors, _dismiss} = useFSState( diff --git a/shared/fs/common/folder-view-filter-icon.tsx b/shared/fs/common/folder-view-filter-icon.tsx index a843e380bf81..135aff8989f2 100644 --- a/shared/fs/common/folder-view-filter-icon.tsx +++ b/shared/fs/common/folder-view-filter-icon.tsx @@ -1,8 +1,8 @@ import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import type * as Styles from '@/styles' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type Props = { onClick: () => void diff --git a/shared/fs/common/folder-view-filter.tsx b/shared/fs/common/folder-view-filter.tsx index 7cf7dc787a71..45e1c6d835da 100644 --- a/shared/fs/common/folder-view-filter.tsx +++ b/shared/fs/common/folder-view-filter.tsx @@ -3,8 +3,8 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as React from 'react' import debounce from 'lodash/debounce' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type Props = { onCancel?: () => void diff --git a/shared/fs/common/hooks.tsx b/shared/fs/common/hooks.tsx index be2ac0bcaa39..95edbb6d8778 100644 --- a/shared/fs/common/hooks.tsx +++ b/shared/fs/common/hooks.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import logger from '@/logger' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' const isPathItem = (path: T.FS.Path) => T.FS.getPathLevel(path) > 2 || FS.hasSpecialFileElement(path) diff --git a/shared/fs/common/item-icon.tsx b/shared/fs/common/item-icon.tsx index 303b8e533dc2..8b0d42789caf 100644 --- a/shared/fs/common/item-icon.tsx +++ b/shared/fs/common/item-icon.tsx @@ -1,8 +1,8 @@ import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import type {IconType} from '@/common-adapters/icon' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' export type Size = 96 | 48 | 32 | 16 type SizeString = '96' | '48' | '32' | '16' diff --git a/shared/fs/common/kbfs-path.tsx b/shared/fs/common/kbfs-path.tsx index bc000fb40d44..847405ef0104 100644 --- a/shared/fs/common/kbfs-path.tsx +++ b/shared/fs/common/kbfs-path.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import PathInfo from './path-info' import PathItemInfo from './path-item-info' diff --git a/shared/fs/common/last-modified-line.tsx b/shared/fs/common/last-modified-line.tsx index 7a8d7893f508..a11c6be3625f 100644 --- a/shared/fs/common/last-modified-line.tsx +++ b/shared/fs/common/last-modified-line.tsx @@ -1,8 +1,8 @@ import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import {formatTimeForFS} from '@/util/timestamp' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' export type OwnProps = { path: T.FS.Path diff --git a/shared/fs/common/open-in-system-file-manager.tsx b/shared/fs/common/open-in-system-file-manager.tsx index 42758a5a7420..c45d43352971 100644 --- a/shared/fs/common/open-in-system-file-manager.tsx +++ b/shared/fs/common/open-in-system-file-manager.tsx @@ -3,7 +3,7 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import * as C from '@/constants' import SystemFileManagerIntegrationPopup from './sfmi-popup' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' type Props = {path: T.FS.Path} diff --git a/shared/fs/common/path-info.tsx b/shared/fs/common/path-info.tsx index 16e0f1ef9d51..25182ab0625a 100644 --- a/shared/fs/common/path-info.tsx +++ b/shared/fs/common/path-info.tsx @@ -1,8 +1,8 @@ import * as T from '@/constants/types' import {useFsPathInfo} from './hooks' import * as Kb from '@/common-adapters' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type PathInfoProps = { containerStyle?: Kb.Styles.StylesCrossPlatform diff --git a/shared/fs/common/path-item-action/choose-view.tsx b/shared/fs/common/path-item-action/choose-view.tsx index 7029ddf85d26..23421a3c10cd 100644 --- a/shared/fs/common/path-item-action/choose-view.tsx +++ b/shared/fs/common/path-item-action/choose-view.tsx @@ -2,7 +2,7 @@ import * as T from '@/constants/types' import type {FloatingMenuProps} from './types' import Menu from './menu-container' import Confirm from './confirm' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' type OwnProps = { floatingMenuProps: FloatingMenuProps diff --git a/shared/fs/common/path-item-action/confirm-delete.tsx b/shared/fs/common/path-item-action/confirm-delete.tsx index fbc3d3afe1aa..d47af5f53184 100644 --- a/shared/fs/common/path-item-action/confirm-delete.tsx +++ b/shared/fs/common/path-item-action/confirm-delete.tsx @@ -2,8 +2,8 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import * as C from '@/constants' import * as React from 'react' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' export type Props = { onBack: () => void diff --git a/shared/fs/common/path-item-action/confirm.tsx b/shared/fs/common/path-item-action/confirm.tsx index 73e19306d67c..c3fb1a363ea6 100644 --- a/shared/fs/common/path-item-action/confirm.tsx +++ b/shared/fs/common/path-item-action/confirm.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import * as T from '@/constants/types' import type {FloatingMenuProps} from './types' import * as Kb from '@/common-adapters' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type OwnProps = { floatingMenuProps: FloatingMenuProps diff --git a/shared/fs/common/path-item-action/index.tsx b/shared/fs/common/path-item-action/index.tsx index 46087ca280e2..00c24879ddbb 100644 --- a/shared/fs/common/path-item-action/index.tsx +++ b/shared/fs/common/path-item-action/index.tsx @@ -4,8 +4,8 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import ChooseView from './choose-view' import type {SizeType} from '@/common-adapters/icon' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' export type ClickableProps = { onClick: () => void diff --git a/shared/fs/common/path-item-action/layout.tsx b/shared/fs/common/path-item-action/layout.tsx index ec63a3a52b64..89a91060c446 100644 --- a/shared/fs/common/path-item-action/layout.tsx +++ b/shared/fs/common/path-item-action/layout.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as T from '@/constants/types' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' export type Layout = { archive: boolean diff --git a/shared/fs/common/path-item-action/menu-container.tsx b/shared/fs/common/path-item-action/menu-container.tsx index 996f366ea73c..9a7e2f751dd5 100644 --- a/shared/fs/common/path-item-action/menu-container.tsx +++ b/shared/fs/common/path-item-action/menu-container.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as Kbfs from '@/fs/common/hooks' import * as React from 'react' @@ -8,9 +8,9 @@ import * as Util from '@/util/kbfs' import Header from './header' import type {FloatingMenuProps} from './types' import {getRootLayout, getShareLayout} from './layout' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = { floatingMenuProps: FloatingMenuProps diff --git a/shared/fs/common/path-item-info.tsx b/shared/fs/common/path-item-info.tsx index 75d4bc69fb06..bd9d22d388f1 100644 --- a/shared/fs/common/path-item-info.tsx +++ b/shared/fs/common/path-item-info.tsx @@ -6,8 +6,8 @@ import ItemIcon from './item-icon' import CommaSeparatedName from './comma-separated-name' import {pluralize} from '@/util/string' import {useFsChildren, useFsPathMetadata, useFsOnlineStatus, useFsSoftError} from './hooks' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type Props = { containerStyle?: Kb.Styles.StylesCrossPlatform diff --git a/shared/fs/common/path-status-icon-container.tsx b/shared/fs/common/path-status-icon-container.tsx index 9a1440a507e2..0e6cb624b358 100644 --- a/shared/fs/common/path-status-icon-container.tsx +++ b/shared/fs/common/path-status-icon-container.tsx @@ -1,8 +1,8 @@ import * as T from '@/constants/types' import * as C from '@/constants' import PathStatusIcon from './path-status-icon' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type OwnPropsPathItem = { path: T.FS.Path diff --git a/shared/fs/common/refresh-driver-status-on-mount.tsx b/shared/fs/common/refresh-driver-status-on-mount.tsx index 9ce3cc4d12d5..c4739b49fa67 100644 --- a/shared/fs/common/refresh-driver-status-on-mount.tsx +++ b/shared/fs/common/refresh-driver-status-on-mount.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const RefreshDriverStatusOnMount = () => { const refreshDriverStatusDesktop = useFSState(s => s.dispatch.dynamic.refreshDriverStatusDesktop) diff --git a/shared/fs/common/sfmi-popup.tsx b/shared/fs/common/sfmi-popup.tsx index 9fbf8764643b..33aa3bbe952b 100644 --- a/shared/fs/common/sfmi-popup.tsx +++ b/shared/fs/common/sfmi-popup.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import {useFuseClosedSourceConsent} from './hooks' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' type Props = { mode: 'Icon' | 'Button' diff --git a/shared/fs/common/tlf-info-line-container.tsx b/shared/fs/common/tlf-info-line-container.tsx index 8b84d8962edd..09803b935e53 100644 --- a/shared/fs/common/tlf-info-line-container.tsx +++ b/shared/fs/common/tlf-info-line-container.tsx @@ -1,8 +1,8 @@ import * as T from '@/constants/types' import TlfInfoLine from './tlf-info-line' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' export type OwnProps = { path: T.FS.Path diff --git a/shared/fs/common/upload-button.tsx b/shared/fs/common/upload-button.tsx index 593688df6905..c335b8e84126 100644 --- a/shared/fs/common/upload-button.tsx +++ b/shared/fs/common/upload-button.tsx @@ -3,8 +3,8 @@ import * as T from '@/constants/types' import * as C from '@/constants' import * as Kb from '@/common-adapters' import type * as Styles from '@/styles' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type OwnProps = { path: T.FS.Path diff --git a/shared/fs/common/use-open.tsx b/shared/fs/common/use-open.tsx index 0e15b1719686..74a9ea2be194 100644 --- a/shared/fs/common/use-open.tsx +++ b/shared/fs/common/use-open.tsx @@ -1,8 +1,8 @@ import * as C from '@/constants' import * as T from '@/constants/types' import {useSafeNavigation} from '@/util/safe-navigation' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type Props = { path: T.FS.Path diff --git a/shared/fs/filepreview/bare-preview.tsx b/shared/fs/filepreview/bare-preview.tsx index bcbe04f750c7..f9d95b402178 100644 --- a/shared/fs/filepreview/bare-preview.tsx +++ b/shared/fs/filepreview/bare-preview.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import Footer from '../footer/footer' import View from './view' import * as Kbfs from '../common' diff --git a/shared/fs/filepreview/default-view.tsx b/shared/fs/filepreview/default-view.tsx index 41d252be7d54..70b01d0109ac 100644 --- a/shared/fs/filepreview/default-view.tsx +++ b/shared/fs/filepreview/default-view.tsx @@ -3,8 +3,8 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import {PathItemAction, LastModifiedLine, ItemIcon, type ClickableProps} from '../common' import {hasShare} from '../common/path-item-action/layout' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' type OwnProps = {path: T.FS.Path} diff --git a/shared/fs/filepreview/view.tsx b/shared/fs/filepreview/view.tsx index 2765510266e7..aad5f4757683 100644 --- a/shared/fs/filepreview/view.tsx +++ b/shared/fs/filepreview/view.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as T from '@/constants/types' import DefaultView from './default-view' @@ -7,8 +7,8 @@ import TextView from './text-view' import AVView from './av-view' import PdfView from './pdf-view' import * as Kb from '@/common-adapters' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' type Props = { path: T.FS.Path diff --git a/shared/fs/footer/download.tsx b/shared/fs/footer/download.tsx index 3d2177cbd799..062e69bc0a46 100644 --- a/shared/fs/footer/download.tsx +++ b/shared/fs/footer/download.tsx @@ -4,8 +4,8 @@ import * as C from '@/constants' import * as T from '@/constants/types' import DownloadWrapper from './download-wrapper' import {formatDurationFromNowTo} from '@/util/timestamp' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' export type Props = { downloadID: string diff --git a/shared/fs/footer/downloads.tsx b/shared/fs/footer/downloads.tsx index 7983b96c0020..bee401a9f534 100644 --- a/shared/fs/footer/downloads.tsx +++ b/shared/fs/footer/downloads.tsx @@ -2,7 +2,7 @@ import * as Kb from '@/common-adapters' import * as C from '@/constants' import * as Kbfs from '../common' import Download from './download' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const Mobile = () => { Kbfs.useFsDownloadStatus() diff --git a/shared/fs/footer/proof-broken.tsx b/shared/fs/footer/proof-broken.tsx index 186b5106bb28..852d5b5f925d 100644 --- a/shared/fs/footer/proof-broken.tsx +++ b/shared/fs/footer/proof-broken.tsx @@ -1,7 +1,7 @@ import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' -import * as FS from '@/constants/fs' -import {useUsersState} from '@/constants/users' +import * as FS from '@/stores/fs' +import {useUsersState} from '@/stores/users' type Props = {path: T.FS.Path} diff --git a/shared/fs/footer/upload-container.tsx b/shared/fs/footer/upload-container.tsx index 73bfd3b2d3ef..31193f51a235 100644 --- a/shared/fs/footer/upload-container.tsx +++ b/shared/fs/footer/upload-container.tsx @@ -2,8 +2,8 @@ import * as T from '@/constants/types' import Upload from './upload' import {useUploadCountdown} from './use-upload-countdown' import * as C from '@/constants' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' // NOTE flip this to show a button to debug the upload banner animations. const enableDebugUploadBanner = false as boolean diff --git a/shared/fs/index.tsx b/shared/fs/index.tsx index 304ce8342ced..78fa22597830 100644 --- a/shared/fs/index.tsx +++ b/shared/fs/index.tsx @@ -5,8 +5,8 @@ import Browser from './browser' import {NormalPreview} from './filepreview' import * as Kbfs from './common' import * as SimpleScreens from './simple-screens' -import {useFSState} from '@/constants/fs' -import * as FS from '@/constants/fs' +import {useFSState} from '@/stores/fs' +import * as FS from '@/stores/fs' type ChooseComponentProps = { emitBarePreview: () => void diff --git a/shared/fs/nav-header/actions.tsx b/shared/fs/nav-header/actions.tsx index 497c67488b7f..014b0c7e1331 100644 --- a/shared/fs/nav-header/actions.tsx +++ b/shared/fs/nav-header/actions.tsx @@ -3,8 +3,8 @@ import * as T from '@/constants/types' import * as React from 'react' import * as Kb from '@/common-adapters' import * as Kbfs from '../common' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' type Props = { onTriggerFilterMobile: () => void diff --git a/shared/fs/nav-header/main-banner.tsx b/shared/fs/nav-header/main-banner.tsx index 73150635e474..4c24a1390ca4 100644 --- a/shared/fs/nav-header/main-banner.tsx +++ b/shared/fs/nav-header/main-banner.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' type Props = { onRetry: () => void diff --git a/shared/fs/nav-header/mobile-header.tsx b/shared/fs/nav-header/mobile-header.tsx index 1364d912bc1c..3868d0e25ba9 100644 --- a/shared/fs/nav-header/mobile-header.tsx +++ b/shared/fs/nav-header/mobile-header.tsx @@ -5,8 +5,8 @@ import * as Kbfs from '../common' import type * as T from '@/constants/types' import Actions from './actions' import MainBanner from './main-banner' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' /* * diff --git a/shared/fs/nav-header/title.tsx b/shared/fs/nav-header/title.tsx index a1419632345f..1bcb3e156a77 100644 --- a/shared/fs/nav-header/title.tsx +++ b/shared/fs/nav-header/title.tsx @@ -3,7 +3,7 @@ import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import * as Kbfs from '../common' import {useSafeNavigation} from '@/util/safe-navigation' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' type Props = { path: T.FS.Path diff --git a/shared/fs/routes.tsx b/shared/fs/routes.tsx index f96c5d4f17c3..f9d6796ef092 100644 --- a/shared/fs/routes.tsx +++ b/shared/fs/routes.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as T from '@/constants/types' import * as C from '@/constants' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import {Actions, MainBanner, MobileHeader, Title} from './nav-header' const FsRoot = React.lazy(async () => import('.')) diff --git a/shared/fs/top-bar/loading.tsx b/shared/fs/top-bar/loading.tsx index 1aee292386c8..214ecb0a9539 100644 --- a/shared/fs/top-bar/loading.tsx +++ b/shared/fs/top-bar/loading.tsx @@ -1,8 +1,8 @@ import * as T from '@/constants/types' import * as C from '@/constants' import * as Kb from '@/common-adapters' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' // The behavior is to only show spinner when user first time lands on a screen // and when don't have the data that drives it yet. Since RPCs happen diff --git a/shared/fs/top-bar/sort.tsx b/shared/fs/top-bar/sort.tsx index f2057895d10f..30db41b3f6be 100644 --- a/shared/fs/top-bar/sort.tsx +++ b/shared/fs/top-bar/sort.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as T from '@/constants/types' import * as React from 'react' import * as Kb from '@/common-adapters' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' type OwnProps = { path: T.FS.Path diff --git a/shared/fs/top-bar/sync-toggle.tsx b/shared/fs/top-bar/sync-toggle.tsx index 437300313c8d..cdc1e573a46d 100644 --- a/shared/fs/top-bar/sync-toggle.tsx +++ b/shared/fs/top-bar/sync-toggle.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as T from '@/constants/types' import * as React from 'react' import * as Kb from '@/common-adapters' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' type OwnProps = { tlfPath: T.FS.Path diff --git a/shared/git/delete-repo.tsx b/shared/git/delete-repo.tsx index 88b1804a1f83..1be08287171f 100644 --- a/shared/git/delete-repo.tsx +++ b/shared/git/delete-repo.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as React from 'react' -import * as Git from '@/constants/git' +import * as Git from '@/stores/git' type OwnProps = {id: string} diff --git a/shared/git/index.tsx b/shared/git/index.tsx index 168a9715ed72..aaf29607752f 100644 --- a/shared/git/index.tsx +++ b/shared/git/index.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Git from '@/constants/git' +import * as Git from '@/stores/git' import * as Kb from '@/common-adapters' import * as React from 'react' import Row, {NewContext} from './row' diff --git a/shared/git/nav-header.tsx b/shared/git/nav-header.tsx index 5dafe65dd6ca..26d239bb94c9 100644 --- a/shared/git/nav-header.tsx +++ b/shared/git/nav-header.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Git from '@/constants/git' +import * as Git from '@/stores/git' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/git/new-repo.tsx b/shared/git/new-repo.tsx index fd7ded7e79f5..2672731dc6a7 100644 --- a/shared/git/new-repo.tsx +++ b/shared/git/new-repo.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as Git from '@/constants/git' -import * as Teams from '@/constants/teams' +import * as Git from '@/stores/git' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as React from 'react' diff --git a/shared/git/row.tsx b/shared/git/row.tsx index 4402b545eb79..7151506dfb61 100644 --- a/shared/git/row.tsx +++ b/shared/git/row.tsx @@ -1,13 +1,13 @@ import * as C from '@/constants' -import * as Git from '@/constants/git' -import * as Teams from '@/constants/teams' +import * as Git from '@/stores/git' +import * as Teams from '@/stores/teams' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import * as React from 'react' import openURL from '@/util/open-url' -import {useTrackerState} from '@/constants/tracker2' -import * as FS from '@/constants/fs' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import * as FS from '@/stores/fs' +import {useCurrentUserState} from '@/stores/current-user' export const NewContext = React.createContext>(new Set()) diff --git a/shared/git/select-channel.tsx b/shared/git/select-channel.tsx index a2cee7e5f3cb..a4b40c3af1af 100644 --- a/shared/git/select-channel.tsx +++ b/shared/git/select-channel.tsx @@ -1,5 +1,5 @@ -import * as Git from '@/constants/git' -import * as Teams from '@/constants/teams' +import * as Git from '@/stores/git' +import * as Teams from '@/stores/teams' import {useSafeNavigation} from '@/util/safe-navigation' import * as Kb from '@/common-adapters' import * as React from 'react' diff --git a/shared/incoming-share/index.tsx b/shared/incoming-share/index.tsx index 610c72636a1c..331def063e5f 100644 --- a/shared/incoming-share/index.tsx +++ b/shared/incoming-share/index.tsx @@ -4,10 +4,10 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import * as FsCommon from '@/fs/common' import {MobileSendToChat} from '../chat/send-to-chat' -import {settingsFeedbackTab} from '@/constants/settings' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' -import {useConfigState} from '@/constants/config' +import {settingsFeedbackTab} from '@/stores/settings' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' +import {useConfigState} from '@/stores/config' export const OriginalOrCompressedButton = ({incomingShareItems}: IncomingShareProps) => { const originalTotalSize = incomingShareItems.reduce((bytes, item) => bytes + (item.originalSize ?? 0), 0) diff --git a/shared/login/index.tsx b/shared/login/index.tsx index cd680fd69a09..1c052d3559d0 100644 --- a/shared/login/index.tsx +++ b/shared/login/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import {useConfigState} from '@/constants/config' -import {useDaemonState} from '@/constants/daemon' +import {useConfigState} from '@/stores/config' +import {useDaemonState} from '@/stores/daemon' const Loading = React.lazy(async () => import('./loading')) const Relogin = React.lazy(async () => import('./relogin/container')) diff --git a/shared/login/join-or-login.tsx b/shared/login/join-or-login.tsx index 543fb0be1d2c..0e4b0c267713 100644 --- a/shared/login/join-or-login.tsx +++ b/shared/login/join-or-login.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' import * as React from 'react' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as Kb from '@/common-adapters' import {InfoIcon} from '@/signup/common' -import {useSignupState} from '@/constants/signup' -import {useProvisionState} from '@/constants/provision' +import {useSignupState} from '@/stores/signup' +import {useProvisionState} from '@/stores/provision' const Intro = () => { const justDeletedSelf = useConfigState(s => s.justDeletedSelf) diff --git a/shared/login/loading.tsx b/shared/login/loading.tsx index 7d48b3dec130..41237f127c88 100644 --- a/shared/login/loading.tsx +++ b/shared/login/loading.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' -import {useDaemonState} from '@/constants/daemon' +import {useDaemonState} from '@/stores/daemon' const SplashContainer = () => { const failedReason = useDaemonState(s => s.handshakeFailedReason) diff --git a/shared/login/recover-password/device-selector.tsx b/shared/login/recover-password/device-selector.tsx index 150fb2d21f5a..e73f81372b15 100644 --- a/shared/login/recover-password/device-selector.tsx +++ b/shared/login/recover-password/device-selector.tsx @@ -1,5 +1,5 @@ import SelectOtherDevice from '@/provision/select-other-device' -import {useState as useRecoverState} from '@/constants/recover-password' +import {useState as useRecoverState} from '@/stores/recover-password' const RecoverPasswordDeviceSelector = () => { const devices = useRecoverState(s => s.devices) diff --git a/shared/login/recover-password/error-modal.tsx b/shared/login/recover-password/error-modal.tsx index efe62179c6c4..14cb7f80d1e5 100644 --- a/shared/login/recover-password/error-modal.tsx +++ b/shared/login/recover-password/error-modal.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import {useState as useRecoverState} from '@/constants/recover-password' -import {useConfigState} from '@/constants/config' +import {useState as useRecoverState} from '@/stores/recover-password' +import {useConfigState} from '@/stores/config' const styles = Kb.Styles.styleSheetCreate(() => ({ padding: { diff --git a/shared/login/recover-password/error.tsx b/shared/login/recover-password/error.tsx index 789cbf323102..c38307524d2e 100644 --- a/shared/login/recover-password/error.tsx +++ b/shared/login/recover-password/error.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import type {ButtonType} from '@/common-adapters/button' import {SignupScreen} from '@/signup/common' -import {useState as useRecoverState} from '@/constants/recover-password' -import {useConfigState} from '@/constants/config' +import {useState as useRecoverState} from '@/stores/recover-password' +import {useConfigState} from '@/stores/config' const ConnectedError = () => { const loggedIn = useConfigState(s => s.loggedIn) diff --git a/shared/login/recover-password/explain-device.tsx b/shared/login/recover-password/explain-device.tsx index 06890c97dab8..f9bd16930337 100644 --- a/shared/login/recover-password/explain-device.tsx +++ b/shared/login/recover-password/explain-device.tsx @@ -3,7 +3,7 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import type {ButtonType} from '@/common-adapters/button' import {SignupScreen} from '@/signup/common' -import {useState as useRecoverState} from '@/constants/recover-password' +import {useState as useRecoverState} from '@/stores/recover-password' const ConnectedExplainDevice = () => { const ed = useRecoverState(s => s.explainedDevice) diff --git a/shared/login/recover-password/paper-key.tsx b/shared/login/recover-password/paper-key.tsx index 5e2a332af6d9..9d1983af7a1d 100644 --- a/shared/login/recover-password/paper-key.tsx +++ b/shared/login/recover-password/paper-key.tsx @@ -3,7 +3,7 @@ import * as Kb from '@/common-adapters' import * as React from 'react' import type {ButtonType} from '@/common-adapters/button' import {SignupScreen} from '@/signup/common' -import {useState as useRecoverState} from '@/constants/recover-password' +import {useState as useRecoverState} from '@/stores/recover-password' const PaperKey = () => { const error = useRecoverState(s => s.paperKeyError) diff --git a/shared/login/recover-password/password.tsx b/shared/login/recover-password/password.tsx index 452ca011543a..2e61426b7edc 100644 --- a/shared/login/recover-password/password.tsx +++ b/shared/login/recover-password/password.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import {UpdatePassword} from '@/settings/password' -import {useState as useRecoverState} from '@/constants/recover-password' +import {useState as useRecoverState} from '@/stores/recover-password' const Password = () => { const error = useRecoverState(s => s.passwordError) diff --git a/shared/login/recover-password/prompt-reset-shared.tsx b/shared/login/recover-password/prompt-reset-shared.tsx index da223aa06338..dff66e082417 100644 --- a/shared/login/recover-password/prompt-reset-shared.tsx +++ b/shared/login/recover-password/prompt-reset-shared.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' +import * as AutoReset from '@/stores/autoreset' import * as React from 'react' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' import * as T from '@/constants/types' import {SignupScreen} from '@/signup/common' import type {ButtonType} from '@/common-adapters/button' -import {useState as useRecoverState} from '@/constants/recover-password' +import {useState as useRecoverState} from '@/stores/recover-password' export type Props = { resetPassword?: boolean diff --git a/shared/login/relogin/container.tsx b/shared/login/relogin/container.tsx index 2e80b7856bc6..ee18a0195aa3 100644 --- a/shared/login/relogin/container.tsx +++ b/shared/login/relogin/container.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' import * as React from 'react' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import Login from '.' import sortBy from 'lodash/sortBy' -import {useState as useRecoverState} from '@/constants/recover-password' -import {useSignupState} from '@/constants/signup' -import {useProvisionState} from '@/constants/provision' +import {useState as useRecoverState} from '@/stores/recover-password' +import {useSignupState} from '@/stores/signup' +import {useProvisionState} from '@/stores/provision' const needPasswordError = 'passphrase cannot be empty' diff --git a/shared/login/reset/confirm.tsx b/shared/login/reset/confirm.tsx index 5ce7f9b7d53e..e8a22339520d 100644 --- a/shared/login/reset/confirm.tsx +++ b/shared/login/reset/confirm.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' +import * as AutoReset from '@/stores/autoreset' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import {useState as useRecoverState} from '@/constants/recover-password' +import {useState as useRecoverState} from '@/stores/recover-password' const ConfirmReset = () => { const hasWallet = AutoReset.useAutoResetState(s => s.hasWallet) diff --git a/shared/login/reset/modal.tsx b/shared/login/reset/modal.tsx index 3aa3e2b5ef66..9e3e48bd8db4 100644 --- a/shared/login/reset/modal.tsx +++ b/shared/login/reset/modal.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' +import * as AutoReset from '@/stores/autoreset' import * as React from 'react' import * as Kb from '@/common-adapters' import {formatDurationForAutoreset} from '@/util/timestamp' diff --git a/shared/login/reset/password-enter.tsx b/shared/login/reset/password-enter.tsx index c749c5f801e6..010a4cdaf290 100644 --- a/shared/login/reset/password-enter.tsx +++ b/shared/login/reset/password-enter.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' +import * as AutoReset from '@/stores/autoreset' import * as React from 'react' import * as Kb from '@/common-adapters' import {SignupScreen} from '@/signup/common' diff --git a/shared/login/reset/password-known.tsx b/shared/login/reset/password-known.tsx index c606206718b4..f955e6b7d183 100644 --- a/shared/login/reset/password-known.tsx +++ b/shared/login/reset/password-known.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' +import * as AutoReset from '@/stores/autoreset' import * as React from 'react' import * as Kb from '@/common-adapters' import {SignupScreen} from '@/signup/common' diff --git a/shared/login/reset/waiting.tsx b/shared/login/reset/waiting.tsx index 9dea7f219397..adf2b26d7ace 100644 --- a/shared/login/reset/waiting.tsx +++ b/shared/login/reset/waiting.tsx @@ -3,7 +3,7 @@ import * as Kb from '@/common-adapters' import {SignupScreen} from '@/signup/common' import {addTicker, removeTicker} from '@/util/second-timer' import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' +import * as AutoReset from '@/stores/autoreset' import {useSafeNavigation} from '@/util/safe-navigation' import {formatDurationForAutoreset as formatDuration} from '@/util/timestamp' diff --git a/shared/login/signup/error.tsx b/shared/login/signup/error.tsx index f646b1337698..04ff47e90e7b 100644 --- a/shared/login/signup/error.tsx +++ b/shared/login/signup/error.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import {Wrapper, ContinueButton} from './common' -import {useSignupState} from '@/constants/signup' +import {useSignupState} from '@/stores/signup' const ConnectedSignupError = () => { const error = useSignupState(s => s.signupError) diff --git a/shared/menubar/chat-container.desktop.tsx b/shared/menubar/chat-container.desktop.tsx index e00fdc6bc561..6bcff1bb9438 100644 --- a/shared/menubar/chat-container.desktop.tsx +++ b/shared/menubar/chat-container.desktop.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as R from '@/constants/remote' import * as RemoteGen from '../actions/remote-gen' import * as Kb from '@/common-adapters' diff --git a/shared/menubar/files-container.desktop.tsx b/shared/menubar/files-container.desktop.tsx index 773a166b515b..aea7e75c0361 100644 --- a/shared/menubar/files-container.desktop.tsx +++ b/shared/menubar/files-container.desktop.tsx @@ -1,4 +1,4 @@ -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as R from '@/constants/remote' import * as T from '@/constants/types' import * as RemoteGen from '../actions/remote-gen' @@ -6,7 +6,7 @@ import * as FsUtil from '@/util/kbfs' import * as TimestampUtil from '@/util/timestamp' import {FilesPreview} from './files.desktop' import type {DeserializeProps} from './remote-serializer.desktop' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' const FilesContainer = (p: Pick) => { const {remoteTlfUpdates} = p diff --git a/shared/menubar/remote-container.desktop.tsx b/shared/menubar/remote-container.desktop.tsx index fa658dbb9793..ed5a78d8ee00 100644 --- a/shared/menubar/remote-container.desktop.tsx +++ b/shared/menubar/remote-container.desktop.tsx @@ -1,14 +1,14 @@ import * as React from 'react' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import Menubar from './index.desktop' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import type {DeserializeProps} from './remote-serializer.desktop' import {useAvatarState} from '@/common-adapters/avatar/store' -import {useUsersState} from '@/constants/users' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' -import {useDaemonState} from '@/constants/daemon' -import {useDarkModeState} from '@/constants/darkmode' +import {useUsersState} from '@/stores/users' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' +import {useDaemonState} from '@/stores/daemon' +import {useDarkModeState} from '@/stores/darkmode' const RemoteContainer = (d: DeserializeProps) => { const {avatarRefreshCounter, badgeMap, daemonHandshakeState, darkMode, diskSpaceStatus, endEstimate} = d diff --git a/shared/menubar/remote-proxy.desktop.tsx b/shared/menubar/remote-proxy.desktop.tsx index c32e0a8c65e7..4e79d95e0e4e 100644 --- a/shared/menubar/remote-proxy.desktop.tsx +++ b/shared/menubar/remote-proxy.desktop.tsx @@ -1,7 +1,7 @@ // A mirror of the remote menubar windows. import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useConfigState} from '@/constants/config' +import * as Chat from '@/stores/chat2' +import {useConfigState} from '@/stores/config' import * as T from '@/constants/types' import * as React from 'react' import KB2 from '@/util/electron.desktop' @@ -10,16 +10,16 @@ import {intersect} from '@/util/set' import {mapFilterByKey} from '@/util/map' import {serialize, type ProxyProps, type RemoteTlfUpdates} from './remote-serializer.desktop' import {useAvatarState} from '@/common-adapters/avatar/store' -import type * as NotifConstants from '@/constants/notifications' +import type * as NotifConstants from '@/stores/notifications' import {useColorScheme} from 'react-native' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' -import {useFollowerState} from '@/constants/followers' -import {useUsersState} from '@/constants/users' -import {useNotifState} from '@/constants/notifications' -import {useCurrentUserState} from '@/constants/current-user' -import {useDaemonState} from '@/constants/daemon' -import {useDarkModeState} from '@/constants/darkmode' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' +import {useFollowerState} from '@/stores/followers' +import {useUsersState} from '@/stores/users' +import {useNotifState} from '@/stores/notifications' +import {useCurrentUserState} from '@/stores/current-user' +import {useDaemonState} from '@/stores/daemon' +import {useDarkModeState} from '@/stores/darkmode' const {showTray} = KB2.functions diff --git a/shared/people/announcement.tsx b/shared/people/announcement.tsx index 7a6e55dd442c..8e44e7145ec9 100644 --- a/shared/people/announcement.tsx +++ b/shared/people/announcement.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' import openURL from '@/util/open-url' import * as Kb from '@/common-adapters' import PeopleItem from './item' import * as Settings from '@/constants/settings/util' -import {usePeopleState} from '@/constants/people' +import {usePeopleState} from '@/stores/people' type OwnProps = { appLink?: T.RPCGen.AppLinkType diff --git a/shared/people/container.tsx b/shared/people/container.tsx index e1301cfc5f60..3016d4fe3cce 100644 --- a/shared/people/container.tsx +++ b/shared/people/container.tsx @@ -2,10 +2,10 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import People from '.' -import {useSignupState} from '@/constants/signup' -import {useProfileState} from '@/constants/profile' -import {usePeopleState, getPeopleDataWaitingKey} from '@/constants/people' -import {useCurrentUserState} from '@/constants/current-user' +import {useSignupState} from '@/stores/signup' +import {useProfileState} from '@/stores/profile' +import {usePeopleState, getPeopleDataWaitingKey} from '@/stores/people' +import {useCurrentUserState} from '@/stores/current-user' const waitToRefresh = 1000 * 60 * 5 diff --git a/shared/people/index.shared.tsx b/shared/people/index.shared.tsx index 66edb1f66e6d..e51585aa6339 100644 --- a/shared/people/index.shared.tsx +++ b/shared/people/index.shared.tsx @@ -7,8 +7,8 @@ import FollowNotification from './follow-notification' import FollowSuggestions from './follow-suggestions' import type {Props} from '.' import Todo from './todo' -import {useSignupState} from '@/constants/signup' -import {usePeopleState} from '@/constants/people' +import {useSignupState} from '@/stores/signup' +import {usePeopleState} from '@/stores/people' // import WotTask from './wot-task' const itemToComponent: (item: T.Immutable, props: Props) => React.ReactNode = ( diff --git a/shared/people/routes.tsx b/shared/people/routes.tsx index 1a73b36b39b9..f6c42a6f7051 100644 --- a/shared/people/routes.tsx +++ b/shared/people/routes.tsx @@ -3,7 +3,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import peopleTeamBuilder from '../team-building/page' import ProfileSearch from '../profile/search' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' const HeaderAvatar = () => { const myUsername = useCurrentUserState(s => s.username) diff --git a/shared/people/todo.tsx b/shared/people/todo.tsx index 512f1545b35f..87cafea4576a 100644 --- a/shared/people/todo.tsx +++ b/shared/people/todo.tsx @@ -1,18 +1,18 @@ import * as C from '@/constants' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as React from 'react' import openURL from '@/util/open-url' import type * as T from '@/constants/types' import type {IconType} from '@/common-adapters/icon.constants-gen' import PeopleItem, {type TaskButton} from './item' import * as Kb from '@/common-adapters' -import {useSettingsPhoneState} from '@/constants/settings-phone' -import {useSettingsEmailState} from '@/constants/settings-email' +import {useSettingsPhoneState} from '@/stores/settings-phone' +import {useSettingsEmailState} from '@/stores/settings-email' import {settingsAccountTab, settingsGitTab} from '@/constants/settings/util' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' -import {usePeopleState, todoTypes} from '@/constants/people' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' +import {usePeopleState, todoTypes} from '@/stores/people' +import {useCurrentUserState} from '@/stores/current-user' type TodoOwnProps = { badged: boolean diff --git a/shared/pinentry/remote-container.desktop.tsx b/shared/pinentry/remote-container.desktop.tsx index 97f0967a1e16..316f528a9e14 100644 --- a/shared/pinentry/remote-container.desktop.tsx +++ b/shared/pinentry/remote-container.desktop.tsx @@ -3,7 +3,7 @@ import * as RemoteGen from '../actions/remote-gen' import * as R from '@/constants/remote' import Pinentry from './index.desktop' import type {DeserializeProps} from './remote-serializer.desktop' -import {useDarkModeState} from '@/constants/darkmode' +import {useDarkModeState} from '@/stores/darkmode' const RemoteContainer = (d: DeserializeProps) => { const {darkMode, ...rest} = d diff --git a/shared/pinentry/remote-proxy.desktop.tsx b/shared/pinentry/remote-proxy.desktop.tsx index 587043c04c1d..ea897586694b 100644 --- a/shared/pinentry/remote-proxy.desktop.tsx +++ b/shared/pinentry/remote-proxy.desktop.tsx @@ -6,7 +6,7 @@ import useBrowserWindow from '../desktop/remote/use-browser-window.desktop' import useSerializeProps from '../desktop/remote/use-serialize-props.desktop' import {serialize, type ProxyProps} from './remote-serializer.desktop' import {useColorScheme} from 'react-native' -import {usePinentryState} from '@/constants/pinentry' +import {usePinentryState} from '@/stores/pinentry' const windowOpts = {height: 230, width: 440} diff --git a/shared/pinentry/remote-serializer.desktop.tsx b/shared/pinentry/remote-serializer.desktop.tsx index 96f859f93cce..ca291a3014af 100644 --- a/shared/pinentry/remote-serializer.desktop.tsx +++ b/shared/pinentry/remote-serializer.desktop.tsx @@ -1,5 +1,5 @@ import * as T from '@/constants/types' -import type * as Constants from '@/constants/pinentry' +import type * as Constants from '@/stores/pinentry' import {produce} from 'immer' export type ProxyProps = { diff --git a/shared/profile/add-to-team.tsx b/shared/profile/add-to-team.tsx index a19e220412bc..26ca7d22b19e 100644 --- a/shared/profile/add-to-team.tsx +++ b/shared/profile/add-to-team.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import type * as T from '@/constants/types' import {FloatingRolePicker, sendNotificationFooter} from '@/teams/role-picker' import * as Kb from '@/common-adapters' diff --git a/shared/profile/confirm-or-pending.tsx b/shared/profile/confirm-or-pending.tsx index e0a49954bb5a..f33f9325224e 100644 --- a/shared/profile/confirm-or-pending.tsx +++ b/shared/profile/confirm-or-pending.tsx @@ -1,4 +1,4 @@ -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import {subtitle} from '@/util/platforms' diff --git a/shared/profile/edit-avatar/hooks.tsx b/shared/profile/edit-avatar/hooks.tsx index 68e576fc94fb..2455064629a1 100644 --- a/shared/profile/edit-avatar/hooks.tsx +++ b/shared/profile/edit-avatar/hooks.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' -import * as Teams from '@/constants/teams' +import {useProfileState} from '@/stores/profile' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import type {Props} from '.' diff --git a/shared/profile/edit-profile.tsx b/shared/profile/edit-profile.tsx index 61bb397bab2a..c153a4866cf4 100644 --- a/shared/profile/edit-profile.tsx +++ b/shared/profile/edit-profile.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as React from 'react' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' +import {useCurrentUserState} from '@/stores/current-user' const Container = () => { const username = useCurrentUserState(s => s.username) diff --git a/shared/profile/generic/enter-username.tsx b/shared/profile/generic/enter-username.tsx index 41fee450433c..550411e67338 100644 --- a/shared/profile/generic/enter-username.tsx +++ b/shared/profile/generic/enter-username.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import openURL from '@/util/open-url' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/profile/generic/proofs-list.tsx b/shared/profile/generic/proofs-list.tsx index 20c8dae21a8a..ffbfa6fe9f16 100644 --- a/shared/profile/generic/proofs-list.tsx +++ b/shared/profile/generic/proofs-list.tsx @@ -5,8 +5,8 @@ import type * as T from '@/constants/types' import {SiteIcon} from './shared' import {makeInsertMatcher} from '@/util/string' import {useColorScheme} from 'react-native' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' const Container = () => { const _proofSuggestions = useTrackerState(s => s.proofSuggestions) diff --git a/shared/profile/generic/result.tsx b/shared/profile/generic/result.tsx index db0e0b49a419..765700b8b568 100644 --- a/shared/profile/generic/result.tsx +++ b/shared/profile/generic/result.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' import {SiteIcon} from './shared' diff --git a/shared/profile/pgp/finished/index.desktop.tsx b/shared/profile/pgp/finished/index.desktop.tsx index 89e7f6c192cb..22e9341df3e8 100644 --- a/shared/profile/pgp/finished/index.desktop.tsx +++ b/shared/profile/pgp/finished/index.desktop.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as React from 'react' import * as Kb from '@/common-adapters' import Modal from '@/profile/modal' diff --git a/shared/profile/pgp/generate/index.desktop.tsx b/shared/profile/pgp/generate/index.desktop.tsx index ed1be8203b1a..b144be1e0b6b 100644 --- a/shared/profile/pgp/generate/index.desktop.tsx +++ b/shared/profile/pgp/generate/index.desktop.tsx @@ -1,6 +1,6 @@ import * as Kb from '@/common-adapters' import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import Modal from '@/profile/modal' export default function Generate() { diff --git a/shared/profile/pgp/info/index.desktop.tsx b/shared/profile/pgp/info/index.desktop.tsx index af9859070160..8da249f27ec5 100644 --- a/shared/profile/pgp/info/index.desktop.tsx +++ b/shared/profile/pgp/info/index.desktop.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' import Modal from '@/profile/modal' diff --git a/shared/profile/post-proof.tsx b/shared/profile/post-proof.tsx index ddcc5b7e3b1c..7f52f1b555be 100644 --- a/shared/profile/post-proof.tsx +++ b/shared/profile/post-proof.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as React from 'react' import * as Kb from '@/common-adapters' import {subtitle} from '@/util/platforms' import openUrl from '@/util/open-url' import Modal from './modal' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const Container = () => { const platform = useProfileState(s => s.platform) diff --git a/shared/profile/prove-enter-username.tsx b/shared/profile/prove-enter-username.tsx index f64207564d86..5bd8cc0d1398 100644 --- a/shared/profile/prove-enter-username.tsx +++ b/shared/profile/prove-enter-username.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as React from 'react' import * as Kb from '@/common-adapters' import Modal from './modal' diff --git a/shared/profile/prove-website-choice.tsx b/shared/profile/prove-website-choice.tsx index 7eabba0143a9..ff6e664c9f14 100644 --- a/shared/profile/prove-website-choice.tsx +++ b/shared/profile/prove-website-choice.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' import Modal from './modal' diff --git a/shared/profile/revoke.tsx b/shared/profile/revoke.tsx index 5fa5097c28f8..aa34864f41ae 100644 --- a/shared/profile/revoke.tsx +++ b/shared/profile/revoke.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' import capitalize from 'lodash/capitalize' import {subtitle as platformSubtitle} from '@/util/platforms' diff --git a/shared/profile/showcase-team-offer.tsx b/shared/profile/showcase-team-offer.tsx index 0041a0725477..12c43db82598 100644 --- a/shared/profile/showcase-team-offer.tsx +++ b/shared/profile/showcase-team-offer.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import type * as T from '@/constants/types' import {useTeamsSubscribe} from '@/teams/subscriber' -import {useTrackerState} from '@/constants/tracker2' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useCurrentUserState} from '@/stores/current-user' const Container = () => { const waiting = C.useWaitingState(s => s.counts) diff --git a/shared/profile/user/actions/index.tsx b/shared/profile/user/actions/index.tsx index 5695e6e9051c..ff79f621c55e 100644 --- a/shared/profile/user/actions/index.tsx +++ b/shared/profile/user/actions/index.tsx @@ -4,11 +4,11 @@ import * as Kb from '@/common-adapters' import * as React from 'react' import FollowButton from './follow-button' import ChatButton from '@/chat/chat-button' -import {useBotsState} from '@/constants/bots' -import {useTrackerState} from '@/constants/tracker2' -import * as FS from '@/constants/fs' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' +import {useBotsState} from '@/stores/bots' +import {useTrackerState} from '@/stores/tracker2' +import * as FS from '@/stores/fs' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {username: string} diff --git a/shared/profile/user/friend.tsx b/shared/profile/user/friend.tsx index ef0815a24d86..462965aaa940 100644 --- a/shared/profile/user/friend.tsx +++ b/shared/profile/user/friend.tsx @@ -1,6 +1,6 @@ -import {useProfileState} from '@/constants/profile' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' -import {useUsersState} from '@/constants/users' +import {useUsersState} from '@/stores/users' type OwnProps = { username: string diff --git a/shared/profile/user/hooks.tsx b/shared/profile/user/hooks.tsx index 0a2a49b3017e..b3848ac98bbd 100644 --- a/shared/profile/user/hooks.tsx +++ b/shared/profile/user/hooks.tsx @@ -2,10 +2,10 @@ import * as C from '@/constants' import type * as T from '@/constants/types' import {type BackgroundColorType} from '.' import {useColorScheme} from 'react-native' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' const headerBackgroundColorType = ( state: T.Tracker.DetailsState, diff --git a/shared/profile/user/teams/index.tsx b/shared/profile/user/teams/index.tsx index 7cbc8c427ee2..f78cfca43e24 100644 --- a/shared/profile/user/teams/index.tsx +++ b/shared/profile/user/teams/index.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import * as React from 'react' import OpenMeta from './openmeta' import {default as TeamInfo, type Props as TIProps} from './teaminfo' -import {useTrackerState} from '@/constants/tracker2' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = {username: string} diff --git a/shared/provision/code-page/container.tsx b/shared/provision/code-page/container.tsx index bc731a76d534..a33c2113e0da 100644 --- a/shared/provision/code-page/container.tsx +++ b/shared/provision/code-page/container.tsx @@ -1,13 +1,13 @@ import * as C from '@/constants' -import * as Devices from '@/constants/devices' +import * as Devices from '@/stores/devices' import * as React from 'react' import * as Kb from '@/common-adapters' import QRImage from './qr-image' import QRScan from './qr-scan' import Troubleshooting from '../troubleshooting' import type * as T from '@/constants/types' -import {useCurrentUserState} from '@/constants/current-user' -import {type Device, useProvisionState} from '@/constants/provision' +import {useCurrentUserState} from '@/stores/current-user' +import {type Device, useProvisionState} from '@/stores/provision' const CodePageContainer = () => { const {deviceID, storeDeviceName} = useCurrentUserState( diff --git a/shared/provision/code-page/qr-scan/hooks.tsx b/shared/provision/code-page/qr-scan/hooks.tsx index bf1687854d0b..c6515c36c5d4 100644 --- a/shared/provision/code-page/qr-scan/hooks.tsx +++ b/shared/provision/code-page/qr-scan/hooks.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import {useProvisionState} from '@/constants/provision' +import {useProvisionState} from '@/stores/provision' const useQR = () => { const submitTextCode = useProvisionState(s => s.dispatch.dynamic.submitTextCode) diff --git a/shared/provision/code-page/qr-scan/not-authorized.tsx b/shared/provision/code-page/qr-scan/not-authorized.tsx index ee5774db4a22..35f641e2827a 100644 --- a/shared/provision/code-page/qr-scan/not-authorized.tsx +++ b/shared/provision/code-page/qr-scan/not-authorized.tsx @@ -1,5 +1,5 @@ import * as Kb from '@/common-adapters' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const QRScanNotAuthorized = () => { const onOpenSettings = useConfigState(s => s.dispatch.dynamic.openAppSettings) diff --git a/shared/provision/error.tsx b/shared/provision/error.tsx index 93125fdfb30b..a5cafc24ae99 100644 --- a/shared/provision/error.tsx +++ b/shared/provision/error.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' +import * as AutoReset from '@/stores/autoreset' import * as Kb from '@/common-adapters' import type * as React from 'react' import LoginContainer from '../login/forms/container' import openURL from '@/util/open-url' import * as T from '@/constants/types' -import {useProvisionState} from '@/constants/provision' +import {useProvisionState} from '@/stores/provision' const Wrapper = (p: {onBack: () => void; children: React.ReactNode}) => ( diff --git a/shared/provision/forgot-username.tsx b/shared/provision/forgot-username.tsx index 9b01068677b6..ad746c8e7579 100644 --- a/shared/provision/forgot-username.tsx +++ b/shared/provision/forgot-username.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import {SignupScreen, errorBanner} from '../signup/common' -import {useSettingsPhoneState} from '@/constants/settings-phone' -import {useProvisionState} from '@/constants/provision' +import {useSettingsPhoneState} from '@/stores/settings-phone' +import {useProvisionState} from '@/stores/provision' const ForgotUsername = () => { const defaultCountry = useSettingsPhoneState(s => s.defaultCountry) diff --git a/shared/provision/paper-key.tsx b/shared/provision/paper-key.tsx index 8fb1972d6f6a..0ae84be9dc0d 100644 --- a/shared/provision/paper-key.tsx +++ b/shared/provision/paper-key.tsx @@ -2,7 +2,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as React from 'react' import {SignupScreen, errorBanner} from '../signup/common' -import {useProvisionState} from '@/constants/provision' +import {useProvisionState} from '@/stores/provision' const Container = () => { const error = useProvisionState(s => s.error) diff --git a/shared/provision/password.tsx b/shared/provision/password.tsx index 3d1f2adddff5..3bef094b69fc 100644 --- a/shared/provision/password.tsx +++ b/shared/provision/password.tsx @@ -3,8 +3,8 @@ import * as Kb from '@/common-adapters' import * as React from 'react' import UserCard from '../login/user-card' import {SignupScreen, errorBanner} from '../signup/common' -import {useState as useRecoverState} from '@/constants/recover-password' -import {useProvisionState} from '@/constants/provision' +import {useState as useRecoverState} from '@/stores/recover-password' +import {useProvisionState} from '@/stores/provision' const Password = () => { const error = useProvisionState(s => s.error) diff --git a/shared/provision/select-other-device-connected.tsx b/shared/provision/select-other-device-connected.tsx index 6f1baa6a45cc..69499e1c7547 100644 --- a/shared/provision/select-other-device-connected.tsx +++ b/shared/provision/select-other-device-connected.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' +import * as AutoReset from '@/stores/autoreset' import * as React from 'react' import {useSafeSubmit} from '@/util/safe-submit' import SelectOtherDevice from './select-other-device' -import {useProvisionState} from '@/constants/provision' +import {useProvisionState} from '@/stores/provision' const SelectOtherDeviceContainer = () => { const devices = useProvisionState(s => s.devices) diff --git a/shared/provision/select-other-device.tsx b/shared/provision/select-other-device.tsx index b39e8c25308e..3ac49ebaba69 100644 --- a/shared/provision/select-other-device.tsx +++ b/shared/provision/select-other-device.tsx @@ -2,7 +2,7 @@ import * as Kb from '@/common-adapters' import * as React from 'react' import DeviceIcon from '../devices/device-icon' import {SignupScreen} from '../signup/common' -import {type Device} from '@/constants/provision' +import {type Device} from '@/stores/provision' type Props = { passwordRecovery?: boolean diff --git a/shared/provision/set-public-name.tsx b/shared/provision/set-public-name.tsx index d25bc7c81f22..3b5d7ba52058 100644 --- a/shared/provision/set-public-name.tsx +++ b/shared/provision/set-public-name.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' -import * as Devices from '@/constants/devices' +import * as Devices from '@/stores/devices' import {useSafeSubmit} from '@/util/safe-submit' import * as Kb from '@/common-adapters' import * as React from 'react' import debounce from 'lodash/debounce' import {SignupScreen, errorBanner} from '../signup/common' -import * as Provision from '@/constants/provision' +import * as Provision from '@/stores/provision' const SetPublicName = () => { const devices = Provision.useProvisionState(s => s.devices) diff --git a/shared/provision/troubleshooting.tsx b/shared/provision/troubleshooting.tsx index 0f00a0cc0e8b..e7aa4f2318c7 100644 --- a/shared/provision/troubleshooting.tsx +++ b/shared/provision/troubleshooting.tsx @@ -1,9 +1,9 @@ import * as React from 'react' import * as C from '@/constants' -import * as Devices from '@/constants/devices' +import * as Devices from '@/stores/devices' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' -import {useProvisionState} from '@/constants/provision' +import {useProvisionState} from '@/stores/provision' type Props = { mode: 'QR' | 'text' onCancel: () => void diff --git a/shared/provision/username-or-email.tsx b/shared/provision/username-or-email.tsx index abf8e1800685..fd06d797850d 100644 --- a/shared/provision/username-or-email.tsx +++ b/shared/provision/username-or-email.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as AutoReset from '@/constants/autoreset' -import {useSignupState} from '@/constants/signup' +import * as AutoReset from '@/stores/autoreset' +import {useSignupState} from '@/stores/signup' import {useSafeSubmit} from '@/util/safe-submit' import * as T from '@/constants/types' import * as React from 'react' @@ -8,7 +8,7 @@ import type {RPCError} from '@/util/errors' import * as Kb from '@/common-adapters' import UserCard from '@/login/user-card' import {SignupScreen, errorBanner} from '@/signup/common' -import {useProvisionState} from '@/constants/provision' +import {useProvisionState} from '@/stores/provision' type OwnProps = {fromReset?: boolean; username?: string} diff --git a/shared/router-v2/account-switcher/index.tsx b/shared/router-v2/account-switcher/index.tsx index 7ed7d926f309..fa570869a785 100644 --- a/shared/router-v2/account-switcher/index.tsx +++ b/shared/router-v2/account-switcher/index.tsx @@ -1,15 +1,15 @@ import * as C from '@/constants' import './account-switcher.css' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as Kb from '@/common-adapters' import * as React from 'react' import type * as T from '@/constants/types' import {settingsLogOutTab} from '@/constants/settings/util' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' -import {useUsersState} from '@/constants/users' -import {useCurrentUserState} from '@/constants/current-user' -import {useProvisionState} from '@/constants/provision' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' +import {useUsersState} from '@/stores/users' +import {useCurrentUserState} from '@/stores/current-user' +import {useProvisionState} from '@/stores/provision' const prepareAccountRows = ( accountRows: ReadonlyArray, diff --git a/shared/router-v2/common.native.tsx b/shared/router-v2/common.native.tsx index af2f2056c052..8037a3caaedc 100644 --- a/shared/router-v2/common.native.tsx +++ b/shared/router-v2/common.native.tsx @@ -3,7 +3,7 @@ import * as Kb from '@/common-adapters' import {TabActions, type NavigationContainerRef} from '@react-navigation/core' import type {HeaderOptions} from '@react-navigation/elements' import {HeaderLeftArrowCanGoBack} from '@/common-adapters/header-hoc' -import type {NavState} from '@/constants/router2' +import type {NavState} from '@/stores/router2' export const headerDefaultStyle = { get backgroundColor() { diff --git a/shared/router-v2/header/index.desktop.tsx b/shared/router-v2/header/index.desktop.tsx index 2a46eb9be1c3..892c4fbde2a4 100644 --- a/shared/router-v2/header/index.desktop.tsx +++ b/shared/router-v2/header/index.desktop.tsx @@ -6,7 +6,7 @@ import {IconWithPopupDesktop as WhatsNewIconWithPopup} from '@/whats-new/icon' import * as ReactIs from 'react-is' import KB2 from '@/util/electron.desktop' import shallowEqual from 'shallowequal' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const {closeWindow, minimizeWindow, toggleMaximizeWindow} = KB2.functions diff --git a/shared/router-v2/header/syncing-folders.tsx b/shared/router-v2/header/syncing-folders.tsx index 578aa416f544..722a91e2bb98 100644 --- a/shared/router-v2/header/syncing-folders.tsx +++ b/shared/router-v2/header/syncing-folders.tsx @@ -1,9 +1,9 @@ import * as C from '@/constants' -import * as Constants from '@/constants/fs' +import * as Constants from '@/stores/fs' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import PieSlice from '@/fs/common/pie-slice' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' type OwnProps = { negative?: boolean diff --git a/shared/router-v2/hooks.native.tsx b/shared/router-v2/hooks.native.tsx index bce95fef44e4..ade3784a1414 100644 --- a/shared/router-v2/hooks.native.tsx +++ b/shared/router-v2/hooks.native.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useConfigState} from '@/constants/config' +import * as Chat from '@/stores/chat2' +import {useConfigState} from '@/stores/config' import * as Tabs from '@/constants/tabs' import * as React from 'react' import {handleAppLink} from '@/constants/deeplinks' diff --git a/shared/router-v2/router.desktop.tsx b/shared/router-v2/router.desktop.tsx index 3173b32abf55..51816647e878 100644 --- a/shared/router-v2/router.desktop.tsx +++ b/shared/router-v2/router.desktop.tsx @@ -1,6 +1,6 @@ import * as Common from './common.desktop' import * as C from '@/constants' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as Kb from '@/common-adapters' import * as React from 'react' import * as Shared from './router.shared' @@ -15,8 +15,8 @@ import {createNativeStackNavigator} from '@react-navigation/native-stack' import {modalRoutes, routes, loggedOutRoutes, tabRoots} from './routes' import {registerDebugClear} from '@/util/debug' import type {RootParamList} from '@/router-v2/route-params' -import {useCurrentUserState} from '@/constants/current-user' -import {useDaemonState} from '@/constants/daemon' +import {useCurrentUserState} from '@/stores/current-user' +import {useDaemonState} from '@/stores/daemon' import type {NativeStackNavigationOptions} from '@react-navigation/native-stack' import './router.css' diff --git a/shared/router-v2/router.native.tsx b/shared/router-v2/router.native.tsx index f807285c2920..b6b3cf21b97c 100644 --- a/shared/router-v2/router.native.tsx +++ b/shared/router-v2/router.native.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Constants from '@/constants/router2' -import {useConfigState} from '@/constants/config' -import {useDarkModeState} from '@/constants/darkmode' +import * as Constants from '@/stores/router2' +import {useConfigState} from '@/stores/config' +import {useDarkModeState} from '@/stores/darkmode' import * as Kb from '@/common-adapters' import * as React from 'react' import * as Shared from './router.shared' @@ -20,7 +20,7 @@ import * as Hooks from './hooks.native' import * as TabBar from './tab-bar.native' import type {RootParamList} from '@/router-v2/route-params' import {useColorScheme} from 'react-native' -import {useDaemonState} from '@/constants/daemon' +import {useDaemonState} from '@/stores/daemon' if (module.hot) { module.hot.accept('', () => {}) diff --git a/shared/router-v2/router.shared.tsx b/shared/router-v2/router.shared.tsx index 7a88668f6157..e0bb7847af68 100644 --- a/shared/router-v2/router.shared.tsx +++ b/shared/router-v2/router.shared.tsx @@ -4,8 +4,8 @@ import * as React from 'react' import {Splash} from '../login/loading' import type {Theme} from '@react-navigation/native' import {colors, darkColors, themed} from '@/styles/colors' -import {useFSState} from '@/constants/fs' -import {useDarkModeState} from '@/constants/darkmode' +import {useFSState} from '@/stores/fs' +import {useDarkModeState} from '@/stores/darkmode' export const SimpleLoading = React.memo(function SimpleLoading() { return ( diff --git a/shared/router-v2/tab-bar.desktop.tsx b/shared/router-v2/tab-bar.desktop.tsx index 843f25c36ead..a9cceadc90c8 100644 --- a/shared/router-v2/tab-bar.desktop.tsx +++ b/shared/router-v2/tab-bar.desktop.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as Kbfs from '@/fs/common' import * as Platforms from '@/constants/platform' import * as T from '@/constants/types' @@ -14,12 +14,12 @@ import {isLinux} from '@/constants/platform' import KB2 from '@/util/electron.desktop' import './tab-bar.css' import {settingsLogOutTab} from '@/constants/settings/util' -import {useTrackerState} from '@/constants/tracker2' -import {useFSState} from '@/constants/fs' -import {useProfileState} from '@/constants/profile' -import {useNotifState} from '@/constants/notifications' -import {useCurrentUserState} from '@/constants/current-user' -import {useProvisionState} from '@/constants/provision' +import {useTrackerState} from '@/stores/tracker2' +import {useFSState} from '@/stores/fs' +import {useProfileState} from '@/stores/profile' +import {useNotifState} from '@/stores/notifications' +import {useCurrentUserState} from '@/stores/current-user' +import {useProvisionState} from '@/stores/provision' const {hideWindow, ctlQuit} = KB2.functions diff --git a/shared/router-v2/tab-bar.native.tsx b/shared/router-v2/tab-bar.native.tsx index 71bb34a5ff8f..3a136f6a74fd 100644 --- a/shared/router-v2/tab-bar.native.tsx +++ b/shared/router-v2/tab-bar.native.tsx @@ -7,7 +7,7 @@ import {View} from 'react-native' import {useSafeAreaFrame} from 'react-native-safe-area-context' import {useColorScheme} from 'react-native' import {usePushState} from '@/constants/push' -import {useNotifState} from '@/constants/notifications' +import {useNotifState} from '@/stores/notifications' const settingsTabChildren = [Tabs.gitTab, Tabs.devicesTab, Tabs.settingsTab] as const const tabs = C.isTablet ? Tabs.tabletTabs : Tabs.phoneTabs diff --git a/shared/settings/account/add-modals.tsx b/shared/settings/account/add-modals.tsx index f5736b62172a..5d203251e85d 100644 --- a/shared/settings/account/add-modals.tsx +++ b/shared/settings/account/add-modals.tsx @@ -6,8 +6,8 @@ import {EnterEmailBody} from '@/signup/email' import {EnterPhoneNumberBody} from '@/signup/phone-number' import VerifyBody from '@/signup/phone-number/verify-body' import {e164ToDisplay} from '@/util/phone-numbers' -import {useSettingsPhoneState} from '@/constants/settings-phone' -import {useSettingsEmailState} from '@/constants/settings-email' +import {useSettingsPhoneState} from '@/stores/settings-phone' +import {useSettingsEmailState} from '@/stores/settings-email' export const Email = () => { const nav = useSafeNavigation() diff --git a/shared/settings/account/confirm-delete.tsx b/shared/settings/account/confirm-delete.tsx index cec9eaa58255..1b4fa2d6f9aa 100644 --- a/shared/settings/account/confirm-delete.tsx +++ b/shared/settings/account/confirm-delete.tsx @@ -2,8 +2,8 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as PhoneUtil from '@/util/phone-numbers' import {useSafeNavigation} from '@/util/safe-navigation' -import {useSettingsPhoneState} from '@/constants/settings-phone' -import {useSettingsEmailState} from '@/constants/settings-email' +import {useSettingsPhoneState} from '@/stores/settings-phone' +import {useSettingsEmailState} from '@/stores/settings-email' type OwnProps = { address: string diff --git a/shared/settings/account/email-phone-row.tsx b/shared/settings/account/email-phone-row.tsx index b3b7f6e32a3d..1eec1a6336e7 100644 --- a/shared/settings/account/email-phone-row.tsx +++ b/shared/settings/account/email-phone-row.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import {useSettingsPhoneState} from '@/constants/settings-phone' -import {useSettingsEmailState} from '@/constants/settings-email' +import {useSettingsPhoneState} from '@/stores/settings-phone' +import {useSettingsEmailState} from '@/stores/settings-email' const addSpacer = (into: string, add: string) => { return into + (into.length ? ' • ' : '') + add diff --git a/shared/settings/account/index.tsx b/shared/settings/account/index.tsx index 1cc8a39c9352..c45c1d9725b0 100644 --- a/shared/settings/account/index.tsx +++ b/shared/settings/account/index.tsx @@ -2,10 +2,10 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import type * as React from 'react' import EmailPhoneRow from './email-phone-row' -import {usePWState} from '@/constants/settings-password' -import {useSettingsPhoneState} from '@/constants/settings-phone' -import {useSettingsEmailState} from '@/constants/settings-email' -import {useSettingsState, settingsPasswordTab} from '@/constants/settings' +import {usePWState} from '@/stores/settings-password' +import {useSettingsPhoneState} from '@/stores/settings-phone' +import {useSettingsEmailState} from '@/stores/settings-email' +import {useSettingsState, settingsPasswordTab} from '@/stores/settings' export const SettingsSection = ({children}: {children: React.ReactNode}) => ( diff --git a/shared/settings/advanced.tsx b/shared/settings/advanced.tsx index 06bec08d7338..1f57db34d60b 100644 --- a/shared/settings/advanced.tsx +++ b/shared/settings/advanced.tsx @@ -3,10 +3,10 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import * as React from 'react' import {ProxySettings} from './proxy' -import {useSettingsState, traceInProgressKey, processorProfileInProgressKey} from '@/constants/settings' -import {usePWState} from '@/constants/settings-password' -import {useFSState} from '@/constants/fs' -import {useConfigState} from '@/constants/config' +import {useSettingsState, traceInProgressKey, processorProfileInProgressKey} from '@/stores/settings' +import {usePWState} from '@/stores/settings-password' +import {useFSState} from '@/stores/fs' +import {useConfigState} from '@/stores/config' let initialUseNativeFrame: boolean | undefined diff --git a/shared/settings/archive/index.tsx b/shared/settings/archive/index.tsx index 3ec5cf413eee..b69fa85c4fbf 100644 --- a/shared/settings/archive/index.tsx +++ b/shared/settings/archive/index.tsx @@ -3,9 +3,9 @@ import * as C from '@/constants' import * as T from '@/constants/types' import * as Kb from '@/common-adapters' import {formatTimeForConversationList, formatTimeForChat} from '@/util/timestamp' -import {useArchiveState} from '@/constants/archive' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import {useArchiveState} from '@/stores/archive' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' const ChatJob = React.memo(function ChatJob(p: {index: number; id: string}) { const {id, index} = p diff --git a/shared/settings/archive/modal.tsx b/shared/settings/archive/modal.tsx index d74739fcb969..fad4d4c0141b 100644 --- a/shared/settings/archive/modal.tsx +++ b/shared/settings/archive/modal.tsx @@ -4,9 +4,9 @@ import * as C from '@/constants' import type * as T from '@/constants/types' import {pickSave} from '@/util/pick-files' import * as FsCommon from '@/fs/common' -import {useArchiveState} from '@/constants/archive' -import {settingsArchiveTab} from '@/constants/settings' -import {useCurrentUserState} from '@/constants/current-user' +import {useArchiveState} from '@/stores/archive' +import {settingsArchiveTab} from '@/stores/settings' +import {useCurrentUserState} from '@/stores/current-user' import {getConvoState} from '@/constants/chat2/convostate' type Props = diff --git a/shared/settings/chat.tsx b/shared/settings/chat.tsx index 5a0fc327fbe0..1759ee2dbaa1 100644 --- a/shared/settings/chat.tsx +++ b/shared/settings/chat.tsx @@ -1,13 +1,13 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as T from '@/constants/types' import * as React from 'react' import Group from './group' -import {useSettingsChatState as useSettingsChatState} from '@/constants/settings-chat' -import {useSettingsNotifState} from '@/constants/settings-notifications' -import {useSettingsState} from '@/constants/settings' -import {useConfigState} from '@/constants/config' +import {useSettingsChatState as useSettingsChatState} from '@/stores/settings-chat' +import {useSettingsNotifState} from '@/stores/settings-notifications' +import {useSettingsState} from '@/stores/settings' +import {useConfigState} from '@/stores/config' const emptyList = new Array() diff --git a/shared/settings/contacts-joined.tsx b/shared/settings/contacts-joined.tsx index 0650fa5d2e47..994dcd5a5a85 100644 --- a/shared/settings/contacts-joined.tsx +++ b/shared/settings/contacts-joined.tsx @@ -4,9 +4,9 @@ import type * as T from '@/constants/types' import {useSafeNavigation} from '@/util/safe-navigation' import * as React from 'react' import UnconnectedFollowButton from '@/profile/user/actions/follow-button' -import {useSettingsContactsState} from '@/constants/settings-contacts' -import {useTrackerState} from '@/constants/tracker2' -import {useFollowerState} from '@/constants/followers' +import {useSettingsContactsState} from '@/stores/settings-contacts' +import {useTrackerState} from '@/stores/tracker2' +import {useFollowerState} from '@/stores/followers' const renderItem = (_: number, item: T.RPCGen.ProcessedContact) => diff --git a/shared/settings/db-nuke.confirm.tsx b/shared/settings/db-nuke.confirm.tsx index 5c4b71083a5d..d286b5367ddd 100644 --- a/shared/settings/db-nuke.confirm.tsx +++ b/shared/settings/db-nuke.confirm.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import {useSettingsState} from '@/constants/settings' +import {useSettingsState} from '@/stores/settings' const DbNukeConfirm = () => { const navigateUp = C.useRouterState(s => s.dispatch.navigateUp) diff --git a/shared/settings/delete-confirm/check-passphrase.native.tsx b/shared/settings/delete-confirm/check-passphrase.native.tsx index a861c09207b8..00010f8bf4db 100644 --- a/shared/settings/delete-confirm/check-passphrase.native.tsx +++ b/shared/settings/delete-confirm/check-passphrase.native.tsx @@ -2,7 +2,7 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' -import {useSettingsState} from '@/constants/settings' +import {useSettingsState} from '@/stores/settings' const CheckPassphraseMobile = () => { const [password, setPassword] = React.useState('') diff --git a/shared/settings/delete-confirm/index.tsx b/shared/settings/delete-confirm/index.tsx index 1a4a243a2ca5..e946c68aa858 100644 --- a/shared/settings/delete-confirm/index.tsx +++ b/shared/settings/delete-confirm/index.tsx @@ -2,9 +2,9 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' -import {usePWState} from '@/constants/settings-password' -import {useSettingsState} from '@/constants/settings' -import {useCurrentUserState} from '@/constants/current-user' +import {usePWState} from '@/stores/settings-password' +import {useSettingsState} from '@/stores/settings' +import {useCurrentUserState} from '@/stores/current-user' type CheckboxesProps = { checkData: boolean diff --git a/shared/settings/disable-cert-pinning-modal.tsx b/shared/settings/disable-cert-pinning-modal.tsx index b84956f0114d..8fe63caf18c2 100644 --- a/shared/settings/disable-cert-pinning-modal.tsx +++ b/shared/settings/disable-cert-pinning-modal.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import {useSettingsState} from '@/constants/settings' +import {useSettingsState} from '@/stores/settings' const DisableCertPinningModal = () => { const navigateUp = C.useRouterState(s => s.dispatch.navigateUp) diff --git a/shared/settings/display.tsx b/shared/settings/display.tsx index b95ba9a6e786..f7ab52aafed4 100644 --- a/shared/settings/display.tsx +++ b/shared/settings/display.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import logger from '@/logger' -import {useConfigState} from '@/constants/config' -import * as DarkMode from '@/constants/darkmode' +import {useConfigState} from '@/stores/config' +import * as DarkMode from '@/stores/darkmode' const Display = () => { const allowAnimatedEmojis = useConfigState(s => s.allowAnimatedEmojis) diff --git a/shared/settings/feedback/container.desktop.tsx b/shared/settings/feedback/container.desktop.tsx index 83933ea0ad0d..5ebef2dcdd73 100644 --- a/shared/settings/feedback/container.desktop.tsx +++ b/shared/settings/feedback/container.desktop.tsx @@ -2,7 +2,7 @@ import * as C from '@/constants' import Feedback from '.' import type {Props} from './container' import {useSendFeedback} from './shared' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const Container = (ownProps: Props) => { const {sendFeedback, error} = useSendFeedback() diff --git a/shared/settings/feedback/container.native.tsx b/shared/settings/feedback/container.native.tsx index b88db320114e..45a5ca45867c 100644 --- a/shared/settings/feedback/container.native.tsx +++ b/shared/settings/feedback/container.native.tsx @@ -1,5 +1,5 @@ -import {useConfigState} from '@/constants/config' -import {useCurrentUserState} from '@/constants/current-user' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' import * as Kb from '@/common-adapters' import * as React from 'react' import Feedback from '.' diff --git a/shared/settings/files/hooks.tsx b/shared/settings/files/hooks.tsx index 7cd0b2d730c2..e8e29a846900 100644 --- a/shared/settings/files/hooks.tsx +++ b/shared/settings/files/hooks.tsx @@ -1,6 +1,6 @@ import {defaultNotificationThreshold} from '.' import * as C from '@/constants' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const useFiles = () => { const {areSettingsLoading, setSpaceAvailableNotificationThreshold, spaceAvailableNotificationThreshold} = diff --git a/shared/settings/files/index.desktop.tsx b/shared/settings/files/index.desktop.tsx index c8abd4d17097..02c9475c612e 100644 --- a/shared/settings/files/index.desktop.tsx +++ b/shared/settings/files/index.desktop.tsx @@ -6,8 +6,8 @@ import * as Kbfs from '@/fs/common' import RefreshDriverStatusOnMount from '@/fs/common/refresh-driver-status-on-mount' import RefreshSettings from './refresh-settings' import useFiles from './hooks' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' type Props = ReturnType export const allowedNotificationThresholds = [100 * 1024 ** 2, 1024 ** 3, 3 * 1024 ** 3, 10 * 1024 ** 3] diff --git a/shared/settings/files/index.native.tsx b/shared/settings/files/index.native.tsx index 66ecd2edf2f0..bbec8c0123d0 100644 --- a/shared/settings/files/index.native.tsx +++ b/shared/settings/files/index.native.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import useFiles from './hooks' -import * as FS from '@/constants/fs' -import {useFSState} from '@/constants/fs' +import * as FS from '@/stores/fs' +import {useFSState} from '@/stores/fs' type Props = ReturnType export const allowedNotificationThresholds = [100 * 1024 ** 2, 1024 ** 3, 3 * 1024 ** 3, 10 * 1024 ** 3] diff --git a/shared/settings/files/refresh-settings.tsx b/shared/settings/files/refresh-settings.tsx index aa4da1e72b56..383484e7b579 100644 --- a/shared/settings/files/refresh-settings.tsx +++ b/shared/settings/files/refresh-settings.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {useFSState} from '@/constants/fs' +import {useFSState} from '@/stores/fs' const RefreshSettings = () => { const refresh = useFSState(s => s.dispatch.loadSettings) diff --git a/shared/settings/group.tsx b/shared/settings/group.tsx index 839ad9fa16b1..fefd140db264 100644 --- a/shared/settings/group.tsx +++ b/shared/settings/group.tsx @@ -1,5 +1,5 @@ import * as Kb from '@/common-adapters' -import type {NotificationsSettingsState} from '@/constants/settings-notifications' +import type {NotificationsSettingsState} from '@/stores/settings-notifications' type GroupProps = { allowEdit: boolean diff --git a/shared/settings/invites/index.desktop.tsx b/shared/settings/invites/index.desktop.tsx index 0636b633ea3b..c9dd76394d51 100644 --- a/shared/settings/invites/index.desktop.tsx +++ b/shared/settings/invites/index.desktop.tsx @@ -1,11 +1,11 @@ import * as Kb from '@/common-adapters' -import type {AcceptedInvite, PendingInvite} from '@/constants/settings-invites' +import type {AcceptedInvite, PendingInvite} from '@/stores/settings-invites' import * as React from 'react' import SubHeading from '../subheading' import * as dateFns from 'date-fns' import * as C from '@/constants' -import {useProfileState} from '@/constants/profile' -import {useState as useSettingsInvitesState} from '@/constants/settings-invites' +import {useProfileState} from '@/stores/profile' +import {useState as useSettingsInvitesState} from '@/stores/settings-invites' // Like intersperse but takes a function to define the separator function intersperseFn( diff --git a/shared/settings/logout.tsx b/shared/settings/logout.tsx index b5d765d9287c..c61c62e3656e 100644 --- a/shared/settings/logout.tsx +++ b/shared/settings/logout.tsx @@ -3,9 +3,9 @@ import {useSafeSubmit} from '@/util/safe-submit' import * as C from '@/constants' import * as Kb from '@/common-adapters' import {UpdatePassword} from './password' -import {usePWState} from '@/constants/settings-password' -import {useSettingsState} from '@/constants/settings' -import {useLogoutState} from '@/constants/logout' +import {usePWState} from '@/stores/settings-password' +import {useSettingsState} from '@/stores/settings' +import {useLogoutState} from '@/stores/logout' const LogoutContainer = () => { const {checkPassword, checkPasswordIsCorrect, resetCheckPassword} = useSettingsState( diff --git a/shared/settings/manage-contacts.tsx b/shared/settings/manage-contacts.tsx index fa5f9f6a3764..aca33a0abc2f 100644 --- a/shared/settings/manage-contacts.tsx +++ b/shared/settings/manage-contacts.tsx @@ -2,9 +2,9 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import {SettingsSection} from './account' -import {useSettingsContactsState} from '@/constants/settings-contacts' -import {settingsFeedbackTab} from '@/constants/settings' -import {useConfigState} from '@/constants/config' +import {useSettingsContactsState} from '@/stores/settings-contacts' +import {settingsFeedbackTab} from '@/stores/settings' +import {useConfigState} from '@/stores/config' const enabledDescription = 'Your phone contacts are being synced on this device.' const disabledDescription = 'Import your phone contacts and start encrypted chats with your friends.' diff --git a/shared/settings/notifications/hooks.tsx b/shared/settings/notifications/hooks.tsx index 210c1149d735..a3c0aecc59fd 100644 --- a/shared/settings/notifications/hooks.tsx +++ b/shared/settings/notifications/hooks.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import {useSettingsEmailState} from '@/constants/settings-email' -import {useSettingsNotifState} from '@/constants/settings-notifications' -import {useSettingsState, settingsAccountTab} from '@/constants/settings' +import {useSettingsEmailState} from '@/stores/settings-email' +import {useSettingsNotifState} from '@/stores/settings-notifications' +import {useSettingsState, settingsAccountTab} from '@/stores/settings' const useNotifications = () => { const _groups = useSettingsNotifState(s => s.groups) diff --git a/shared/settings/notifications/index.desktop.tsx b/shared/settings/notifications/index.desktop.tsx index 003323b3e450..2b245d4fd6d7 100644 --- a/shared/settings/notifications/index.desktop.tsx +++ b/shared/settings/notifications/index.desktop.tsx @@ -1,8 +1,8 @@ import {Reloadable} from '@/common-adapters' import * as C from '@/constants' import Render from './render' -import {useSettingsNotifState} from '@/constants/settings-notifications' -import {useSettingsState} from '@/constants/settings' +import {useSettingsNotifState} from '@/stores/settings-notifications' +import {useSettingsState} from '@/stores/settings' const Notifications = () => { const loadSettings = useSettingsState(s => s.dispatch.loadSettings) diff --git a/shared/settings/notifications/index.native.tsx b/shared/settings/notifications/index.native.tsx index 50eb9263f81a..b4e429461668 100644 --- a/shared/settings/notifications/index.native.tsx +++ b/shared/settings/notifications/index.native.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import Notifications from './render' import {Reloadable} from '@/common-adapters' -import {useSettingsNotifState} from '@/constants/settings-notifications' -import {useSettingsState} from '@/constants/settings' +import {useSettingsNotifState} from '@/stores/settings-notifications' +import {useSettingsState} from '@/stores/settings' import {usePushState} from '@/constants/push' const MobileNotifications = () => { diff --git a/shared/settings/password.tsx b/shared/settings/password.tsx index afea9f8392ed..f9c157c2641b 100644 --- a/shared/settings/password.tsx +++ b/shared/settings/password.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import * as C from '@/constants' -import {usePWState} from '@/constants/settings-password' +import {usePWState} from '@/stores/settings-password' type Props = { error: string diff --git a/shared/settings/proxy.tsx b/shared/settings/proxy.tsx index 06975d317b3d..3239af09aba9 100644 --- a/shared/settings/proxy.tsx +++ b/shared/settings/proxy.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import {useSettingsState} from '@/constants/settings' +import {useSettingsState} from '@/stores/settings' const useConnect = () => { const allowTlsMitmToggle = useSettingsState(s => s.didToggleCertificatePinning) diff --git a/shared/settings/root-desktop-tablet.tsx b/shared/settings/root-desktop-tablet.tsx index 7b29c0799c0d..8c76227cdd56 100644 --- a/shared/settings/root-desktop-tablet.tsx +++ b/shared/settings/root-desktop-tablet.tsx @@ -6,7 +6,7 @@ import LeftNav from './sub-nav/left-nav' import {useNavigationBuilder, TabRouter, createNavigatorFactory} from '@react-navigation/core' import type {TypedNavigator, NavigatorTypeBagBase, StaticConfig} from '@react-navigation/native' import {sharedNewRoutes} from './routes' -import {settingsAccountTab} from '@/constants/settings' +import {settingsAccountTab} from '@/stores/settings' const settingsSubRoutes = { ...sharedNewRoutes, diff --git a/shared/settings/root-phone.tsx b/shared/settings/root-phone.tsx index 0ed12c417a3b..379ad5fbc252 100644 --- a/shared/settings/root-phone.tsx +++ b/shared/settings/root-phone.tsx @@ -1,16 +1,16 @@ import * as C from '@/constants' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import {keybaseFM} from '@/constants/whats-new' +import {keybaseFM} from '@/stores/whats-new' import SettingsItem from './sub-nav/settings-item' import WhatsNewIcon from '../whats-new/icon' import noop from 'lodash/noop' -import {useSettingsContactsState} from '@/constants/settings-contacts' -import * as Settings from '@/constants/settings' +import {useSettingsContactsState} from '@/stores/settings-contacts' +import * as Settings from '@/stores/settings' import {usePushState} from '@/constants/push' -import {useNotifState} from '@/constants/notifications' +import {useNotifState} from '@/stores/notifications' const PerfRow = () => { const [toSubmit, setToSubmit] = React.useState('') diff --git a/shared/settings/sub-nav/left-nav.tsx b/shared/settings/sub-nav/left-nav.tsx index 12ecd1a074d8..57ca3a5fbf13 100644 --- a/shared/settings/sub-nav/left-nav.tsx +++ b/shared/settings/sub-nav/left-nav.tsx @@ -3,10 +3,10 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import WhatsNewIcon from '@/whats-new/icon' import SettingsItem from './settings-item' -import {keybaseFM} from '@/constants/whats-new' -import * as Settings from '@/constants/settings' +import {keybaseFM} from '@/stores/whats-new' +import * as Settings from '@/stores/settings' import {usePushState} from '@/constants/push' -import {useNotifState} from '@/constants/notifications' +import {useNotifState} from '@/stores/notifications' type Props = { onClick: (s: string) => void diff --git a/shared/signup/common.tsx b/shared/signup/common.tsx index 60286f6c65e2..19603764cd7e 100644 --- a/shared/signup/common.tsx +++ b/shared/signup/common.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import {type Props as ButtonProps} from '@/common-adapters/button' import openURL from '@/util/open-url' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' type InfoIconProps = { invisible?: boolean diff --git a/shared/signup/device-name.tsx b/shared/signup/device-name.tsx index 8abc7478d70d..d53ddce22c04 100644 --- a/shared/signup/device-name.tsx +++ b/shared/signup/device-name.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as React from 'react' import {SignupScreen, errorBanner} from './common' -import * as Provision from '@/constants/provision' -import {useSignupState} from '@/constants/signup' +import * as Provision from '@/stores/provision' +import {useSignupState} from '@/stores/signup' const ConnectedEnterDevicename = () => { const error = useSignupState(s => s.devicenameError) diff --git a/shared/signup/email.tsx b/shared/signup/email.tsx index 1593cf89c1e0..0f6f33bef3b6 100644 --- a/shared/signup/email.tsx +++ b/shared/signup/email.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import {SignupScreen, errorBanner} from './common' -import {useSettingsEmailState} from '@/constants/settings-email' -import {useSignupState} from '@/constants/signup' +import {useSettingsEmailState} from '@/stores/settings-email' +import {useSignupState} from '@/stores/signup' import {usePushState} from '@/constants/push' const ConnectedEnterEmail = () => { diff --git a/shared/signup/feedback.tsx b/shared/signup/feedback.tsx index 51c2ac8ace23..1bc404e8c6a3 100644 --- a/shared/signup/feedback.tsx +++ b/shared/signup/feedback.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import FeedbackForm from '../settings/feedback/index' import {SignupScreen, errorBanner} from './common' import {useSendFeedback} from '../settings/feedback/shared' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const SignupFeedback = () => { const {error: sendError, sendFeedback: onSendFeedback} = useSendFeedback() diff --git a/shared/signup/phone-number/index.tsx b/shared/signup/phone-number/index.tsx index 9467647febbe..03ef62e70146 100644 --- a/shared/signup/phone-number/index.tsx +++ b/shared/signup/phone-number/index.tsx @@ -2,7 +2,7 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import {SignupScreen, errorBanner} from '../common' -import {useSettingsPhoneState} from '@/constants/settings-phone' +import {useSettingsPhoneState} from '@/stores/settings-phone' type BodyProps = { autoFocus?: boolean diff --git a/shared/signup/phone-number/verify.tsx b/shared/signup/phone-number/verify.tsx index 1e58e3fde7aa..b3368353a527 100644 --- a/shared/signup/phone-number/verify.tsx +++ b/shared/signup/phone-number/verify.tsx @@ -4,7 +4,7 @@ import * as Kb from '@/common-adapters' import {SignupScreen} from '../common' import {e164ToDisplay} from '@/util/phone-numbers' import VerifyBody from './verify-body' -import {useSettingsPhoneState} from '@/constants/settings-phone' +import {useSettingsPhoneState} from '@/stores/settings-phone' const Container = () => { const error = useSettingsPhoneState(s => (s.verificationState === 'error' ? s.error : '')) diff --git a/shared/signup/username.tsx b/shared/signup/username.tsx index b22cfb0705fb..8f6da6fca45d 100644 --- a/shared/signup/username.tsx +++ b/shared/signup/username.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as React from 'react' import {SignupScreen, errorBanner} from './common' -import {useSignupState} from '@/constants/signup' -import {useProvisionState} from '@/constants/provision' +import {useSignupState} from '@/stores/signup' +import {useProvisionState} from '@/stores/provision' const ConnectedEnterUsername = () => { const error = useSignupState(s => s.usernameError) diff --git a/shared/constants/archive/index.tsx b/shared/stores/archive.tsx similarity index 98% rename from shared/constants/archive/index.tsx rename to shared/stores/archive.tsx index dd132f0e3133..450e6b3ec185 100644 --- a/shared/constants/archive/index.tsx +++ b/shared/stores/archive.tsx @@ -1,11 +1,11 @@ -import * as T from '../types' +import * as T from '../constants/types' import * as Z from '@/util/zustand' -import {ignorePromise} from '../utils' +import {ignorePromise} from '../constants/utils' import * as EngineGen from '@/actions/engine-gen-gen' import {pathToRPCPath} from '@/constants/fs/util' import {formatTimeForPopup} from '@/util/timestamp' import {uint8ArrayToHex} from 'uint8array-extras' -import {isMobile} from '../platform' +import {isMobile} from '../constants/platform' type ChatJob = { id: string diff --git a/shared/constants/autoreset/index.tsx b/shared/stores/autoreset.tsx similarity index 92% rename from shared/constants/autoreset/index.tsx rename to shared/stores/autoreset.tsx index f1d7ed2efaa5..af4e33076267 100644 --- a/shared/constants/autoreset/index.tsx +++ b/shared/stores/autoreset.tsx @@ -1,12 +1,12 @@ import * as Z from '@/util/zustand' -import {ignorePromise} from '../utils' -import * as S from '../strings' +import {ignorePromise} from '@/constants/utils' +import * as S from '@/constants/strings' import * as T from '@/constants/types' import * as EngineGen from '@/actions/engine-gen-gen' import logger from '@/logger' import {RPCError} from '@/util/errors' -import {navigateAppend, navUpToScreen} from '../router2/util' -import {storeRegistry} from '../store-registry' +import {navigateAppend, navUpToScreen} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' type Store = T.Immutable<{ active: boolean @@ -62,7 +62,7 @@ export const useAutoResetState = Z.createZustand((set, get) => { switch (error.code) { case T.RPCGen.StatusCode.scnosession: // We got logged out because we were revoked (which might have been - // becase the reset was completed and this device wasn't notified). + // because the reset was completed and this device wasn't notified). return undefined case T.RPCGen.StatusCode.scnotfound: // "User not in autoreset queue." @@ -140,10 +140,7 @@ export const useAutoResetState = Z.createZustand((set, get) => { s.endTime = params.endTime * 1000 }) } - navigateAppend( - {props: {pipelineStarted: !params.needVerify}, selected: 'resetWaiting'}, - true - ) + navigateAppend({props: {pipelineStarted: !params.needVerify}, selected: 'resetWaiting'}, true) }, }, params: { diff --git a/shared/constants/bots/index.tsx b/shared/stores/bots.tsx similarity index 91% rename from shared/constants/bots/index.tsx rename to shared/stores/bots.tsx index beb76b45a4d4..e922a4538206 100644 --- a/shared/constants/bots/index.tsx +++ b/shared/stores/bots.tsx @@ -1,8 +1,8 @@ -import * as T from '../types' +import * as T from '@/constants/types' import * as EngineGen from '@/actions/engine-gen-gen' import * as Z from '@/util/zustand' -import {ignorePromise, RPCError, isNetworkErr} from '../utils' -import * as S from '../strings' +import {ignorePromise, RPCError, isNetworkErr} from '@/constants/utils' +import * as S from '@/constants/strings' import logger from '@/logger' type BotSearchResults = { @@ -183,4 +183,17 @@ export const useBotsState = Z.createZustand((set, get) => { } }) -export {getFeaturedSorted} from './util' +export const getFeaturedSorted = ( + featuredBotsMap: ReadonlyMap +): Array => { + const featured = [...featuredBotsMap.values()] + featured.sort((a: T.RPCGen.FeaturedBot, b: T.RPCGen.FeaturedBot) => { + if (a.rank < b.rank) { + return 1 + } else if (a.rank > b.rank) { + return -1 + } + return 0 + }) + return featured +} diff --git a/shared/constants/chat2/index.tsx b/shared/stores/chat2.tsx similarity index 98% rename from shared/constants/chat2/index.tsx rename to shared/stores/chat2.tsx index 79cc8a00fedf..18936b18c5c4 100644 --- a/shared/constants/chat2/index.tsx +++ b/shared/stores/chat2.tsx @@ -1,27 +1,27 @@ -import * as T from '../types' -import {ignorePromise, timeoutPromise, type ViewPropsToPageProps} from '../utils' -import * as Tabs from '../tabs' +import * as T from '@/constants/types' +import {ignorePromise, timeoutPromise, type ViewPropsToPageProps} from '@/constants/utils' +import * as Tabs from '@/constants/tabs' import * as EngineGen from '@/actions/engine-gen-gen' -import type * as ConfigConstants from '../config' -import * as Message from './message' -import * as Router2 from '../router2' -import * as TeamConstants from '../teams/util' +import type * as ConfigConstants from '@/stores/config' +import * as Message from '@/constants/chat2/message' +import * as Router2 from '@/stores/router2' +import * as TeamConstants from '@/constants/teams/util' import logger from '@/logger' import {RPCError} from '@/util/errors' -import * as Meta from './meta' -import {isMobile, isPhone} from '../platform' +import * as Meta from '@/constants/chat2/meta' +import {isMobile, isPhone} from '@/constants/platform' import * as Z from '@/util/zustand' -import * as Common from './common' -import {clearChatStores, chatStores} from './convostate' +import * as Common from '@/constants/chat2/common' +import {clearChatStores, chatStores} from '@/constants/chat2/convostate' import {uint8ArrayToString} from 'uint8array-extras' import isEqual from 'lodash/isEqual' -import {bodyToJSON} from '../rpc-utils' -import {navigateAppend, navUpToScreen, switchTab} from '../router2/util' -import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' -import {useCurrentUserState} from '../current-user' -import {useWaitingState} from '../waiting' -import * as S from '../strings' +import {bodyToJSON} from '@/constants/rpc-utils' +import {navigateAppend, navUpToScreen, switchTab} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' +import {useWaitingState} from '@/stores/waiting' +import * as S from '@/constants/strings' const defaultTopReacjis = [ {name: ':+1:'}, @@ -1966,7 +1966,7 @@ export const useChatState = Z.createZustand((set, get) => { } }) -import {type ChatProviderProps, ProviderScreen} from './convostate' +import {type ChatProviderProps, ProviderScreen} from '@/constants/chat2/convostate' import type {GetOptionsRet} from '@/constants/types/router2' export function makeChatScreen>( @@ -1992,10 +1992,10 @@ export function makeChatScreen>( } } -export * from './convostate' -export * from './common' -export * from './meta' -export * from './message' +export * from '@/constants/chat2/convostate' +export * from '@/constants/chat2/common' +export * from '@/constants/chat2/meta' +export * from '@/constants/chat2/message' export { noConversationIDKey, @@ -2003,4 +2003,4 @@ export { pendingErrorConversationIDKey, isValidConversationIDKey, dummyConversationIDKey, -} from '../types/chat2/common' +} from '@/constants/types/chat2/common' diff --git a/shared/constants/config/index.tsx b/shared/stores/config.tsx similarity index 98% rename from shared/constants/config/index.tsx rename to shared/stores/config.tsx index 9d52e0338fc9..d1a2498cbe20 100644 --- a/shared/constants/config/index.tsx +++ b/shared/stores/config.tsx @@ -1,18 +1,18 @@ -import * as T from '../types' -import {ignorePromise, timeoutPromise} from '../utils' -import {waitingKeyConfigLogin} from '../strings' +import * as T from '@/constants/types' +import {ignorePromise, timeoutPromise} from '@/constants/utils' +import {waitingKeyConfigLogin} from '@/constants/strings' import * as EngineGen from '@/actions/engine-gen-gen' import * as Stats from '@/engine/stats' import * as Z from '@/util/zustand' -import {noConversationIDKey} from '../types/chat2/common' +import {noConversationIDKey} from '@/constants/types/chat2/common' import isEqual from 'lodash/isEqual' import logger from '@/logger' -import type {Tab} from '../tabs' +import type {Tab} from '@/constants/tabs' import {RPCError, convertToError, isEOFError, isErrorTransient, niceError} from '@/util/errors' -import {defaultUseNativeFrame, isMobile} from '../platform' +import {defaultUseNativeFrame, isMobile} from '@/constants/platform' import {type CommonResponseHandler} from '@/engine/types' -import {invalidPasswordErrorString} from './util' -import {navigateAppend} from '../router2/util' +import {invalidPasswordErrorString} from '@/constants/config/util' +import {navigateAppend} from '@/constants/router2/util' type Store = T.Immutable<{ active: boolean diff --git a/shared/constants/crypto/index.tsx b/shared/stores/crypto.tsx similarity index 98% rename from shared/constants/crypto/index.tsx rename to shared/stores/crypto.tsx index 1d0a1de56944..881fb2f59a11 100644 --- a/shared/constants/crypto/index.tsx +++ b/shared/stores/crypto.tsx @@ -1,15 +1,15 @@ import * as Z from '@/util/zustand' -import {ignorePromise} from '../utils' -import {isMobile} from '../platform' -import {waitingKeyCrypto} from '../strings' +import {ignorePromise} from '@/constants/utils' +import {isMobile} from '@/constants/platform' +import {waitingKeyCrypto} from '@/constants/strings' import HiddenString from '@/util/hidden-string' import logger from '@/logger' -import * as T from '../types' +import * as T from '@/constants/types' import {RPCError} from '@/util/errors' -import {navigateAppend} from '../router2/util' -import {useCurrentUserState} from '../current-user' -import {Operations} from './util' -export * from './util' +import {navigateAppend} from '@/constants/router2/util' +import {useCurrentUserState} from '@/stores/current-user' +import {Operations} from '@/constants/crypto/util' +export * from '@/constants/crypto/util' type CommonStore = { bytesComplete: number diff --git a/shared/constants/current-user/index.tsx b/shared/stores/current-user.tsx similarity index 96% rename from shared/constants/current-user/index.tsx rename to shared/stores/current-user.tsx index 76b8a2caa8be..aaba7e2cc2cd 100644 --- a/shared/constants/current-user/index.tsx +++ b/shared/stores/current-user.tsx @@ -1,4 +1,4 @@ -import type * as T from '../types' +import type * as T from '@/constants/types' import * as Z from '@/util/zustand' // This store has no dependencies on other stores and is safe to import directly from other stores. diff --git a/shared/constants/daemon/index.tsx b/shared/stores/daemon.tsx similarity index 98% rename from shared/constants/daemon/index.tsx rename to shared/stores/daemon.tsx index f87e335f757b..340fcd3949e5 100644 --- a/shared/constants/daemon/index.tsx +++ b/shared/stores/daemon.tsx @@ -1,8 +1,8 @@ import logger from '@/logger' -import {ignorePromise} from '../utils' -import * as T from '../types' +import {ignorePromise} from '@/constants/utils' +import * as T from '@/constants/types' import * as Z from '@/util/zustand' -import {maxHandshakeTries} from '../values' +import {maxHandshakeTries} from '@/constants/values' // Load accounts, this call can be slow so we attempt to continue w/o waiting if we determine we're logged in // normally this wouldn't be worth it but this is startup diff --git a/shared/constants/darkmode/index.tsx b/shared/stores/darkmode.tsx similarity index 97% rename from shared/constants/darkmode/index.tsx rename to shared/stores/darkmode.tsx index fa4d7a445ed1..c616904f1e4e 100644 --- a/shared/constants/darkmode/index.tsx +++ b/shared/stores/darkmode.tsx @@ -1,7 +1,7 @@ -import * as T from '../types' +import * as T from '@/constants/types' import * as Z from '@/util/zustand' import {Appearance} from 'react-native' -import {isMobile} from '../platform' +import {isMobile} from '@/constants/platform' export type DarkModePreference = 'system' | 'alwaysDark' | 'alwaysLight' diff --git a/shared/constants/devices/index.tsx b/shared/stores/devices.tsx similarity index 96% rename from shared/constants/devices/index.tsx rename to shared/stores/devices.tsx index 61608a6b712f..a8404ad69f98 100644 --- a/shared/constants/devices/index.tsx +++ b/shared/stores/devices.tsx @@ -1,8 +1,8 @@ import * as React from 'react' import * as Z from '@/util/zustand' -import * as S from '../strings' -import {ignorePromise, updateImmerMap} from '../utils' -import * as T from '../types' +import * as S from '@/constants/strings' +import {ignorePromise, updateImmerMap} from '@/constants/utils' +import * as T from '@/constants/types' import * as EngineGen from '@/actions/engine-gen-gen' import debounce from 'lodash/debounce' diff --git a/shared/constants/followers/index.tsx b/shared/stores/followers.tsx similarity index 99% rename from shared/constants/followers/index.tsx rename to shared/stores/followers.tsx index f276f03786e9..b403722e07af 100644 --- a/shared/constants/followers/index.tsx +++ b/shared/stores/followers.tsx @@ -1,6 +1,5 @@ import * as T from '@/constants/types' import * as Z from '@/util/zustand' - // This store has no dependencies on other stores and is safe to import directly from other stores. type Store = T.Immutable<{ followers: Set diff --git a/shared/constants/fs/index.tsx b/shared/stores/fs.tsx similarity index 98% rename from shared/constants/fs/index.tsx rename to shared/stores/fs.tsx index f3d94d5b13f5..ace4730a19c4 100644 --- a/shared/constants/fs/index.tsx +++ b/shared/stores/fs.tsx @@ -1,9 +1,9 @@ import * as EngineGen from '@/actions/engine-gen-gen' -import {ignorePromise, timeoutPromise} from '../utils' -import * as S from '../strings' -import {requestPermissionsToWrite} from '../platform-specific' -import * as Tabs from '../tabs' -import * as T from '../types' +import {ignorePromise, timeoutPromise} from '@/constants/utils' +import * as S from '@/constants/strings' +import {requestPermissionsToWrite} from '@/constants/platform-specific' +import * as Tabs from '@/constants/tabs' +import * as T from '@/constants/types' import * as Z from '@/util/zustand' import NotifyPopup from '@/util/notify-popup' import {RPCError} from '@/util/errors' @@ -11,13 +11,13 @@ import logger from '@/logger' import {tlfToPreferredOrder} from '@/util/kbfs' import isObject from 'lodash/isObject' import isEqual from 'lodash/isEqual' -import {navigateAppend, navigateUp} from '../router2/util' -import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' -import {useCurrentUserState} from '../current-user' -import * as Util from './util' +import {navigateAppend, navigateUp} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' +import * as Util from '@/constants/fs/util' -export * from './util' +export * from '@/constants/fs/util' const subscriptionDeduplicateIntervalSecond = 1 @@ -1598,7 +1598,7 @@ export const useFSState = Z.createZustand((set, get) => { }) }, setupSubscriptions: async () => { - const initPlatformSpecific = await import('./platform-specific') + const initPlatformSpecific = await import('../constants/fs/platform-specific') initPlatformSpecific.default() }, showIncomingShare: initialDestinationParentPath => { diff --git a/shared/constants/git/index.tsx b/shared/stores/git.tsx similarity index 96% rename from shared/constants/git/index.tsx rename to shared/stores/git.tsx index 297dc32a67f4..9ea6dbc1d2c6 100644 --- a/shared/constants/git/index.tsx +++ b/shared/stores/git.tsx @@ -1,12 +1,12 @@ -import * as S from '../strings' -import * as T from '../types' -import {ignorePromise} from '../utils' +import * as S from '@/constants/strings' +import * as T from '@/constants/types' +import {ignorePromise} from '@/constants/utils' import * as EngineGen from '@/actions/engine-gen-gen' import * as dateFns from 'date-fns' import * as Z from '@/util/zustand' import debounce from 'lodash/debounce' -import {navigateAppend} from '../router2/util' -import {useConfigState} from '../config' +import {navigateAppend} from '@/constants/router2/util' +import {useConfigState} from '@/stores/config' const parseRepos = (results: ReadonlyArray) => { const errors: Array = [] diff --git a/shared/constants/logout/index.tsx b/shared/stores/logout.tsx similarity index 91% rename from shared/constants/logout/index.tsx rename to shared/stores/logout.tsx index 82a3c99c749f..1f4983b4fa0d 100644 --- a/shared/constants/logout/index.tsx +++ b/shared/stores/logout.tsx @@ -1,12 +1,12 @@ import logger from '@/logger' -import {ignorePromise, timeoutPromise} from '../utils' +import {ignorePromise, timeoutPromise} from '@/constants/utils' import * as T from '@/constants/types' // normally util.container but it re-exports from us so break the cycle import * as Z from '@/util/zustand' -import {settingsPasswordTab} from '../settings' -import {navigateAppend} from '../router2/util' -import {isMobile} from '../platform' -import * as Tabs from '../tabs' +import {settingsPasswordTab} from '@/constants/settings/util' +import {navigateAppend} from '@/constants/router2/util' +import {isMobile} from '@/constants/platform' +import * as Tabs from '@/constants/tabs' // This store has no dependencies on other stores and is safe to import directly from other stores. type Store = T.Immutable<{ diff --git a/shared/constants/notifications/index.tsx b/shared/stores/notifications.tsx similarity index 95% rename from shared/constants/notifications/index.tsx rename to shared/stores/notifications.tsx index de0802fff654..3fcbeab6cb8c 100644 --- a/shared/constants/notifications/index.tsx +++ b/shared/stores/notifications.tsx @@ -1,12 +1,12 @@ import * as Z from '@/util/zustand' import * as EngineGen from '@/actions/engine-gen-gen' -import type * as T from '../types' -import {isMobile} from '../platform' +import type * as T from '@/constants/types' +import {isMobile} from '@/constants/platform' import isEqual from 'lodash/isEqual' -import * as Tabs from '../tabs' -import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' -import {useCurrentUserState} from '../current-user' +import * as Tabs from '@/constants/tabs' +import {storeRegistry} from '@/constants/store-registry' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' export type BadgeType = 'regular' | 'update' | 'error' | 'uploading' export type NotificationKeys = 'kbfsUploading' | 'outOfSpace' diff --git a/shared/constants/people/index.tsx b/shared/stores/people.tsx similarity index 98% rename from shared/constants/people/index.tsx rename to shared/stores/people.tsx index 7599680c75f4..27a6a2746e2d 100644 --- a/shared/constants/people/index.tsx +++ b/shared/stores/people.tsx @@ -1,17 +1,17 @@ import * as EngineGen from '@/actions/engine-gen-gen' -import {ignorePromise} from '../utils' +import {ignorePromise} from '@/constants/utils' import * as Z from '@/util/zustand' import invert from 'lodash/invert' import isEqual from 'lodash/isEqual' import logger from '@/logger' -import * as T from '../types' +import * as T from '@/constants/types' import type {IconType} from '@/common-adapters/icon.constants-gen' // do NOT pull in all of common-adapters -import {isMobile} from '../platform' +import {isMobile} from '@/constants/platform' import type {e164ToDisplay as e164ToDisplayType} from '@/util/phone-numbers' import debounce from 'lodash/debounce' -import {useConfigState} from '../config' -import {useFollowerState} from '../followers' -import {RPCError, isNetworkErr} from '../utils' +import {useConfigState} from '@/stores/config' +import {useFollowerState} from '@/stores/followers' +import {RPCError, isNetworkErr} from '@/constants/utils' // set this to true to have all todo items + a contact joined notification show up all the time const debugTodo = false as boolean diff --git a/shared/constants/pinentry/index.tsx b/shared/stores/pinentry.tsx similarity index 97% rename from shared/constants/pinentry/index.tsx rename to shared/stores/pinentry.tsx index 45caef2e55d3..8ad874ff5cf1 100644 --- a/shared/constants/pinentry/index.tsx +++ b/shared/stores/pinentry.tsx @@ -1,9 +1,9 @@ import * as Z from '@/util/zustand' import * as EngineGen from '@/actions/engine-gen-gen' -import * as T from '../types' +import * as T from '@/constants/types' import logger from '@/logger' import {invalidPasswordErrorString} from '@/constants/config/util' -import {wrapErrors} from '../utils' +import {wrapErrors} from '@/constants/utils' // This store has no dependencies on other stores and is safe to import directly from other stores. export type Store = T.Immutable<{ diff --git a/shared/constants/profile/index.tsx b/shared/stores/profile.tsx similarity index 97% rename from shared/constants/profile/index.tsx rename to shared/stores/profile.tsx index d99952fa3cdb..8d1f42ea1fef 100644 --- a/shared/constants/profile/index.tsx +++ b/shared/stores/profile.tsx @@ -1,16 +1,16 @@ -import * as T from '../types' -import {generateGUIID, ignorePromise, wrapErrors} from '../utils' -import * as S from '../strings' +import * as T from '@/constants/types' +import {generateGUIID, ignorePromise, wrapErrors} from '@/constants/utils' +import * as S from '@/constants/strings' import * as Validators from '@/util/simple-validators' import * as Z from '@/util/zustand' import logger from '@/logger' import openURL from '@/util/open-url' import {RPCError} from '@/util/errors' import {fixCrop} from '@/util/crop' -import {clearModals, navigateAppend, navigateUp} from '../router2/util' -import {storeRegistry} from '../store-registry' -import {useCurrentUserState} from '../current-user' -import {navToProfile} from '../router2/util' +import {clearModals, navigateAppend, navigateUp} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useCurrentUserState} from '@/stores/current-user' +import {navToProfile} from '@/constants/router2/util' type ProveGenericParams = { logoBlack: T.Tracker.SiteIconSet @@ -599,9 +599,7 @@ export const useProfileState = Z.createZustand((set, get) => { }) const f = async () => { await T.RPCGen.proveCheckProofRpcPromise({sigID}, S.waitingKeyProfile) - storeRegistry - .getState('tracker2') - .dispatch.showUser(useCurrentUserState.getState().username, false) + storeRegistry.getState('tracker2').dispatch.showUser(useCurrentUserState.getState().username, false) } ignorePromise(f()) }, @@ -649,9 +647,7 @@ export const useProfileState = Z.createZustand((set, get) => { }, submitRevokeProof: proofId => { const f = async () => { - const you = storeRegistry - .getState('tracker2') - .getDetails(useCurrentUserState.getState().username) + const you = storeRegistry.getState('tracker2').getDetails(useCurrentUserState.getState().username) if (!you.assertions) return const proof = [...you.assertions.values()].find(a => a.sigID === proofId) if (!proof) return diff --git a/shared/constants/provision/index.tsx b/shared/stores/provision.tsx similarity index 98% rename from shared/constants/provision/index.tsx rename to shared/stores/provision.tsx index e948638d1e95..b30d9a3d5e05 100644 --- a/shared/constants/provision/index.tsx +++ b/shared/stores/provision.tsx @@ -1,15 +1,15 @@ -import * as T from '../types' -import {ignorePromise, wrapErrors} from '../utils' -import {waitingKeyProvision, waitingKeyProvisionForgotUsername} from '../strings' +import * as T from '@/constants/types' +import {ignorePromise, wrapErrors} from '@/constants/utils' +import {waitingKeyProvision, waitingKeyProvisionForgotUsername} from '@/constants/strings' import * as Z from '@/util/zustand' import {RPCError} from '@/util/errors' -import {isMobile} from '../platform' +import {isMobile} from '@/constants/platform' import {type CommonResponseHandler} from '@/engine/types' import isEqual from 'lodash/isEqual' -import {rpcDeviceToDevice} from '../rpc-utils' +import {rpcDeviceToDevice} from '@/constants/rpc-utils' import {invalidPasswordErrorString} from '@/constants/config/util' -import {clearModals, navigateAppend} from '../router2/util' -import {useWaitingState} from '../waiting' +import {clearModals, navigateAppend} from '@/constants/router2/util' +import {useWaitingState} from '@/stores/waiting' export type Device = { deviceNumberOfType: number diff --git a/shared/constants/recover-password/index.tsx b/shared/stores/recover-password.tsx similarity index 94% rename from shared/constants/recover-password/index.tsx rename to shared/stores/recover-password.tsx index 8a642f8b9487..464bb2e1aa87 100644 --- a/shared/constants/recover-password/index.tsx +++ b/shared/stores/recover-password.tsx @@ -1,14 +1,14 @@ -import * as T from '../types' -import {ignorePromise, wrapErrors} from '../utils' -import {waitingKeyRecoverPassword} from '../strings' +import * as T from '@/constants/types' +import {ignorePromise, wrapErrors} from '@/constants/utils' +import {waitingKeyRecoverPassword} from '@/constants/strings' import * as Z from '@/util/zustand' import logger from '@/logger' import {RPCError} from '@/util/errors' -import {type Device} from '../provision' -import {rpcDeviceToDevice} from '../rpc-utils' -import {clearModals, navigateAppend, navigateUp} from '../router2/util' -import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' +import {type Device} from '@/stores/provision' +import {rpcDeviceToDevice} from '@/constants/rpc-utils' +import {clearModals, navigateAppend, navigateUp} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useConfigState} from '@/stores/config' type Store = T.Immutable<{ devices: Array @@ -225,9 +225,7 @@ export const useState = Z.createZustand((set, get) => { s.error = msg }) navigateAppend( - useConfigState.getState().loggedIn - ? 'recoverPasswordErrorModal' - : 'recoverPasswordError', + useConfigState.getState().loggedIn ? 'recoverPasswordErrorModal' : 'recoverPasswordError', true ) } diff --git a/shared/constants/router2/index.tsx b/shared/stores/router2.tsx similarity index 94% rename from shared/constants/router2/index.tsx rename to shared/stores/router2.tsx index 24c72281cad0..69864067988b 100644 --- a/shared/constants/router2/index.tsx +++ b/shared/stores/router2.tsx @@ -1,9 +1,9 @@ -import type * as T from '../types' +import type * as T from '@/constants/types' import * as Z from '@/util/zustand' -import * as Tabs from '../tabs' +import * as Tabs from '@/constants/tabs' import type {RouteKeys} from '@/router-v2/route-params' -import {storeRegistry} from '../store-registry' -import * as Util from './util' +import {storeRegistry} from '@/constants/store-registry' +import * as Util from '@/constants/router2/util' export { type NavState, @@ -21,8 +21,8 @@ export { getRouteLoggedIn, useSafeFocusEffect, makeScreen, -} from './util' -export type {PathParam, Navigator} from './util' +} from '@/constants/router2/util' +export type {PathParam, Navigator} from '@/constants/router2/util' type Store = T.Immutable<{ navState?: unknown diff --git a/shared/constants/settings-chat/index.tsx b/shared/stores/settings-chat.tsx similarity index 95% rename from shared/constants/settings-chat/index.tsx rename to shared/stores/settings-chat.tsx index 615ba7a1981f..71e6af5aca23 100644 --- a/shared/constants/settings-chat/index.tsx +++ b/shared/stores/settings-chat.tsx @@ -1,8 +1,8 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' -import * as S from '../strings' +import * as T from '@/constants/types' +import {ignorePromise} from '@/constants/utils' +import * as S from '@/constants/strings' import * as Z from '@/util/zustand' -import {useConfigState} from '../config' +import {useConfigState} from '@/stores/config' export type ChatUnfurlState = { unfurlMode?: T.RPCChat.UnfurlMode diff --git a/shared/constants/settings-contacts.d.ts b/shared/stores/settings-contacts.d.ts similarity index 95% rename from shared/constants/settings-contacts.d.ts rename to shared/stores/settings-contacts.d.ts index 3f48c273c201..0ab05a739542 100644 --- a/shared/constants/settings-contacts.d.ts +++ b/shared/stores/settings-contacts.d.ts @@ -1,4 +1,4 @@ -import type * as T from './types' +import type * as T from '../constants/types' import type {UseBoundStore, StoreApi} from 'zustand' type PermissionStatus = 'granted' | 'denied' | 'undetermined' | 'unknown' diff --git a/shared/constants/settings-contacts.desktop.tsx b/shared/stores/settings-contacts.desktop.tsx similarity index 100% rename from shared/constants/settings-contacts.desktop.tsx rename to shared/stores/settings-contacts.desktop.tsx diff --git a/shared/constants/settings-contacts.native.tsx b/shared/stores/settings-contacts.native.tsx similarity index 95% rename from shared/constants/settings-contacts.native.tsx rename to shared/stores/settings-contacts.native.tsx index 971a5bfdfab5..786e6d0710ab 100644 --- a/shared/constants/settings-contacts.native.tsx +++ b/shared/stores/settings-contacts.native.tsx @@ -1,19 +1,19 @@ import * as Contacts from 'expo-contacts' -import {ignorePromise} from './utils' -import {importContactsWaitingKey} from './strings' -import * as T from './types' +import {ignorePromise} from '../constants/utils' +import {importContactsWaitingKey} from '../constants/strings' +import * as T from '../constants/types' import * as Z from '@/util/zustand' import {addNotificationRequest} from 'react-native-kb' import logger from '@/logger' import type {Store, State} from './settings-contacts' import {RPCError} from '@/util/errors' import {getDefaultCountryCode} from 'react-native-kb' -import {getE164} from './settings-phone' +import {getE164} from '@/util/phone-numbers' import {pluralize} from '@/util/string' -import {navigateAppend} from './router2/util' -import {useConfigState} from './config' -import {useCurrentUserState} from './current-user' -import {useWaitingState} from './waiting' +import {navigateAppend} from '@/constants/router2/util' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' +import {useWaitingState} from '@/stores/waiting' const importContactsConfigKey = (username: string) => `ui.importContacts.${username}` diff --git a/shared/constants/settings-email/index.tsx b/shared/stores/settings-email.tsx similarity index 97% rename from shared/constants/settings-email/index.tsx rename to shared/stores/settings-email.tsx index 7cb1d649961a..935f43208173 100644 --- a/shared/constants/settings-email/index.tsx +++ b/shared/stores/settings-email.tsx @@ -1,7 +1,7 @@ import * as Z from '@/util/zustand' -import {addEmailWaitingKey} from '../strings' -import {ignorePromise} from '../utils' -import * as T from '../types' +import {addEmailWaitingKey} from '@/constants/strings' +import {ignorePromise} from '@/constants/utils' +import * as T from '@/constants/types' import {isValidEmail} from '@/util/simple-validators' import {RPCError} from '@/util/errors' import logger from '@/logger' diff --git a/shared/constants/settings-invites/index.tsx b/shared/stores/settings-invites.tsx similarity index 95% rename from shared/constants/settings-invites/index.tsx rename to shared/stores/settings-invites.tsx index c6b6edc8e582..75cf71ef468f 100644 --- a/shared/constants/settings-invites/index.tsx +++ b/shared/stores/settings-invites.tsx @@ -1,11 +1,11 @@ import * as Z from '@/util/zustand' -import {ignorePromise} from '../utils' -import {waitingKeySettingsGeneric} from '../strings' +import {ignorePromise} from '@/constants/utils' +import {waitingKeySettingsGeneric} from '@/constants/strings' import {RPCError} from '@/util/errors' import logger from '@/logger' import trim from 'lodash/trim' -import * as T from '../types' -import {navigateAppend} from '../router2/util' +import * as T from '@/constants/types' +import {navigateAppend} from '@/constants/router2/util' type InviteBase = { id: string diff --git a/shared/constants/settings-notifications/index.tsx b/shared/stores/settings-notifications.tsx similarity index 97% rename from shared/constants/settings-notifications/index.tsx rename to shared/stores/settings-notifications.tsx index f93adaae9fdc..c22a90a587f0 100644 --- a/shared/constants/settings-notifications/index.tsx +++ b/shared/stores/settings-notifications.tsx @@ -1,10 +1,10 @@ import * as Z from '@/util/zustand' -import * as S from '../strings' -import {isAndroidNewerThanN} from '../platform' -import {ignorePromise, timeoutPromise} from '../utils' +import * as S from '@/constants/strings' +import {isAndroidNewerThanN} from '@/constants/platform' +import {ignorePromise, timeoutPromise} from '@/constants/utils' import {RPCError} from '@/util/errors' import logger from '@/logger' -import * as T from '../types' +import * as T from '@/constants/types' const securityGroup = 'security' const soundGroup = 'sound' diff --git a/shared/constants/settings-password/index.tsx b/shared/stores/settings-password.tsx similarity index 94% rename from shared/constants/settings-password/index.tsx rename to shared/stores/settings-password.tsx index 40123b264cd8..138097633658 100644 --- a/shared/constants/settings-password/index.tsx +++ b/shared/stores/settings-password.tsx @@ -1,11 +1,11 @@ import * as Z from '@/util/zustand' -import {ignorePromise} from '../utils' -import {waitingKeySettingsGeneric} from '../strings' +import {ignorePromise} from '@/constants/utils' +import {waitingKeySettingsGeneric} from '@/constants/strings' import logger from '@/logger' import {RPCError} from '@/util/errors' -import * as T from '../types' -import {navigateUp} from '../router2/util' -import {useLogoutState} from '../logout' +import * as T from '@/constants/types' +import {navigateUp} from '@/constants/router2/util' +import {useLogoutState} from '@/stores/logout' type Store = T.Immutable<{ error: string diff --git a/shared/constants/settings-phone/index.tsx b/shared/stores/settings-phone.tsx similarity index 88% rename from shared/constants/settings-phone/index.tsx rename to shared/stores/settings-phone.tsx index cc19e82aa27d..a70f161aa1f0 100644 --- a/shared/constants/settings-phone/index.tsx +++ b/shared/stores/settings-phone.tsx @@ -1,15 +1,10 @@ -import * as T from '../types' -import * as S from '../strings' -import {ignorePromise} from '../utils' +import * as T from '@/constants/types' +import * as S from '@/constants/strings' +import {ignorePromise} from '@/constants/utils' import * as Z from '@/util/zustand' import logger from '@/logger' import {RPCError} from '@/util/errors' -import type { - e164ToDisplay as e164ToDisplayType, - phoneUtil as phoneUtilType, - ValidationResult as ValidationResultType, - PhoneNumberFormat as PhoneNumberFormatType, -} from '@/util/phone-numbers' +import type {e164ToDisplay as e164ToDisplayType} from '@/util/phone-numbers' export const makePhoneRow = (): PhoneRow => ({ displayNumber: '', @@ -19,25 +14,6 @@ export const makePhoneRow = (): PhoneRow => ({ verified: false, }) -// Get phone number in e.164, or null if we can't parse it. -export const getE164 = (phoneNumber: string, countryCode?: string) => { - const {phoneUtil, ValidationResult, PhoneNumberFormat} = require('@/util/phone-numbers') as { - phoneUtil: typeof phoneUtilType - ValidationResult: typeof ValidationResultType - PhoneNumberFormat: typeof PhoneNumberFormatType - } - try { - const parsed = countryCode ? phoneUtil.parse(phoneNumber, countryCode) : phoneUtil.parse(phoneNumber) - const reason = phoneUtil.isPossibleNumberWithReason(parsed) - if (reason !== ValidationResult.IS_POSSIBLE) { - return null - } - return phoneUtil.format(parsed, PhoneNumberFormat.E164) - } catch { - return null - } -} - const toPhoneRow = (p: T.RPCGen.UserPhoneNumber) => { const {e164ToDisplay} = require('@/util/phone-numbers') as {e164ToDisplay: typeof e164ToDisplayType} return { diff --git a/shared/constants/settings/index.tsx b/shared/stores/settings.tsx similarity index 79% rename from shared/constants/settings/index.tsx rename to shared/stores/settings.tsx index 16ffc111cdcf..73fbe751a5f8 100644 --- a/shared/constants/settings/index.tsx +++ b/shared/stores/settings.tsx @@ -1,21 +1,20 @@ -import * as T from '../types' -import {ignorePromise, timeoutPromise} from '../utils' -import * as S from '../strings' -import {androidIsTestDevice, pprofDir} from '../platform' -import * as EngineGen from '@/actions/engine-gen-gen' +import * as T from '@/constants/types' +import {ignorePromise, timeoutPromise} from '@/constants/utils' +import * as S from '@/constants/strings' +import {androidIsTestDevice, pprofDir} from '@/constants/platform' import openURL from '@/util/open-url' import * as Z from '@/util/zustand' import {RPCError} from '@/util/errors' -import * as Tabs from '../tabs' +import * as Tabs from '@/constants/tabs' import logger from '@/logger' -import {clearModals, navigateAppend, switchTab} from '../router2/util' -import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' -import {useCurrentUserState} from '../current-user' -import {useWaitingState} from '../waiting' -import {processorProfileInProgressKey, traceInProgressKey} from './util' +import {clearModals, navigateAppend, switchTab} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' +import {useWaitingState} from '@/stores/waiting' +import {processorProfileInProgressKey, traceInProgressKey} from '@/constants/settings/util' -export * from './util' +export * from '@/constants/settings/util' type Store = T.Immutable<{ checkPasswordIsCorrect?: boolean @@ -40,7 +39,6 @@ export interface State extends Store { loadProxyData: () => void loadSettings: () => void loginBrowserViaWebAuthToken: () => void - onEngineIncomingImpl: (action: EngineGen.Actions) => void processorProfile: (durationSeconds: number) => void resetCheckPassword: () => void resetState: 'default' @@ -173,34 +171,6 @@ export const useSettingsState = Z.createZustand(set => { } ignorePromise(f()) }, - onEngineIncomingImpl: action => { - switch (action.type) { - case EngineGen.keybase1NotifyEmailAddressEmailAddressVerified: - logger.info('email verified') - storeRegistry - .getState('settings-email') - .dispatch.notifyEmailVerified(action.payload.params.emailAddress) - break - case EngineGen.keybase1NotifyUsersPasswordChanged: { - const randomPW = action.payload.params.state === T.RPCGen.PassphraseState.random - storeRegistry.getState('settings-password').dispatch.notifyUsersPasswordChanged(randomPW) - break - } - case EngineGen.keybase1NotifyPhoneNumberPhoneNumbersChanged: { - const {list} = action.payload.params - storeRegistry - .getState('settings-phone') - .dispatch.notifyPhoneNumberPhoneNumbersChanged(list ?? undefined) - break - } - case EngineGen.keybase1NotifyEmailAddressEmailsChanged: { - const list = action.payload.params.list ?? [] - storeRegistry.getState('settings-email').dispatch.notifyEmailAddressEmailsChanged(list) - break - } - default: - } - }, processorProfile: profileDurationSeconds => { const f = async () => { await T.RPCGen.pprofLogProcessorProfileRpcPromise({ diff --git a/shared/constants/signup/index.tsx b/shared/stores/signup.tsx similarity index 96% rename from shared/constants/signup/index.tsx rename to shared/stores/signup.tsx index dfa015b6319a..2a0058d0f5cf 100644 --- a/shared/constants/signup/index.tsx +++ b/shared/stores/signup.tsx @@ -1,16 +1,16 @@ -import * as Platforms from '../platform' -import {ignorePromise} from '../utils' -import * as S from '../strings' +import * as Platforms from '@/constants/platform' +import {ignorePromise} from '@/constants/utils' +import * as S from '@/constants/strings' import * as EngineGen from '@/actions/engine-gen-gen' -import * as T from '../types' +import * as T from '@/constants/types' import * as Z from '@/util/zustand' import logger from '@/logger' import trim from 'lodash/trim' import {RPCError} from '@/util/errors' import {isValidEmail, isValidName, isValidUsername} from '@/util/simple-validators' -import {navigateAppend, navigateUp} from '../router2/util' -import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' +import {navigateAppend, navigateUp} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useConfigState} from '@/stores/config' type Store = T.Immutable<{ devicename: string diff --git a/shared/constants/team-building/index.tsx b/shared/stores/team-building.tsx similarity index 97% rename from shared/constants/team-building/index.tsx rename to shared/stores/team-building.tsx index ddef3357d5dc..4db76d25466f 100644 --- a/shared/constants/team-building/index.tsx +++ b/shared/stores/team-building.tsx @@ -1,6 +1,6 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' -import * as Router2 from '../router2' +import * as T from '@/constants/types' +import {ignorePromise} from '@/constants/utils' +import * as Router2 from '@/stores/router2' import * as React from 'react' import * as Z from '@/util/zustand' import logger from '@/logger' @@ -11,11 +11,11 @@ import {serviceIdFromString} from '@/util/platforms' import {type StoreApi, type UseBoundStore, useStore} from 'zustand' import {validateEmailAddress} from '@/util/email-address' import {registerDebugClear} from '@/util/debug' -import {searchWaitingKey} from './utils' -import {navigateUp} from '../router2/util' -import {storeRegistry} from '../store-registry' -import {useCryptoState} from '../crypto' -export {allServices, selfToUser, searchWaitingKey} from './utils' +import {searchWaitingKey} from '@/constants/team-building/utils' +import {navigateUp} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useCryptoState} from '@/stores/crypto' +export {allServices, selfToUser, searchWaitingKey} from '@/constants/team-building/utils' type Store = T.Immutable<{ namespace: T.TB.AllowedNamespace diff --git a/shared/constants/teams/index.tsx b/shared/stores/teams.tsx similarity index 99% rename from shared/constants/teams/index.tsx rename to shared/stores/teams.tsx index 30ffecf7f3a7..27fbb2f9fac0 100644 --- a/shared/constants/teams/index.tsx +++ b/shared/stores/teams.tsx @@ -1,6 +1,6 @@ -import * as S from '../strings' -import {ignorePromise, wrapErrors} from '../utils' -import * as T from '../types' +import * as S from '@/constants/strings' +import {ignorePromise, wrapErrors} from '@/constants/utils' +import * as T from '@/constants/types' import * as EngineGen from '@/actions/engine-gen-gen' import { getVisibleScreen, @@ -9,21 +9,21 @@ import { navigateUp, navUpToScreen, navToProfile, -} from '../router2/util' +} from '@/constants/router2/util' import * as Z from '@/util/zustand' import invert from 'lodash/invert' import logger from '@/logger' import openSMS from '@/util/sms' import {RPCError, logError} from '@/util/errors' -import {isMobile, isPhone} from '../platform' +import {isMobile, isPhone} from '@/constants/platform' import {mapGetEnsureValue} from '@/util/map' -import {bodyToJSON} from '../rpc-utils' +import {bodyToJSON} from '@/constants/rpc-utils' import {fixCrop} from '@/util/crop' -import {storeRegistry} from '../store-registry' -import {useConfigState} from '../config' -import {useCurrentUserState} from '../current-user' -import * as Util from './util' -import {getTab} from '../router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' +import * as Util from '@/constants/teams/util' +import {getTab} from '@/constants/router2/util' export { baseRetentionPolicies, @@ -33,7 +33,7 @@ export { teamRoleByEnum, retentionPolicyToServiceRetentionPolicy, userIsRoleInTeamWithInfo, -} from './util' +} from '@/constants/teams/util' export const teamRoleTypes = ['reader', 'writer', 'admin', 'owner'] as const diff --git a/shared/constants/tracker2/index.tsx b/shared/stores/tracker2.tsx similarity index 98% rename from shared/constants/tracker2/index.tsx rename to shared/stores/tracker2.tsx index 82d96edd041e..1fa1152e9c29 100644 --- a/shared/constants/tracker2/index.tsx +++ b/shared/stores/tracker2.tsx @@ -1,14 +1,14 @@ -import * as S from '../strings' +import * as S from '@/constants/strings' import * as EngineGen from '@/actions/engine-gen-gen' -import {generateGUIID, ignorePromise} from '../utils' +import {generateGUIID, ignorePromise} from '@/constants/utils' import * as Z from '@/util/zustand' import logger from '@/logger' -import * as T from '../types' +import * as T from '@/constants/types' import {RPCError} from '@/util/errors' import {mapGetEnsureValue} from '@/util/map' -import {navigateAppend, navigateUp} from '../router2/util' -import {storeRegistry} from '../store-registry' -import {useCurrentUserState} from '../current-user' +import {navigateAppend, navigateUp} from '@/constants/router2/util' +import {storeRegistry} from '@/constants/store-registry' +import {useCurrentUserState} from '@/stores/current-user' export const noDetails: T.Tracker.Details = { assertions: new Map(), diff --git a/shared/constants/unlock-folders/index.tsx b/shared/stores/unlock-folders.tsx similarity index 95% rename from shared/constants/unlock-folders/index.tsx rename to shared/stores/unlock-folders.tsx index 9cc11c3b8352..d8fa1d8dd573 100644 --- a/shared/constants/unlock-folders/index.tsx +++ b/shared/stores/unlock-folders.tsx @@ -1,9 +1,9 @@ import * as EngineGen from '@/actions/engine-gen-gen' -import * as T from '../types' +import * as T from '@/constants/types' import * as Z from '@/util/zustand' import logger from '@/logger' import {getEngine} from '@/engine/require' -import {useConfigState, type State as ConfigStore} from '../config' +import {useConfigState, type State as ConfigStore} from '@/stores/config' type Store = T.Immutable<{ devices: ConfigStore['unlockFoldersDevices'] diff --git a/shared/constants/users/index.tsx b/shared/stores/users.tsx similarity index 96% rename from shared/constants/users/index.tsx rename to shared/stores/users.tsx index 642c3c0f3ec9..618264f110ac 100644 --- a/shared/constants/users/index.tsx +++ b/shared/stores/users.tsx @@ -1,11 +1,11 @@ import * as EngineGen from '@/actions/engine-gen-gen' import * as Z from '@/util/zustand' import logger from '@/logger' -import * as T from '../types' +import * as T from '@/constants/types' import {mapGetEnsureValue} from '@/util/map' -import {ignorePromise} from '../utils' -import {RPCError, isNetworkErr} from '../utils' -import * as S from '../strings' +import {ignorePromise} from '@/constants/utils' +import {RPCError, isNetworkErr} from '@/constants/utils' +import * as S from '@/constants/strings' type Store = T.Immutable<{ blockMap: Map diff --git a/shared/constants/waiting/index.tsx b/shared/stores/waiting.tsx similarity index 98% rename from shared/constants/waiting/index.tsx rename to shared/stores/waiting.tsx index c98dd7515a17..effcb51b5006 100644 --- a/shared/constants/waiting/index.tsx +++ b/shared/stores/waiting.tsx @@ -1,5 +1,5 @@ import type {RPCError} from '@/util/errors' -import type * as T from '../types' +import type * as T from '@/constants/types' import * as Z from '@/util/zustand' // This store has no dependencies on other stores and is safe to import directly from other stores. diff --git a/shared/constants/wallets/index.tsx b/shared/stores/wallets.tsx similarity index 86% rename from shared/constants/wallets/index.tsx rename to shared/stores/wallets.tsx index 3843d7919ea1..e340fd2cf383 100644 --- a/shared/constants/wallets/index.tsx +++ b/shared/stores/wallets.tsx @@ -1,10 +1,10 @@ -import * as T from '../types' -import {ignorePromise} from '../utils' +import * as T from '@/constants/types' +import {ignorePromise} from '@/constants/utils' import * as Z from '@/util/zustand' -import {loadAccountsWaitingKey} from './utils' -import {useConfigState} from '../config' +import {loadAccountsWaitingKey} from '@/constants/wallets/utils' +import {useConfigState} from '@/stores/config' -export {loadAccountsWaitingKey} from './utils' +export {loadAccountsWaitingKey} from '@/constants/wallets/utils' export type Account = { accountID: string diff --git a/shared/constants/whats-new/index.tsx b/shared/stores/whats-new.tsx similarity index 92% rename from shared/constants/whats-new/index.tsx rename to shared/stores/whats-new.tsx index 4a2d0bddcac0..2944a3685655 100644 --- a/shared/constants/whats-new/index.tsx +++ b/shared/stores/whats-new.tsx @@ -1,9 +1,9 @@ -import type * as T from '../types' +import type * as T from '@/constants/types' import * as Z from '@/util/zustand' import {uint8ArrayToString} from 'uint8array-extras' -import {noVersion, getSeenVersions} from './utils' +import {noVersion, getSeenVersions} from '@/constants/whats-new/utils' -export {currentVersion, lastVersion, lastLastVersion, keybaseFM} from './utils' +export {currentVersion, lastVersion, lastLastVersion, keybaseFM} from '@/constants/whats-new/utils' // This store has no dependencies on other stores and is safe to import directly from other stores. type SeenVersionsMap = {[key in string]: boolean} diff --git a/shared/styles/colors.tsx b/shared/styles/colors.tsx index f84ad80c59b3..76c0da24acae 100644 --- a/shared/styles/colors.tsx +++ b/shared/styles/colors.tsx @@ -1,5 +1,5 @@ // the _on_white are precomputed colors so we can do less blending on mobile -import {useDarkModeState} from '@/constants/darkmode' +import {useDarkModeState} from '@/stores/darkmode' import {isIOS, isAndroid} from '@/constants/platform' import type {DynamicColorIOS as DynamicColorIOSType} from 'react-native' import type {Opaque} from '@/constants/types/ts' diff --git a/shared/styles/index.native.tsx b/shared/styles/index.native.tsx index 0fc8b52b108c..a15e6e2db217 100644 --- a/shared/styles/index.native.tsx +++ b/shared/styles/index.native.tsx @@ -2,7 +2,7 @@ import * as Shared from './shared' import {colors as lightColors} from './colors' import styleSheetCreateProxy, {type MapToStyles} from './style-sheet-proxy' import {StyleSheet, Dimensions} from 'react-native' -import {useDarkModeState} from '@/constants/darkmode' +import {useDarkModeState} from '@/stores/darkmode' import {isIOS, isTablet} from '@/constants/platform' const font = isIOS diff --git a/shared/styles/style-sheet-proxy.tsx b/shared/styles/style-sheet-proxy.tsx index 37cb8404f801..a6d33b090b3b 100644 --- a/shared/styles/style-sheet-proxy.tsx +++ b/shared/styles/style-sheet-proxy.tsx @@ -1,4 +1,4 @@ -import {useDarkModeState} from '@/constants/darkmode' +import {useDarkModeState} from '@/stores/darkmode' import type {StylesCrossPlatform} from '.' // Support a closure to enable simple dark mode. diff --git a/shared/team-building/contacts.tsx b/shared/team-building/contacts.tsx index 6d39827419c6..06edc5fb79f2 100644 --- a/shared/team-building/contacts.tsx +++ b/shared/team-building/contacts.tsx @@ -1,8 +1,8 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' -import {useSettingsContactsState} from '@/constants/settings-contacts' -import {useTBContext} from '@/constants/team-building' +import {useSettingsContactsState} from '@/stores/settings-contacts' +import {useTBContext} from '@/stores/team-building' const useContactsProps = () => { const contactsImported = useSettingsContactsState(s => s.importEnabled) diff --git a/shared/team-building/email-search.tsx b/shared/team-building/email-search.tsx index 669e819c92a4..3b0ffa004508 100644 --- a/shared/team-building/email-search.tsx +++ b/shared/team-building/email-search.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as TB from '@/constants/team-building' +import * as TB from '@/stores/team-building' import * as React from 'react' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' diff --git a/shared/team-building/filtered-service-tab-bar.tsx b/shared/team-building/filtered-service-tab-bar.tsx index 353ce9fa5665..b882965f5429 100644 --- a/shared/team-building/filtered-service-tab-bar.tsx +++ b/shared/team-building/filtered-service-tab-bar.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import type * as T from '@/constants/types' import {ServiceTabBar} from './service-tab-bar' -import * as TeamBuilding from '@/constants/team-building' +import * as TeamBuilding from '@/stores/team-building' export const FilteredServiceTabBar = ( props: Omit, 'services'> & { diff --git a/shared/team-building/index.tsx b/shared/team-building/index.tsx index bbc6518549f4..7b94ab175862 100644 --- a/shared/team-building/index.tsx +++ b/shared/team-building/index.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' -import * as TB from '@/constants/team-building' -import * as Teams from '@/constants/teams' +import * as TB from '@/stores/team-building' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as React from 'react' import * as T from '@/constants/types' diff --git a/shared/team-building/list-body.tsx b/shared/team-building/list-body.tsx index d9cb0fcbeb9a..20b0bcd9dac5 100644 --- a/shared/team-building/list-body.tsx +++ b/shared/team-building/list-body.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as C from '@/constants' -import * as TB from '@/constants/team-building' -import {useTeamsState} from '@/constants/teams' +import * as TB from '@/stores/team-building' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import * as Shared from './shared' import PeopleResult from './search-result/people-result' @@ -14,9 +14,9 @@ import type {RootRouteProps} from '@/router-v2/route-params' import {RecsAndRecos, numSectionLabel} from './recs-and-recos' import {formatAnyPhoneNumbers} from '@/util/phone-numbers' import {useRoute} from '@react-navigation/native' -import {useSettingsContactsState} from '@/constants/settings-contacts' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' +import {useSettingsContactsState} from '@/stores/settings-contacts' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' // import {useAnimatedScrollHandler} from '@/common-adapters/reanimated' import {useColorScheme} from 'react-native' diff --git a/shared/team-building/page.tsx b/shared/team-building/page.tsx index a5f899216400..083c6b96837b 100644 --- a/shared/team-building/page.tsx +++ b/shared/team-building/page.tsx @@ -1,7 +1,7 @@ import type * as C from '@/constants' import * as Kb from '@/common-adapters' import * as React from 'react' -import {TBProvider} from '@/constants/team-building' +import {TBProvider} from '@/stores/team-building' const getOptions = ({route}: OwnProps) => { const namespace: unknown = route.params.namespace diff --git a/shared/team-building/phone-search.tsx b/shared/team-building/phone-search.tsx index 4a93fd2dd078..993278b057c9 100644 --- a/shared/team-building/phone-search.tsx +++ b/shared/team-building/phone-search.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' -import * as TB from '@/constants/team-building' +import * as TB from '@/stores/team-building' import * as React from 'react' import * as Kb from '@/common-adapters/index' import type * as T from 'constants/types' import ContinueButton from './continue-button' -import {useSettingsPhoneState} from '@/constants/settings-phone' +import {useSettingsPhoneState} from '@/stores/settings-phone' type PhoneSearchProps = { continueLabel: string diff --git a/shared/team-building/search-result/hellobot-result.tsx b/shared/team-building/search-result/hellobot-result.tsx index 029e730955d1..8e080121a890 100644 --- a/shared/team-building/search-result/hellobot-result.tsx +++ b/shared/team-building/search-result/hellobot-result.tsx @@ -1,6 +1,6 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import {useTBContext} from '@/constants/team-building' +import {useTBContext} from '@/stores/team-building' import * as Kb from '@/common-adapters' import CommonResult, {type ResultProps} from './common-result' diff --git a/shared/team-building/search-result/people-result.tsx b/shared/team-building/search-result/people-result.tsx index 82bf99580a2c..7292f26ffae4 100644 --- a/shared/team-building/search-result/people-result.tsx +++ b/shared/team-building/search-result/people-result.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import CommonResult, {type ResultProps} from './common-result' -import {useUsersState} from '@/constants/users' -import {useCurrentUserState} from '@/constants/current-user' +import {useUsersState} from '@/stores/users' +import {useCurrentUserState} from '@/stores/current-user' /* * This component is intended to be a drop-in replacement for UserResult. diff --git a/shared/team-building/search-result/you-result.tsx b/shared/team-building/search-result/you-result.tsx index 0e98651cd20a..0c482c089fc9 100644 --- a/shared/team-building/search-result/you-result.tsx +++ b/shared/team-building/search-result/you-result.tsx @@ -1,6 +1,6 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import {useTBContext} from '@/constants/team-building' +import {useTBContext} from '@/stores/team-building' import * as Kb from '@/common-adapters' import CommonResult, {type ResultProps} from './common-result' diff --git a/shared/team-building/shared.tsx b/shared/team-building/shared.tsx index 6342bd06fd0b..9303fdcff0ef 100644 --- a/shared/team-building/shared.tsx +++ b/shared/team-building/shared.tsx @@ -1,7 +1,7 @@ import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import type {IconType} from '@/common-adapters/icon.constants-gen' -import * as TeamBuilding from '@/constants/team-building' +import * as TeamBuilding from '@/stores/team-building' const services: { [K in T.TB.ServiceIdWithContact]: { diff --git a/shared/teams/add-members-wizard/add-contacts.native.tsx b/shared/teams/add-members-wizard/add-contacts.native.tsx index 6808ecaea271..e5e430e0bea1 100644 --- a/shared/teams/add-members-wizard/add-contacts.native.tsx +++ b/shared/teams/add-members-wizard/add-contacts.native.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import {pluralize} from '@/util/string' diff --git a/shared/teams/add-members-wizard/add-email.tsx b/shared/teams/add-members-wizard/add-email.tsx index 26cf7893dc31..c19e84f68547 100644 --- a/shared/teams/add-members-wizard/add-email.tsx +++ b/shared/teams/add-members-wizard/add-email.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' import * as T from '@/constants/types' diff --git a/shared/teams/add-members-wizard/add-from-where.tsx b/shared/teams/add-members-wizard/add-from-where.tsx index 08c3f171a503..8bda843d03cf 100644 --- a/shared/teams/add-members-wizard/add-from-where.tsx +++ b/shared/teams/add-members-wizard/add-from-where.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as T from '@/constants/types' import {ModalTitle} from '../common' import {useSafeNavigation} from '@/util/safe-navigation' diff --git a/shared/teams/add-members-wizard/add-phone.tsx b/shared/teams/add-members-wizard/add-phone.tsx index 9a93ef6f9c4b..5ed2a3a15ae2 100644 --- a/shared/teams/add-members-wizard/add-phone.tsx +++ b/shared/teams/add-members-wizard/add-phone.tsx @@ -1,11 +1,11 @@ import * as C from '@/constants' import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import {ModalTitle, usePhoneNumberList} from '../common' import {useSafeNavigation} from '@/util/safe-navigation' -import {useSettingsPhoneState} from '@/constants/settings-phone' +import {useSettingsPhoneState} from '@/stores/settings-phone' const waitingKey = 'phoneLookup' diff --git a/shared/teams/add-members-wizard/confirm.tsx b/shared/teams/add-members-wizard/confirm.tsx index 743ef7110357..6c4fab1bef42 100644 --- a/shared/teams/add-members-wizard/confirm.tsx +++ b/shared/teams/add-members-wizard/confirm.tsx @@ -1,8 +1,8 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import {assertionToDisplay} from '@/common-adapters/usernames' diff --git a/shared/teams/channel/create-channels.tsx b/shared/teams/channel/create-channels.tsx index 2a11aa71da5b..ab94118ac4c5 100644 --- a/shared/teams/channel/create-channels.tsx +++ b/shared/teams/channel/create-channels.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import {CreateChannelsModal} from '../new-team/wizard/create-channels' diff --git a/shared/teams/channel/header.tsx b/shared/teams/channel/header.tsx index ea4654017c5b..16a840f36f2e 100644 --- a/shared/teams/channel/header.tsx +++ b/shared/teams/channel/header.tsx @@ -1,9 +1,9 @@ import * as T from '@/constants/types' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import {pluralize} from '@/util/string' import {Activity, useChannelParticipants} from '../common' diff --git a/shared/teams/channel/index.tsx b/shared/teams/channel/index.tsx index 0bad5f015636..0af5d5e9274d 100644 --- a/shared/teams/channel/index.tsx +++ b/shared/teams/channel/index.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import { @@ -15,8 +15,8 @@ import ChannelMemberRow from './rows' import BotRow from '../team/rows/bot-row/bot' import SettingsList from '../../chat/conversation/info-panel/settings' import EmptyRow from '../team/rows/empty-row' -import {useBotsState} from '@/constants/bots' -import {useUsersState} from '@/constants/users' +import {useBotsState} from '@/stores/bots' +import {useUsersState} from '@/stores/users' export type OwnProps = { teamID: T.Teams.TeamID diff --git a/shared/teams/channel/rows.tsx b/shared/teams/channel/rows.tsx index e07037b57201..5c77b0f6a518 100644 --- a/shared/teams/channel/rows.tsx +++ b/shared/teams/channel/rows.tsx @@ -1,13 +1,13 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useProfileState} from '@/constants/profile' -import * as Teams from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import {useProfileState} from '@/stores/profile' +import * as Teams from '@/stores/teams' import type * as T from '@/constants/types' import * as React from 'react' import * as Kb from '@/common-adapters' import MenuHeader from '../team/rows/menu-header.new' -import {useUsersState} from '@/constants/users' -import {useCurrentUserState} from '@/constants/current-user' +import {useUsersState} from '@/stores/users' +import {useCurrentUserState} from '@/stores/current-user' type Props = { conversationIDKey: T.Chat.ConversationIDKey diff --git a/shared/teams/channel/tabs.tsx b/shared/teams/channel/tabs.tsx index 795cfb89ab9e..bc8d5526ea3a 100644 --- a/shared/teams/channel/tabs.tsx +++ b/shared/teams/channel/tabs.tsx @@ -1,7 +1,7 @@ import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import type {Tab as TabType} from '@/common-adapters/tabs' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' export type TabKey = 'members' | 'attachments' | 'bots' | 'settings' | 'loading' diff --git a/shared/teams/common/activity.tsx b/shared/teams/common/activity.tsx index 6ebbf1f4c098..f31a80050dff 100644 --- a/shared/teams/common/activity.tsx +++ b/shared/teams/common/activity.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' diff --git a/shared/teams/common/channel-hooks.tsx b/shared/teams/common/channel-hooks.tsx index 934b7100704b..7736f46a4e49 100644 --- a/shared/teams/common/channel-hooks.tsx +++ b/shared/teams/common/channel-hooks.tsx @@ -1,8 +1,8 @@ import * as T from '@/constants/types' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' // Filter bots out using team role info, isolate to only when related state changes export const useChannelParticipants = ( diff --git a/shared/teams/common/enable-contacts.tsx b/shared/teams/common/enable-contacts.tsx index 133d5cb95967..829078c08933 100644 --- a/shared/teams/common/enable-contacts.tsx +++ b/shared/teams/common/enable-contacts.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import * as Kb from '@/common-adapters' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' /** * Popup explaining that Keybase doesn't have contact permissions with a link to diff --git a/shared/teams/common/selection-popup.tsx b/shared/teams/common/selection-popup.tsx index 630b995890f3..a30fc04dd584 100644 --- a/shared/teams/common/selection-popup.tsx +++ b/shared/teams/common/selection-popup.tsx @@ -1,8 +1,8 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import * as React from 'react' import type * as T from '@/constants/types' import {FloatingRolePicker} from '../role-picker' diff --git a/shared/teams/common/use-contacts.native.tsx b/shared/teams/common/use-contacts.native.tsx index 822c30fea955..aa8329ca7130 100644 --- a/shared/teams/common/use-contacts.native.tsx +++ b/shared/teams/common/use-contacts.native.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import {e164ToDisplay} from '@/util/phone-numbers' import logger from '@/logger' import {getDefaultCountryCode} from 'react-native-kb' -import {useSettingsContactsState} from '@/constants/settings-contacts' -import {getE164} from '@/constants/settings-phone' +import {useSettingsContactsState} from '@/stores/settings-contacts' +import {getE164} from '@/util/phone-numbers' // Contact info coming from the native contacts library. export type Contact = { diff --git a/shared/teams/confirm-modals/confirm-kick-out.tsx b/shared/teams/confirm-modals/confirm-kick-out.tsx index 5a8a0d0624e1..4c9d358d20a3 100644 --- a/shared/teams/confirm-modals/confirm-kick-out.tsx +++ b/shared/teams/confirm-modals/confirm-kick-out.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as React from 'react' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import {useSafeNavigation} from '@/util/safe-navigation' diff --git a/shared/teams/confirm-modals/confirm-remove-from-channel.tsx b/shared/teams/confirm-modals/confirm-remove-from-channel.tsx index 4c346846133f..c05aa0d0d84b 100644 --- a/shared/teams/confirm-modals/confirm-remove-from-channel.tsx +++ b/shared/teams/confirm-modals/confirm-remove-from-channel.tsx @@ -1,8 +1,8 @@ import * as T from '@/constants/types' import * as C from '@/constants' import * as React from 'react' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' diff --git a/shared/teams/confirm-modals/delete-channel.tsx b/shared/teams/confirm-modals/delete-channel.tsx index 9ad085f55ab3..c2e44e152a52 100644 --- a/shared/teams/confirm-modals/delete-channel.tsx +++ b/shared/teams/confirm-modals/delete-channel.tsx @@ -2,7 +2,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import * as React from 'react' import type * as T from '@/constants/types' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import {pluralize} from '@/util/string' import {useAllChannelMetas} from '@/teams/common/channel-hooks' diff --git a/shared/teams/confirm-modals/really-leave-team/index.tsx b/shared/teams/confirm-modals/really-leave-team/index.tsx index 684726a1e8a4..9d4340be3b68 100644 --- a/shared/teams/confirm-modals/really-leave-team/index.tsx +++ b/shared/teams/confirm-modals/really-leave-team/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as C from '@/constants' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import {useSafeSubmit} from '@/util/safe-submit' import type * as T from '@/constants/types' diff --git a/shared/teams/container.tsx b/shared/teams/container.tsx index f3219023e020..e298f8692896 100644 --- a/shared/teams/container.tsx +++ b/shared/teams/container.tsx @@ -1,15 +1,15 @@ import * as C from '@/constants' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import * as FS from '@/constants/fs' +import * as FS from '@/stores/fs' import Main from './main' import openURL from '@/util/open-url' import {useTeamsSubscribe} from './subscriber' import {useActivityLevels} from './common' import {useSafeNavigation} from '@/util/safe-navigation' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const orderTeams = ( teams: ReadonlyMap, diff --git a/shared/teams/delete-team.tsx b/shared/teams/delete-team.tsx index e0dfd2750e0f..4c69295c90ac 100644 --- a/shared/teams/delete-team.tsx +++ b/shared/teams/delete-team.tsx @@ -6,8 +6,8 @@ import * as Kb from '@/common-adapters' import {pluralize} from '@/util/string' import {useTeamDetailsSubscribe} from './subscriber' import noop from 'lodash/noop' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' type OwnProps = {teamID: T.Teams.TeamID} diff --git a/shared/teams/edit-team-description.tsx b/shared/teams/edit-team-description.tsx index 7be608185f4c..71e0934031c3 100644 --- a/shared/teams/edit-team-description.tsx +++ b/shared/teams/edit-team-description.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import {ModalTitle} from './common' diff --git a/shared/teams/emojis/add-alias.tsx b/shared/teams/emojis/add-alias.tsx index cfbf1a23f600..728b3e93a2a4 100644 --- a/shared/teams/emojis/add-alias.tsx +++ b/shared/teams/emojis/add-alias.tsx @@ -1,6 +1,6 @@ import * as T from '@/constants/types' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import {EmojiPickerDesktop} from '@/chat/emoji-picker/container' diff --git a/shared/teams/emojis/add-emoji.tsx b/shared/teams/emojis/add-emoji.tsx index b1f9a3343e17..81c4e896a1f7 100644 --- a/shared/teams/emojis/add-emoji.tsx +++ b/shared/teams/emojis/add-emoji.tsx @@ -1,6 +1,6 @@ import * as T from '@/constants/types' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' import * as Kb from '@/common-adapters' import {AliasInput, Modal} from './common' diff --git a/shared/teams/external-team.tsx b/shared/teams/external-team.tsx index 642461031ab6..9fd9da9f4f66 100644 --- a/shared/teams/external-team.tsx +++ b/shared/teams/external-team.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useProfileState} from '@/constants/profile' +import * as Chat from '@/stores/chat2' +import {useProfileState} from '@/stores/profile' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import {useTeamLinkPopup} from './common' import {pluralize} from '@/util/string' import capitalize from 'lodash/capitalize' diff --git a/shared/teams/get-options.tsx b/shared/teams/get-options.tsx index e4aca9f077a2..f0cf90c88b0f 100644 --- a/shared/teams/get-options.tsx +++ b/shared/teams/get-options.tsx @@ -1,7 +1,7 @@ import * as Kb from '@/common-adapters' import {HeaderRightActions} from './main/header' import {useSafeNavigation} from '@/util/safe-navigation' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' const useHeaderActions = () => { const nav = useSafeNavigation() diff --git a/shared/teams/invite-by-contact/team-invite-by-contacts.native.tsx b/shared/teams/invite-by-contact/team-invite-by-contacts.native.tsx index c0afab8186de..cffc7f924255 100644 --- a/shared/teams/invite-by-contact/team-invite-by-contacts.native.tsx +++ b/shared/teams/invite-by-contact/team-invite-by-contacts.native.tsx @@ -1,11 +1,11 @@ import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import type * as T from '@/constants/types' import useContacts, {type Contact} from '../common/use-contacts.native' import {InviteByContact, type ContactRowProps} from './index.native' import {useTeamDetailsSubscribe} from '../subscriber' import {useSafeNavigation} from '@/util/safe-navigation' -import {getE164} from '@/constants/settings-phone' +import {getE164} from '@/util/phone-numbers' // Seitan invite names (labels) look like this: "[name] ([phone number])". Try // to derive E164 phone number based on seitan invite name and user's region. diff --git a/shared/teams/invite-by-email.tsx b/shared/teams/invite-by-email.tsx index eb81f145ac77..f0201964e4d5 100644 --- a/shared/teams/invite-by-email.tsx +++ b/shared/teams/invite-by-email.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import type * as T from '@/constants/types' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' import {FloatingRolePicker} from './role-picker' diff --git a/shared/teams/join-team/container.tsx b/shared/teams/join-team/container.tsx index abbdbc6f3941..7a1e2e4df322 100644 --- a/shared/teams/join-team/container.tsx +++ b/shared/teams/join-team/container.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import upperFirst from 'lodash/upperFirst' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' diff --git a/shared/teams/join-team/join-from-invite.tsx b/shared/teams/join-team/join-from-invite.tsx index fc4fa2ea5d33..f87440ceac61 100644 --- a/shared/teams/join-team/join-from-invite.tsx +++ b/shared/teams/join-team/join-from-invite.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import {Success} from './container' import {useSafeNavigation} from '@/util/safe-navigation' diff --git a/shared/teams/main/index.tsx b/shared/teams/main/index.tsx index 71ee7d1b4daa..7ef9fd136b08 100644 --- a/shared/teams/main/index.tsx +++ b/shared/teams/main/index.tsx @@ -4,7 +4,7 @@ import type * as T from '@/constants/types' import Banner from './banner' import TeamsFooter from './footer' import TeamRowNew from './team-row' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' type DeletedTeam = { teamName: string diff --git a/shared/teams/main/team-row.tsx b/shared/teams/main/team-row.tsx index a2550414088d..524f5e399dca 100644 --- a/shared/teams/main/team-row.tsx +++ b/shared/teams/main/team-row.tsx @@ -1,4 +1,4 @@ -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' import * as React from 'react' import type * as T from '@/constants/types' @@ -6,8 +6,8 @@ import TeamMenu from '../team/menu-container' import {pluralize} from '@/util/string' import {Activity} from '../common' import {useSafeNavigation} from '@/util/safe-navigation' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' type Props = { firstItem: boolean diff --git a/shared/teams/new-team/index.tsx b/shared/teams/new-team/index.tsx index 864bc75f6e6d..13d7883eaa0d 100644 --- a/shared/teams/new-team/index.tsx +++ b/shared/teams/new-team/index.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import openUrl from '@/util/open-url' diff --git a/shared/teams/new-team/wizard/add-subteam-members.tsx b/shared/teams/new-team/wizard/add-subteam-members.tsx index dc439ccc5bb5..6d9484b18811 100644 --- a/shared/teams/new-team/wizard/add-subteam-members.tsx +++ b/shared/teams/new-team/wizard/add-subteam-members.tsx @@ -1,4 +1,4 @@ -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as React from 'react' import * as T from '@/constants/types' @@ -6,7 +6,7 @@ import {ModalTitle} from '@/teams/common' import {pluralize} from '@/util/string' import {useTeamDetailsSubscribe} from '@/teams/subscriber' import {useSafeNavigation} from '@/util/safe-navigation' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' const AddSubteamMembers = () => { const nav = useSafeNavigation() diff --git a/shared/teams/new-team/wizard/create-channels.tsx b/shared/teams/new-team/wizard/create-channels.tsx index b2c22534ece2..dda466eb062e 100644 --- a/shared/teams/new-team/wizard/create-channels.tsx +++ b/shared/teams/new-team/wizard/create-channels.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import {pluralize} from '@/util/string' diff --git a/shared/teams/new-team/wizard/create-subteams.tsx b/shared/teams/new-team/wizard/create-subteams.tsx index e45764eff76c..89a3097a83d6 100644 --- a/shared/teams/new-team/wizard/create-subteams.tsx +++ b/shared/teams/new-team/wizard/create-subteams.tsx @@ -4,7 +4,7 @@ import * as T from '@/constants/types' import {pluralize} from '@/util/string' import {ModalTitle} from '@/teams/common' import {useSafeNavigation} from '@/util/safe-navigation' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' const cleanSubteamName = (name: string) => name.replace(/[^0-9a-zA-Z_]/, '') diff --git a/shared/teams/new-team/wizard/make-big-team.tsx b/shared/teams/new-team/wizard/make-big-team.tsx index 016a8edc4b71..071a0e4420f8 100644 --- a/shared/teams/new-team/wizard/make-big-team.tsx +++ b/shared/teams/new-team/wizard/make-big-team.tsx @@ -2,7 +2,7 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import {ModalTitle} from '@/teams/common' import {useSafeNavigation} from '@/util/safe-navigation' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' const MakeBigTeam = () => { const nav = useSafeNavigation() diff --git a/shared/teams/new-team/wizard/new-team-info.tsx b/shared/teams/new-team/wizard/new-team-info.tsx index cb9661e3b0ee..0bfb4183f529 100644 --- a/shared/teams/new-team/wizard/new-team-info.tsx +++ b/shared/teams/new-team/wizard/new-team-info.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import {ModalTitle} from '@/teams/common' import * as T from '@/constants/types' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import {pluralize} from '@/util/string' import {InlineDropdown} from '@/common-adapters/dropdown' import {FloatingRolePicker} from '../../role-picker' diff --git a/shared/teams/new-team/wizard/team-purpose.tsx b/shared/teams/new-team/wizard/team-purpose.tsx index 2d75aad151e8..4fa97617bb83 100644 --- a/shared/teams/new-team/wizard/team-purpose.tsx +++ b/shared/teams/new-team/wizard/team-purpose.tsx @@ -2,7 +2,7 @@ import * as Kb from '@/common-adapters' import {ModalTitle} from '@/teams/common' import * as T from '@/constants/types' import {useSafeNavigation} from '@/util/safe-navigation' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' const TeamPurpose = () => { const nav = useSafeNavigation() diff --git a/shared/teams/rename-team.tsx b/shared/teams/rename-team.tsx index 3b080205a545..bdcb775f658d 100644 --- a/shared/teams/rename-team.tsx +++ b/shared/teams/rename-team.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' type OwnProps = {teamname: string} diff --git a/shared/teams/routes.tsx b/shared/teams/routes.tsx index 5692f5f15451..3d57aef29f3a 100644 --- a/shared/teams/routes.tsx +++ b/shared/teams/routes.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import contactRestricted from '../team-building/contact-restricted.page' import teamsTeamBuilder from '../team-building/page' import teamsRootGetOptions from './get-options' diff --git a/shared/teams/subscriber.tsx b/shared/teams/subscriber.tsx index e4dd3276faef..8ea982cb3645 100644 --- a/shared/teams/subscriber.tsx +++ b/shared/teams/subscriber.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import type * as T from '@/constants/types' // NOTE: If you are in a floating box or otherwise outside the navigation diff --git a/shared/teams/team/index.tsx b/shared/teams/team/index.tsx index 0d83779ee857..9c2ad37aa0a9 100644 --- a/shared/teams/team/index.tsx +++ b/shared/teams/team/index.tsx @@ -1,5 +1,5 @@ import * as C from '@/constants' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' @@ -18,7 +18,7 @@ import { type Section, type Item, } from './rows' -import {useBotsState} from '@/constants/bots' +import {useBotsState} from '@/stores/bots' type Props = { teamID: T.Teams.TeamID diff --git a/shared/teams/team/member/add-to-channels.tsx b/shared/teams/team/member/add-to-channels.tsx index 79922967b9e1..3e3035cb798e 100644 --- a/shared/teams/team/member/add-to-channels.tsx +++ b/shared/teams/team/member/add-to-channels.tsx @@ -1,14 +1,14 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' import * as Common from '@/teams/common' import {pluralize} from '@/util/string' import {useAllChannelMetas} from '@/teams/common/channel-hooks' import {useSafeNavigation} from '@/util/safe-navigation' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type Props = { teamID: T.Teams.TeamID diff --git a/shared/teams/team/member/edit-channel.tsx b/shared/teams/team/member/edit-channel.tsx index 95679a91a100..1f1a49e5f552 100644 --- a/shared/teams/team/member/edit-channel.tsx +++ b/shared/teams/team/member/edit-channel.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as React from 'react' import type * as T from '@/constants/types' import {ModalTitle} from '@/teams/common' diff --git a/shared/teams/team/member/index.new.tsx b/shared/teams/team/member/index.new.tsx index 3ac20ce63dfa..c5bcd10e5aa9 100644 --- a/shared/teams/team/member/index.new.tsx +++ b/shared/teams/team/member/index.new.tsx @@ -1,8 +1,8 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import {useCurrentUserState} from '@/constants/current-user' -import * as Teams from '@/constants/teams' -import {useProfileState} from '@/constants/profile' +import * as Chat from '@/stores/chat2' +import {useCurrentUserState} from '@/stores/current-user' +import * as Teams from '@/stores/teams' +import {useProfileState} from '@/stores/profile' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import * as React from 'react' diff --git a/shared/teams/team/menu-container.tsx b/shared/teams/team/menu-container.tsx index 4e63c738378f..fdc3047a780a 100644 --- a/shared/teams/team/menu-container.tsx +++ b/shared/teams/team/menu-container.tsx @@ -2,7 +2,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import type * as React from 'react' import * as FS from '@/constants/fs/util' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import capitalize from 'lodash/capitalize' import * as T from '@/constants/types' import {pluralize} from '@/util/string' diff --git a/shared/teams/team/new-header.tsx b/shared/teams/team/new-header.tsx index bbdf3a4bb0aa..b5f05946e03b 100644 --- a/shared/teams/team/new-header.tsx +++ b/shared/teams/team/new-header.tsx @@ -1,15 +1,15 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import TeamMenu from './menu-container' import {pluralize} from '@/util/string' import {Activity, useActivityLevels, useTeamLinkPopup} from '../common' import type * as T from '@/constants/types' import {useSafeNavigation} from '@/util/safe-navigation' -import {useCurrentUserState} from '@/constants/current-user' -import {useTeamsState} from '@/constants/teams' +import {useCurrentUserState} from '@/stores/current-user' +import {useTeamsState} from '@/stores/teams' const AddPeopleButton = ({teamID}: {teamID: T.Teams.TeamID}) => { const startAddMembersWizard = useTeamsState(s => s.dispatch.startAddMembersWizard) diff --git a/shared/teams/team/rows/bot-row/bot.tsx b/shared/teams/team/rows/bot-row/bot.tsx index a6fb1ef29367..4724d6429e39 100644 --- a/shared/teams/team/rows/bot-row/bot.tsx +++ b/shared/teams/team/rows/bot-row/bot.tsx @@ -1,12 +1,12 @@ import * as C from '@/constants' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import BotMenu from './bot-menu' -import {useBotsState} from '@/constants/bots' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' +import {useBotsState} from '@/stores/bots' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' export type Props = { botAlias: string diff --git a/shared/teams/team/rows/channel-row/channel.tsx b/shared/teams/team/rows/channel-row/channel.tsx index 846b88deb7e1..3b8b31017ac0 100644 --- a/shared/teams/team/rows/channel-row/channel.tsx +++ b/shared/teams/team/rows/channel-row/channel.tsx @@ -4,8 +4,8 @@ import type * as T from '@/constants/types' import {Activity, useChannelParticipants} from '@/teams/common' import {pluralize} from '@/util/string' import {useSafeNavigation} from '@/util/safe-navigation' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' type ChannelRowProps = { conversationIDKey: T.Chat.ConversationIDKey diff --git a/shared/teams/team/rows/emoji-row/add.tsx b/shared/teams/team/rows/emoji-row/add.tsx index b4381e54f327..b48b58e984e4 100644 --- a/shared/teams/team/rows/emoji-row/add.tsx +++ b/shared/teams/team/rows/emoji-row/add.tsx @@ -1,8 +1,8 @@ import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import {useSafeNavigation} from '@/util/safe-navigation' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' type OwnProps = { teamID: T.Teams.TeamID diff --git a/shared/teams/team/rows/emoji-row/item.tsx b/shared/teams/team/rows/emoji-row/item.tsx index dfc547d4cafc..41c72d14f68b 100644 --- a/shared/teams/team/rows/emoji-row/item.tsx +++ b/shared/teams/team/rows/emoji-row/item.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as T from '@/constants/types' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import * as Kb from '@/common-adapters' import * as dateFns from 'date-fns' @@ -8,7 +8,7 @@ import {RPCToEmojiData} from '@/common-adapters/emoji' import EmojiMenu from './emoji-menu' import {useEmojiState} from '@/teams/emojis/use-emoji' import {useSafeNavigation} from '@/util/safe-navigation' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type OwnProps = { conversationIDKey: T.Chat.ConversationIDKey diff --git a/shared/teams/team/rows/empty-row.tsx b/shared/teams/team/rows/empty-row.tsx index b30917726587..df3f9f02eaaa 100644 --- a/shared/teams/team/rows/empty-row.tsx +++ b/shared/teams/team/rows/empty-row.tsx @@ -1,10 +1,10 @@ import type * as T from '@/constants/types' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Teams from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import {useSafeNavigation} from '@/util/safe-navigation' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type Props = { type: 'channelsEmpty' | 'channelsFew' | 'members' | 'subteams' diff --git a/shared/teams/team/rows/index.tsx b/shared/teams/team/rows/index.tsx index cef7d9413a38..ddfe2b0808fa 100644 --- a/shared/teams/team/rows/index.tsx +++ b/shared/teams/team/rows/index.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as T from '@/constants/types' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import * as React from 'react' import EmptyRow from './empty-row' @@ -14,7 +14,7 @@ import {RequestRow, InviteRow} from './invite-row' import {SubteamAddRow, SubteamInfoRow, SubteamTeamRow} from './subteam-row' import {getOrderedMemberArray, sortInvites, getOrderedBotsArray} from './helpers' import {useEmojiState} from '../../emojis/use-emoji' -import {useCurrentUserState} from '@/constants/current-user' +import {useCurrentUserState} from '@/stores/current-user' type Requests = Omit, 'firstItem' | 'teamID'> diff --git a/shared/teams/team/rows/invite-row/invite.tsx b/shared/teams/team/rows/invite-row/invite.tsx index 78b2c553a7c0..ff3f9958b352 100644 --- a/shared/teams/team/rows/invite-row/invite.tsx +++ b/shared/teams/team/rows/invite-row/invite.tsx @@ -2,8 +2,8 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import {formatPhoneNumber} from '@/util/phone-numbers' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' export type Props = { isKeybaseUser?: boolean diff --git a/shared/teams/team/rows/invite-row/request.tsx b/shared/teams/team/rows/invite-row/request.tsx index a4342c9d8e08..36be8c8e829c 100644 --- a/shared/teams/team/rows/invite-row/request.tsx +++ b/shared/teams/team/rows/invite-row/request.tsx @@ -1,8 +1,8 @@ import * as React from 'react' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Teams from '@/constants/teams' -import {useProfileState} from '@/constants/profile' +import * as Chat from '@/stores/chat2' +import * as Teams from '@/stores/teams' +import {useProfileState} from '@/stores/profile' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import {FloatingRolePicker, sendNotificationFooter} from '@/teams/role-picker' diff --git a/shared/teams/team/rows/member-row.tsx b/shared/teams/team/rows/member-row.tsx index 5c74bd5d754e..7fc8920b2a01 100644 --- a/shared/teams/team/rows/member-row.tsx +++ b/shared/teams/team/rows/member-row.tsx @@ -1,15 +1,15 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as Kb from '@/common-adapters' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as React from 'react' import type * as T from '@/constants/types' import MenuHeader from './menu-header.new' import {useSafeNavigation} from '@/util/safe-navigation' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' -import {useUsersState} from '@/constants/users' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' +import {useUsersState} from '@/stores/users' +import {useCurrentUserState} from '@/stores/current-user' export type Props = { firstItem: boolean diff --git a/shared/teams/team/rows/subteam-row/add.tsx b/shared/teams/team/rows/subteam-row/add.tsx index 6e80257e3113..58102c169fa9 100644 --- a/shared/teams/team/rows/subteam-row/add.tsx +++ b/shared/teams/team/rows/subteam-row/add.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import {useTeamsState} from '@/constants/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' diff --git a/shared/teams/team/settings-tab/default-channels.tsx b/shared/teams/team/settings-tab/default-channels.tsx index 4bd9dbf45d56..76524135f8bc 100644 --- a/shared/teams/team/settings-tab/default-channels.tsx +++ b/shared/teams/team/settings-tab/default-channels.tsx @@ -4,8 +4,8 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import type {RPCError} from '@/util/errors' import {ChannelsWidget} from '@/teams/common' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' type Props = { teamID: T.Teams.TeamID diff --git a/shared/teams/team/settings-tab/index.tsx b/shared/teams/team/settings-tab/index.tsx index 264e7690abad..5b83a2071295 100644 --- a/shared/teams/team/settings-tab/index.tsx +++ b/shared/teams/team/settings-tab/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Teams from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import * as Teams from '@/stores/teams' import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import {FloatingRolePicker} from '@/teams/role-picker' diff --git a/shared/teams/team/settings-tab/retention/index.tsx b/shared/teams/team/settings-tab/retention/index.tsx index 3fc393dd4026..0c539384b43c 100644 --- a/shared/teams/team/settings-tab/retention/index.tsx +++ b/shared/teams/team/settings-tab/retention/index.tsx @@ -1,8 +1,8 @@ import * as C from '@/constants' -import * as Chat from '@/constants/chat2' +import * as Chat from '@/stores/chat2' import * as React from 'react' -import * as Teams from '@/constants/teams' -import {useTeamsState} from '@/constants/teams' +import * as Teams from '@/stores/teams' +import {useTeamsState} from '@/stores/teams' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import type {StylesCrossPlatform} from '@/styles' diff --git a/shared/teams/team/tabs.tsx b/shared/teams/team/tabs.tsx index a27c8027232c..a2fcf15ecd24 100644 --- a/shared/teams/team/tabs.tsx +++ b/shared/teams/team/tabs.tsx @@ -1,8 +1,8 @@ import type * as T from '@/constants/types' import * as Kb from '@/common-adapters' import * as C from '@/constants' -import * as Chat from '@/constants/chat2' -import * as Teams from '@/constants/teams' +import * as Chat from '@/stores/chat2' +import * as Teams from '@/stores/teams' import type {Tab as TabType} from '@/common-adapters/tabs' type TeamTabsProps = { diff --git a/shared/teams/team/team-info.tsx b/shared/teams/team/team-info.tsx index 5c1a170c27e5..4eb6002f45b9 100644 --- a/shared/teams/team/team-info.tsx +++ b/shared/teams/team/team-info.tsx @@ -1,6 +1,6 @@ import * as C from '@/constants' import * as React from 'react' -import * as Teams from '@/constants/teams' +import * as Teams from '@/stores/teams' import * as Kb from '@/common-adapters' import type * as T from '@/constants/types' import {ModalTitle} from '../common' diff --git a/shared/tracker2/assertion.tsx b/shared/tracker2/assertion.tsx index 57a0014647c3..41a35459911b 100644 --- a/shared/tracker2/assertion.tsx +++ b/shared/tracker2/assertion.tsx @@ -1,16 +1,16 @@ import * as React from 'react' import * as C from '@/constants' -import {useConfigState} from '@/constants/config' -import {useCurrentUserState} from '@/constants/current-user' +import {useConfigState} from '@/stores/config' +import {useCurrentUserState} from '@/stores/current-user' import type * as T from '@/constants/types' import openUrl from '@/util/open-url' import * as Kb from '@/common-adapters' import {SiteIcon} from '@/profile/generic/shared' import {formatTimeForAssertionPopup} from '@/util/timestamp' import {useColorScheme} from 'react-native' -import * as Tracker from '@/constants/tracker2' -import {useTrackerState} from '@/constants/tracker2' -import {useProfileState} from '@/constants/profile' +import * as Tracker from '@/stores/tracker2' +import {useTrackerState} from '@/stores/tracker2' +import {useProfileState} from '@/stores/profile' type OwnProps = { isSuggestion?: boolean diff --git a/shared/tracker2/bio.tsx b/shared/tracker2/bio.tsx index 9113b0f41b25..e26d67af9457 100644 --- a/shared/tracker2/bio.tsx +++ b/shared/tracker2/bio.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' -import {useTrackerState} from '@/constants/tracker2' -import {useFollowerState} from '@/constants/followers' +import {useTrackerState} from '@/stores/tracker2' +import {useFollowerState} from '@/stores/followers' type OwnProps = { inTracker: boolean diff --git a/shared/tracker2/remote-container.desktop.tsx b/shared/tracker2/remote-container.desktop.tsx index 16c3549ec2ca..4433a19c09b2 100644 --- a/shared/tracker2/remote-container.desktop.tsx +++ b/shared/tracker2/remote-container.desktop.tsx @@ -1,7 +1,7 @@ // Inside tracker we use an embedded Avatar which is connected. import * as React from 'react' import * as C from '@/constants' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as R from '@/constants/remote' import * as RemoteGen from '../actions/remote-gen' import type * as T from '@/constants/types' @@ -9,11 +9,11 @@ import Tracker from './index.desktop' import type {DeserializeProps} from './remote-serializer.desktop' import KB2 from '@/util/electron.desktop' import {useAvatarState} from '@/common-adapters/avatar/store' -import {useTrackerState} from '@/constants/tracker2' -import {useUsersState} from '@/constants/users' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' -import {useDarkModeState} from '@/constants/darkmode' +import {useTrackerState} from '@/stores/tracker2' +import {useUsersState} from '@/stores/users' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' +import {useDarkModeState} from '@/stores/darkmode' const {closeWindow} = KB2.functions diff --git a/shared/tracker2/remote-proxy.desktop.tsx b/shared/tracker2/remote-proxy.desktop.tsx index f8ca55fb0c87..0cb25baaab0f 100644 --- a/shared/tracker2/remote-proxy.desktop.tsx +++ b/shared/tracker2/remote-proxy.desktop.tsx @@ -1,7 +1,7 @@ // A mirror of the remote tracker windows. import * as C from '@/constants' import {useAvatarState} from '@/common-adapters/avatar/store' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' import * as React from 'react' import useSerializeProps from '../desktop/remote/use-serialize-props.desktop' import useBrowserWindow from '../desktop/remote/use-browser-window.desktop' @@ -9,10 +9,10 @@ import {serialize, type ProxyProps} from './remote-serializer.desktop' import {intersect} from '@/util/set' import {mapFilterByKey} from '@/util/map' import {useColorScheme} from 'react-native' -import {useTrackerState} from '@/constants/tracker2' -import {useUsersState} from '@/constants/users' -import {useFollowerState} from '@/constants/followers' -import {useCurrentUserState} from '@/constants/current-user' +import {useTrackerState} from '@/stores/tracker2' +import {useUsersState} from '@/stores/users' +import {useFollowerState} from '@/stores/followers' +import {useCurrentUserState} from '@/stores/current-user' const MAX_TRACKERS = 5 const windowOpts = {hasShadow: false, height: 470, transparent: true, width: 320} diff --git a/shared/unlock-folders/device-list.desktop.tsx b/shared/unlock-folders/device-list.desktop.tsx index 9a2456b13680..ab64aeb86072 100644 --- a/shared/unlock-folders/device-list.desktop.tsx +++ b/shared/unlock-folders/device-list.desktop.tsx @@ -1,5 +1,5 @@ import * as Kb from '@/common-adapters' -import type {State as ConfigStore} from '@/constants/config' +import type {State as ConfigStore} from '@/stores/config' export type Props = { devices: ConfigStore['unlockFoldersDevices'] diff --git a/shared/unlock-folders/index.desktop.tsx b/shared/unlock-folders/index.desktop.tsx index d8cd03f4894a..af45ee616ebd 100644 --- a/shared/unlock-folders/index.desktop.tsx +++ b/shared/unlock-folders/index.desktop.tsx @@ -4,8 +4,8 @@ import DeviceList from './device-list.desktop' import DragHeader from '../desktop/remote/drag-header.desktop' import PaperKeyInput from './paper-key-input.desktop' import Success from './success.desktop' -import type * as Constants from '@/constants/unlock-folders' -import type {State as ConfigStore} from '@/constants/config' +import type * as Constants from '@/stores/unlock-folders' +import type {State as ConfigStore} from '@/stores/config' export type Props = { phase: Constants.State['phase'] diff --git a/shared/unlock-folders/remote-container.desktop.tsx b/shared/unlock-folders/remote-container.desktop.tsx index 15446563ffc6..18db5590d794 100644 --- a/shared/unlock-folders/remote-container.desktop.tsx +++ b/shared/unlock-folders/remote-container.desktop.tsx @@ -3,8 +3,8 @@ import * as React from 'react' import * as RemoteGen from '../actions/remote-gen' import UnlockFolders from './index.desktop' import type {DeserializeProps} from './remote-serializer.desktop' -import {useUnlockFoldersState as useUFState} from '@/constants/unlock-folders' -import {useDarkModeState} from '@/constants/darkmode' +import {useUnlockFoldersState as useUFState} from '@/stores/unlock-folders' +import {useDarkModeState} from '@/stores/darkmode' const RemoteContainer = (d: DeserializeProps) => { const {darkMode, devices, waiting, paperKeyError: _error} = d diff --git a/shared/unlock-folders/remote-proxy.desktop.tsx b/shared/unlock-folders/remote-proxy.desktop.tsx index 34ae7ba99c1d..ebe89bf3d4b7 100644 --- a/shared/unlock-folders/remote-proxy.desktop.tsx +++ b/shared/unlock-folders/remote-proxy.desktop.tsx @@ -4,7 +4,7 @@ import useBrowserWindow from '../desktop/remote/use-browser-window.desktop' import useSerializeProps from '../desktop/remote/use-serialize-props.desktop' import {serialize, type ProxyProps} from './remote-serializer.desktop' import {useColorScheme} from 'react-native' -import {useConfigState} from '@/constants/config' +import {useConfigState} from '@/stores/config' const windowOpts = {height: 300, width: 500} diff --git a/shared/unlock-folders/remote-serializer.desktop.tsx b/shared/unlock-folders/remote-serializer.desktop.tsx index 0370a4c3a86c..b46524dc672d 100644 --- a/shared/unlock-folders/remote-serializer.desktop.tsx +++ b/shared/unlock-folders/remote-serializer.desktop.tsx @@ -1,5 +1,5 @@ import * as T from '@/constants/types' -import type * as ConfigConstants from '@/constants/config' +import type * as ConfigConstants from '@/stores/config' import {produce} from 'immer' export type ProxyProps = { diff --git a/shared/util/phone-numbers/index.tsx b/shared/util/phone-numbers/index.tsx index 7c419b18d118..587795dbaf09 100644 --- a/shared/util/phone-numbers/index.tsx +++ b/shared/util/phone-numbers/index.tsx @@ -2,10 +2,10 @@ import * as C from '@/constants' import libphonenumber from 'google-libphonenumber' const PNF = libphonenumber.PhoneNumberFormat -export const PhoneNumberFormat = PNF +const PhoneNumberFormat = PNF -export const phoneUtil = libphonenumber.PhoneNumberUtil.getInstance() -export const ValidationResult = libphonenumber.PhoneNumberUtil.ValidationResult +const phoneUtil = libphonenumber.PhoneNumberUtil.getInstance() +const ValidationResult = libphonenumber.PhoneNumberUtil.ValidationResult const supported = phoneUtil.getSupportedRegions() export type CountryData = { @@ -188,3 +188,17 @@ export const formatPhoneNumberInternational = (rawNumber: string): string | unde return undefined } } + +// Get phone number in e.164, or null if we can't parse it. +export const getE164 = (phoneNumber: string, countryCode?: string) => { + try { + const parsed = countryCode ? phoneUtil.parse(phoneNumber, countryCode) : phoneUtil.parse(phoneNumber) + const reason = phoneUtil.isPossibleNumberWithReason(parsed) + if (reason !== ValidationResult.IS_POSSIBLE) { + return null + } + return phoneUtil.format(parsed, PhoneNumberFormat.E164) + } catch { + return null + } +} diff --git a/shared/wallets/index.tsx b/shared/wallets/index.tsx index 796c7dc738ab..9cdbccfe61df 100644 --- a/shared/wallets/index.tsx +++ b/shared/wallets/index.tsx @@ -2,8 +2,8 @@ import * as C from '@/constants' import * as React from 'react' import * as Kb from '@/common-adapters' import * as T from '@/constants/types' -import * as Wallets from '@/constants/wallets' -import {useState as useWalletsState} from '@/constants/wallets' +import * as Wallets from '@/stores/wallets' +import {useState as useWalletsState} from '@/stores/wallets' const Row = (p: {account: Wallets.Account}) => { const {account} = p diff --git a/shared/wallets/really-remove-account.tsx b/shared/wallets/really-remove-account.tsx index e72a8cf90bba..88c7ad3c6408 100644 --- a/shared/wallets/really-remove-account.tsx +++ b/shared/wallets/really-remove-account.tsx @@ -3,9 +3,9 @@ import * as Kb from '@/common-adapters' import * as T from '@/constants/types' import * as React from 'react' import WalletPopup from './wallet-popup' -import * as Wallets from '@/constants/wallets' -import {useState as useWalletsState} from '@/constants/wallets' -import {useConfigState} from '@/constants/config' +import * as Wallets from '@/stores/wallets' +import {useState as useWalletsState} from '@/stores/wallets' +import {useConfigState} from '@/stores/config' type OwnProps = {accountID: string} diff --git a/shared/wallets/remove-account.tsx b/shared/wallets/remove-account.tsx index 6088a87265c4..4847147c1825 100644 --- a/shared/wallets/remove-account.tsx +++ b/shared/wallets/remove-account.tsx @@ -1,7 +1,7 @@ import * as C from '@/constants' import * as Kb from '@/common-adapters' import WalletPopup from './wallet-popup' -import {useState as useWalletsState} from '@/constants/wallets' +import {useState as useWalletsState} from '@/stores/wallets' type OwnProps = {accountID: string} diff --git a/shared/whats-new/container.tsx b/shared/whats-new/container.tsx index 605376435ff3..5f2fbf69501d 100644 --- a/shared/whats-new/container.tsx +++ b/shared/whats-new/container.tsx @@ -1,10 +1,10 @@ import * as C from '@/constants' import openURL from '@/util/open-url' -import {currentVersion} from '@/constants/whats-new' +import {currentVersion} from '@/stores/whats-new' import {Current, Last, LastLast} from './versions' import WhatsNew from '.' -import {useWhatsNewState as useWNState} from '@/constants/whats-new' -import {useConfigState} from '@/constants/config' +import {useWhatsNewState as useWNState} from '@/stores/whats-new' +import {useConfigState} from '@/stores/config' const WhatsNewContainer = () => { const _onNavigateExternal = (url: string) => { diff --git a/shared/whats-new/icon/index.tsx b/shared/whats-new/icon/index.tsx index 05ca4fb3b455..08ee61d17832 100644 --- a/shared/whats-new/icon/index.tsx +++ b/shared/whats-new/icon/index.tsx @@ -1,10 +1,10 @@ import * as React from 'react' import * as Kb from '@/common-adapters' import type {IconStyle} from '@/common-adapters/icon' -import {keybaseFM} from '@/constants/whats-new' +import {keybaseFM} from '@/stores/whats-new' import Popup from './popup' import './icon.css' -import {useWhatsNewState as useWNState} from '@/constants/whats-new' +import {useWhatsNewState as useWNState} from '@/stores/whats-new' type OwnProps = { color?: string diff --git a/shared/whats-new/index.tsx b/shared/whats-new/index.tsx index f52f93af4ef6..f15609db9263 100644 --- a/shared/whats-new/index.tsx +++ b/shared/whats-new/index.tsx @@ -1,7 +1,7 @@ import type * as React from 'react' import * as Kb from '@/common-adapters' import type * as C from '@/constants' -import {currentVersion, lastVersion, lastLastVersion} from '@/constants/whats-new' +import {currentVersion, lastVersion, lastLastVersion} from '@/stores/whats-new' import type {VersionProps} from './versions' type Props = { diff --git a/shared/whats-new/versions.tsx b/shared/whats-new/versions.tsx index cd3763ab6b12..05433c1fa130 100644 --- a/shared/whats-new/versions.tsx +++ b/shared/whats-new/versions.tsx @@ -2,7 +2,7 @@ import * as C from '@/constants' import {encryptTab} from '@/constants/crypto/util' import type * as React from 'react' import * as Kb from '@/common-adapters' -import {keybaseFM} from '@/constants/whats-new' +import {keybaseFM} from '@/stores/whats-new' import NewFeatureRow from './new-feature-row' import {settingsCryptoTab, settingsDisplayTab} from '@/constants/settings/util'