Refactor TimeDisplay Component to Integrate ElipsisText and Improve Layout
- Added ElipsisText component for better text handling within TimeDisplay. - Updated Flex container styles to ensure proper alignment and responsiveness. - Enhanced conditional rendering for date and time display, improving overall user experience.
This commit is contained in:
parent
672e3c59ac
commit
f029974473
@ -7,6 +7,7 @@ import {
|
|||||||
DEFAULT_DATE_TIME_FORMAT,
|
DEFAULT_DATE_TIME_FORMAT,
|
||||||
splitDateTimeFormat
|
splitDateTimeFormat
|
||||||
} from '../../../database/Settings'
|
} from '../../../database/Settings'
|
||||||
|
import ElipsisText from './ElipsisText'
|
||||||
|
|
||||||
const { Text } = Typography
|
const { Text } = Typography
|
||||||
|
|
||||||
@ -118,9 +119,18 @@ const TimeDisplay = ({
|
|||||||
: ''
|
: ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex align={'center'} gap={'small'} wrap>
|
<Flex
|
||||||
{showDate || showTime ? <Text type={type}>{formattedDate}</Text> : null}
|
align={'center'}
|
||||||
{showSince ? <Tag style={{ margin: 0 }}>{timeAgo}</Tag> : null}
|
gap={'small'}
|
||||||
|
wrap
|
||||||
|
style={{ minWidth: 0, maxWidth: '100%' }}
|
||||||
|
>
|
||||||
|
{showDate || showTime ? (
|
||||||
|
<ElipsisText type={type}>{formattedDate}</ElipsisText>
|
||||||
|
) : null}
|
||||||
|
{showSince ? (
|
||||||
|
<Tag style={{ margin: 0, flexShrink: 0 }}>{timeAgo}</Tag>
|
||||||
|
) : null}
|
||||||
</Flex>
|
</Flex>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user