Wrap HStack in some places

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2022-09-05 15:18:15 +02:00
parent 38012ddff4
commit d074553e21
3 changed files with 6 additions and 3 deletions

View file

@ -54,7 +54,7 @@ const PollFooter: React.FC<IPollFooter> = ({ poll, showResults, selected }): JSX
</Button>
)}
<HStack space={1.5} alignItems='center'>
<HStack space={1.5} alignItems='center' wrap>
{poll.pleroma.get('non_anonymous') && (
<>
<Tooltip text={intl.formatMessage(messages.nonAnonymous)}>

View file

@ -42,11 +42,13 @@ interface IHStack {
grow?: boolean,
/** Extra CSS styles for the <div> */
style?: React.CSSProperties
/** Whether to let the flexbox wrap onto multiple lines. */
wrap?: boolean,
}
/** Horizontal row of child elements. */
const HStack = forwardRef<HTMLDivElement, IHStack>((props, ref) => {
const { space, alignItems, grow, justifyContent, className, ...filteredProps } = props;
const { space, alignItems, grow, justifyContent, wrap, className, ...filteredProps } = props;
return (
<div
@ -60,6 +62,7 @@ const HStack = forwardRef<HTMLDivElement, IHStack>((props, ref) => {
// @ts-ignore
[spaces[space]]: typeof space !== 'undefined',
'flex-grow': grow,
'flex-wrap': wrap,
}, className)}
/>
);

View file

@ -99,7 +99,7 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
{quote}
<HStack justifyContent='between' alignItems='center' className='py-2'>
<HStack justifyContent='between' alignItems='center' className='py-2' wrap>
<StatusInteractionBar status={actualStatus} />
<HStack space={1} alignItems='center'>