inherit outline tags of parent post
This commit is contained in:
@@ -58,6 +58,7 @@ export const ComposePost = observer(function ComposePost({
|
||||
onPost,
|
||||
quote: initQuote,
|
||||
mention: initMention,
|
||||
outlineTags,
|
||||
}: Props) {
|
||||
const {track} = useAnalytics()
|
||||
const pal = usePalette('default')
|
||||
@@ -89,7 +90,7 @@ export const ComposePost = observer(function ComposePost({
|
||||
const [labels, setLabels] = useState<string[]>([])
|
||||
const [suggestedLinks, setSuggestedLinks] = useState<Set<string>>(new Set())
|
||||
const gallery = useMemo(() => new GalleryModel(store), [store])
|
||||
const [tags, setTags] = useState<string[]>([])
|
||||
const [tags, setTags] = useState<string[]>(outlineTags || [])
|
||||
const onClose = useCallback(() => {
|
||||
store.shell.closeComposer()
|
||||
}, [store])
|
||||
@@ -455,7 +456,7 @@ export const ComposePost = observer(function ComposePost({
|
||||
paddingHorizontal: 15,
|
||||
},
|
||||
]}>
|
||||
<TagInput onChangeTags={onChangeTags} />
|
||||
<TagInput initialTags={tags} onChangeTags={onChangeTags} />
|
||||
</View>
|
||||
|
||||
<View style={[pal.border, styles.bottomBar]}>
|
||||
|
||||
@@ -27,9 +27,11 @@ import {uniq} from 'lib/strings/helpers'
|
||||
|
||||
export function TagInput({
|
||||
max = 8,
|
||||
initialTags = [],
|
||||
onChangeTags,
|
||||
}: {
|
||||
max?: number
|
||||
initialTags?: string[]
|
||||
onChangeTags: (tags: string[]) => void
|
||||
}) {
|
||||
const store = useStores()
|
||||
@@ -38,7 +40,7 @@ export function TagInput({
|
||||
const input = React.useRef<TextInput>(null)
|
||||
|
||||
const [value, setValue] = React.useState('')
|
||||
const [tags, setTags] = React.useState<string[]>([])
|
||||
const [tags, setTags] = React.useState<string[]>(initialTags)
|
||||
const [suggestions, setSuggestions] = React.useState<string[]>([])
|
||||
const [isInitialLoad, setIsInitialLoad] = React.useState(true)
|
||||
|
||||
|
||||
@@ -27,9 +27,11 @@ import {uniq} from 'lib/strings/helpers'
|
||||
|
||||
export function TagInput({
|
||||
max = 8,
|
||||
initialTags = [],
|
||||
onChangeTags,
|
||||
}: {
|
||||
max?: number
|
||||
initialTags?: string[]
|
||||
onChangeTags: (tags: string[]) => void
|
||||
}) {
|
||||
const store = useStores()
|
||||
@@ -43,7 +45,7 @@ export function TagInput({
|
||||
const containerRef = React.useRef<HTMLDivElement>(null)
|
||||
|
||||
const [value, setValue] = React.useState('')
|
||||
const [tags, setTags] = React.useState<string[]>([])
|
||||
const [tags, setTags] = React.useState<string[]>(initialTags)
|
||||
const [dropdownIsOpen, setDropdownIsOpen] = React.useState(false)
|
||||
const [dropdownItems, setDropdownItems] = React.useState<
|
||||
{value: string; label: string}[]
|
||||
|
||||
Reference in New Issue
Block a user