Swap order of Keep editing and Discard buttons (#11606)
This commit is contained in:
@@ -1318,11 +1318,6 @@
|
|||||||
"count": 1
|
"count": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"src/view/com/composer/drafts/DraftsButton.tsx": {
|
|
||||||
"typescript/no-misused-promises": {
|
|
||||||
"count": 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"src/view/com/composer/drafts/state/queries.ts": {
|
"src/view/com/composer/drafts/state/queries.ts": {
|
||||||
"typescript/no-explicit-any": {
|
"typescript/no-explicit-any": {
|
||||||
"count": 2
|
"count": 2
|
||||||
|
|||||||
@@ -1555,12 +1555,12 @@ export const ComposePost = ({
|
|||||||
color="primary"
|
color="primary"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
<Prompt.Cancel cta={l`Keep editing`} />
|
||||||
<Prompt.Action
|
<Prompt.Action
|
||||||
cta={l`Discard`}
|
cta={l`Discard`}
|
||||||
onPress={handleDiscard}
|
onPress={handleDiscard}
|
||||||
color="negative_subtle"
|
color="negative_subtle"
|
||||||
/>
|
/>
|
||||||
<Prompt.Cancel cta={l`Keep editing`} />
|
|
||||||
</Prompt.Actions>
|
</Prompt.Actions>
|
||||||
</Prompt.Outer>
|
</Prompt.Outer>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import {msg} from '@lingui/core/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {Trans} from '@lingui/react/macro'
|
|
||||||
|
|
||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
import {Button, ButtonText} from '#/components/Button'
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
@@ -30,7 +28,7 @@ export function DraftsButton({
|
|||||||
canSaveDraft: boolean
|
canSaveDraft: boolean
|
||||||
textLength: number
|
textLength: number
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const draftsDialogControl = Dialog.useDialogControl()
|
const draftsDialogControl = Dialog.useDialogControl()
|
||||||
const savePromptControl = Prompt.usePromptControl()
|
const savePromptControl = Prompt.usePromptControl()
|
||||||
@@ -67,7 +65,7 @@ export function DraftsButton({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Drafts`)}
|
label={l`Drafts`}
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="primary"
|
color="primary"
|
||||||
shape="default"
|
shape="default"
|
||||||
@@ -79,12 +77,10 @@ export function DraftsButton({
|
|||||||
<Trans>Drafts</Trans>
|
<Trans>Drafts</Trans>
|
||||||
</ButtonText>
|
</ButtonText>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<DraftsListDialog
|
<DraftsListDialog
|
||||||
control={draftsDialogControl}
|
control={draftsDialogControl}
|
||||||
onSelectDraft={onSelectDraft}
|
onSelectDraft={onSelectDraft}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Prompt.Outer control={savePromptControl}>
|
<Prompt.Outer control={savePromptControl}>
|
||||||
<Prompt.Content>
|
<Prompt.Content>
|
||||||
<Prompt.TitleText>
|
<Prompt.TitleText>
|
||||||
@@ -122,17 +118,17 @@ export function DraftsButton({
|
|||||||
<Prompt.Actions>
|
<Prompt.Actions>
|
||||||
{canSaveDraft && (
|
{canSaveDraft && (
|
||||||
<Prompt.Action
|
<Prompt.Action
|
||||||
cta={isEditingDraft ? _(msg`Save changes`) : _(msg`Save draft`)}
|
cta={isEditingDraft ? l`Save changes` : l`Save draft`}
|
||||||
onPress={handleSaveAndOpen}
|
onPress={() => void handleSaveAndOpen()}
|
||||||
color="primary"
|
color="primary"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
<Prompt.Cancel cta={l`Keep editing`} />
|
||||||
<Prompt.Action
|
<Prompt.Action
|
||||||
cta={_(msg`Discard`)}
|
cta={l`Discard`}
|
||||||
onPress={handleDiscardAndOpen}
|
onPress={handleDiscardAndOpen}
|
||||||
color="negative_subtle"
|
color="negative_subtle"
|
||||||
/>
|
/>
|
||||||
<Prompt.Cancel cta={_(msg`Keep editing`)} />
|
|
||||||
</Prompt.Actions>
|
</Prompt.Actions>
|
||||||
</Prompt.Outer>
|
</Prompt.Outer>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user