move state to colo with composer
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
export * from './api'
|
||||
export * from './hooks'
|
||||
export * from './schema'
|
||||
@@ -76,13 +76,6 @@ import {cleanError} from '#/lib/strings/errors'
|
||||
import {colors} from '#/lib/styles'
|
||||
import {logger} from '#/logger'
|
||||
import {useDialogStateControlContext} from '#/state/dialogs'
|
||||
import {
|
||||
type DraftSummary,
|
||||
draftToComposerPosts,
|
||||
threadgateToUISettings,
|
||||
useLoadDraft,
|
||||
useSaveDraft,
|
||||
} from '#/state/drafts'
|
||||
import {emitPostCreated} from '#/state/events'
|
||||
import {
|
||||
type ComposerImage,
|
||||
@@ -139,6 +132,13 @@ import {Text as NewText} from '#/components/Typography'
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {IS_ANDROID, IS_IOS, IS_NATIVE, IS_WEB} from '#/env'
|
||||
import {BottomSheetPortalProvider} from '../../../../modules/bottom-sheet'
|
||||
import {
|
||||
draftToComposerPosts,
|
||||
threadgateToUISettings,
|
||||
useLoadDraft,
|
||||
useSaveDraft,
|
||||
} from './drafts/state/hooks'
|
||||
import {type DraftSummary} from './drafts/state/schema'
|
||||
import {PostLanguageSelect} from './select-language/PostLanguageSelect'
|
||||
import {
|
||||
type AssetType,
|
||||
|
||||
@@ -5,12 +5,6 @@ import {type AppBskyEmbedImages} from '@atproto/api'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {
|
||||
type DraftPostDisplay,
|
||||
type DraftSummary,
|
||||
type LocalMediaDisplay,
|
||||
} from '#/state/drafts'
|
||||
import * as storage from '#/state/drafts/storage'
|
||||
import {useCurrentAccountProfile} from '#/state/queries/useCurrentAccountProfile'
|
||||
import {useSession} from '#/state/session'
|
||||
import {TimeElapsed} from '#/view/com/util/TimeElapsed'
|
||||
@@ -22,6 +16,12 @@ import {AutoSizedImage} from '#/components/images/AutoSizedImage'
|
||||
import {ImageLayoutGrid} from '#/components/images/ImageLayoutGrid'
|
||||
import * as Prompt from '#/components/Prompt'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {
|
||||
type DraftPostDisplay,
|
||||
type DraftSummary,
|
||||
type LocalMediaDisplay,
|
||||
} from './state/schema'
|
||||
import * as storage from './state/storage'
|
||||
|
||||
export function DraftItem({
|
||||
draft,
|
||||
@@ -193,9 +193,17 @@ function DraftPostRow({
|
||||
|
||||
{/* Post text - full, not truncated */}
|
||||
{post.text ? (
|
||||
<Text style={[a.text_md, t.atoms.text]}>{post.text}</Text>
|
||||
<Text style={[a.text_md, a.leading_snug, t.atoms.text]}>
|
||||
{post.text}
|
||||
</Text>
|
||||
) : (
|
||||
<Text style={[a.text_md, t.atoms.text_contrast_medium, a.italic]}>
|
||||
<Text
|
||||
style={[
|
||||
a.text_md,
|
||||
a.leading_snug,
|
||||
t.atoms.text_contrast_medium,
|
||||
a.italic,
|
||||
]}>
|
||||
<Trans>(No text)</Trans>
|
||||
</Text>
|
||||
)}
|
||||
@@ -267,7 +275,7 @@ function DraftMediaPreview({post}: {post: DraftPostDisplay}) {
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={[a.pt_xs, a.pointer_events_none]}>
|
||||
<View style={[a.pt_sm, a.pointer_events_none]}>
|
||||
{/* Images - use real embed components */}
|
||||
{viewImages.length === 1 && (
|
||||
<AutoSizedImage image={viewImages[0]} hideBadge />
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {type DraftSummary, useSaveDraft} from '#/state/drafts'
|
||||
import {atoms as a} from '#/alf'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
import * as Dialog from '#/components/Dialog'
|
||||
import * as Prompt from '#/components/Prompt'
|
||||
import {DraftsListDialog} from './DraftsListDialog'
|
||||
import {useSaveDraft} from './state/hooks'
|
||||
import {type DraftSummary} from './state/schema'
|
||||
|
||||
export function DraftsButton({
|
||||
onSelectDraft,
|
||||
|
||||
@@ -4,14 +4,15 @@ import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {type DraftSummary, useDeleteDraft, useDrafts} from '#/state/drafts'
|
||||
import {EmptyState} from '#/view/com/util/EmptyState'
|
||||
import {atoms as a, useTheme, web} from '#/alf'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
import * as Dialog from '#/components/Dialog'
|
||||
import {PageX_Stroke2_Corner0_Rounded_Large as PageXIcon} from '#/components/icons/PageX'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import {EmptyState} from '../../util/EmptyState'
|
||||
import {DraftItem} from './DraftItem'
|
||||
import {useDeleteDraft, useDrafts} from './state/hooks'
|
||||
import {type DraftSummary} from './state/schema'
|
||||
|
||||
export function DraftsListDialog({
|
||||
control,
|
||||
|
||||
Reference in New Issue
Block a user