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