tooot/src/screens/Compose/utils/initialState.ts

48 lines
913 B
TypeScript
Raw Normal View History

2021-01-14 22:53:01 +01:00
import { createRef } from 'react'
import { ComposeState } from './types'
2020-12-30 00:56:25 +01:00
2021-02-07 00:39:11 +01:00
const composeInitialState: Omit<ComposeState, 'timestamp'> = {
dirty: false,
2021-01-14 22:53:01 +01:00
posting: false,
2020-12-30 00:56:25 +01:00
spoiler: {
active: false,
count: 0,
raw: '',
formatted: undefined,
selection: { start: 0 }
2020-12-30 00:56:25 +01:00
},
text: {
count: 0,
raw: '',
formatted: undefined,
selection: { start: 0 }
2020-12-30 00:56:25 +01:00
},
tag: undefined,
poll: {
active: false,
total: 2,
options: {
'0': undefined,
'1': undefined,
'2': undefined,
'3': undefined
},
multiple: false,
expire: '86400'
},
attachments: {
sensitive: false,
uploads: []
},
2020-12-30 00:56:25 +01:00
visibility: 'public',
visibilityLock: false,
replyToStatus: undefined,
textInputFocus: {
current: 'text',
2022-09-19 22:01:13 +02:00
refs: { text: createRef() },
isFocused: { text: createRef(), spoiler: createRef() }
2020-12-30 00:56:25 +01:00
}
}
export default composeInitialState