Skip to content

Commit

Permalink
Description field always visible
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustem Mussabekov committed Mar 10, 2025
1 parent be57f41 commit 444a40b
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions src/co/bookmarks/edit/form/title.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React, { useState, useCallback, useRef } from 'react'
import { useSelector } from 'react-redux'
import { makeViewHide } from '~data/selectors/bookmarks'
import React, { useState, useCallback } from 'react'
import t from '~t'
import { Text } from '~co/common/form'

Expand All @@ -22,9 +20,6 @@ export default function BookmarkEditFormTitle({ autoFocus, item: { title, excerp
}))
}, [setMaxRows])

const getViewHide = useRef(makeViewHide()).current
const viewHide = useSelector(state=>getViewHide(state, 0))

return (
<div>
<Text
Expand All @@ -44,25 +39,23 @@ export default function BookmarkEditFormTitle({ autoFocus, item: { title, excerp
onFocus={onFocusField}
onBlur={onCommit} />

{viewHide.includes('excerpt') ? null : (
<Text
variant='less'
font='secondary'
autoSize={true}
type='text'
autoComplete='off'
spellCheck='false'
autoFocus={autoFocus === 'excerpt'}
name='excerpt'
maxLength='10000'
multiline={true}
value={excerpt}
placeholder={`${t.s('add')} ${t.s('description').toLowerCase()}`}
maxRows={maxRows.excerpt}
onChange={onChangeField}
onFocus={onFocusField}
onBlur={onCommit} />
)}
<Text
variant='less'
font='secondary'
autoSize={true}
type='text'
autoComplete='off'
spellCheck='false'
autoFocus={autoFocus === 'excerpt'}
name='excerpt'
maxLength='10000'
multiline={true}
value={excerpt}
placeholder={`${t.s('add')} ${t.s('description').toLowerCase()}`}
maxRows={maxRows.excerpt}
onChange={onChangeField}
onFocus={onFocusField}
onBlur={onCommit} />
</div>
)
}

1 comment on commit 444a40b

@Enlight432
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I didn't understand what changed. If possible, please give a short, clear explanation. Thanks.

Please sign in to comment.