mirror of
https://github.com/minibits-cash/minibits_wallet.git
synced 2026-10-06 03:38:24 +00:00
add animation to collapsibletext
This commit is contained in:
@@ -4,6 +4,7 @@ import { Text, TextProps } from "./Text"
|
||||
import { translate } from "../i18n"
|
||||
import { useThemeColor } from "../theme"
|
||||
import { Icon } from "./Icon"
|
||||
import { LayoutAnimation } from "react-native"
|
||||
|
||||
interface CollapsibleProps {
|
||||
summary?: string
|
||||
@@ -17,7 +18,10 @@ const maxLines = 50
|
||||
|
||||
export const CollapsibleText = (props: CollapsibleProps) => {
|
||||
const [collapsed, setCollapsed] = useState(props?.collapsed ?? false)
|
||||
const toggleCollapse = () => setCollapsed(!collapsed)
|
||||
const toggleCollapse = () => {
|
||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
|
||||
setCollapsed(!collapsed)
|
||||
}
|
||||
const textDim = useThemeColor('textDim')
|
||||
|
||||
let summary = props?.summary
|
||||
|
||||
@@ -70,7 +70,7 @@ function DescriptionCard(props: {info: GetInfoResponse}) {
|
||||
<CollapsibleText
|
||||
collapsed={true}
|
||||
summary={props.info.description}
|
||||
text={props.info?.description_long ?? ''}
|
||||
text={props.info?.description_long || ''}
|
||||
/>
|
||||
) : (
|
||||
<Text
|
||||
|
||||
Reference in New Issue
Block a user