mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 17:33:55 +00:00
fix: inline elements should not wrap by default
This commit is contained in:
committed by
Carlos Valente
parent
6e5805977a
commit
525999440a
@@ -196,7 +196,6 @@ $inner-padding: 1rem;
|
||||
.inlineElements {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
&.inner {
|
||||
gap: 0.5rem;
|
||||
@@ -213,6 +212,11 @@ $inner-padding: 1rem;
|
||||
&.apart {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
&.wrap {
|
||||
flex-wrap: wrap;
|
||||
row-gap: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes animloader {
|
||||
|
||||
@@ -107,7 +107,7 @@ export function BlockQuote({ children }: { children: ReactNode }) {
|
||||
return <blockquote className={style.blockquote}>{children}</blockquote>;
|
||||
}
|
||||
|
||||
export function Error({ children, className }: { children: ReactNode } & React.JSX.IntrinsicElements['div']) {
|
||||
export function Error({ children, className }: PropsWithChildren & React.JSX.IntrinsicElements['div']) {
|
||||
return <div className={cx([style.fieldError, className])}>{children}</div>;
|
||||
}
|
||||
|
||||
@@ -131,16 +131,25 @@ type InlineProps<C extends AllowedInlineTags> = {
|
||||
as?: C;
|
||||
relation?: 'inner' | 'component' | 'section';
|
||||
align?: 'start' | 'end' | 'apart';
|
||||
className?: string;
|
||||
};
|
||||
wrap?: 'wrap' | 'nowrap';
|
||||
} & Omit<React.JSX.IntrinsicElements[C], 'align'>;
|
||||
|
||||
export function InlineElements<C extends AllowedInlineTags = 'div'>({
|
||||
children,
|
||||
as,
|
||||
relation = 'component',
|
||||
align = 'start',
|
||||
wrap = 'nowrap',
|
||||
className,
|
||||
...elementProps
|
||||
}: PropsWithChildren<InlineProps<C>>) {
|
||||
const Element = as ?? 'div';
|
||||
return <Element className={cx([style.inlineElements, style[relation], style[align], className])}>{children}</Element>;
|
||||
return (
|
||||
<Element
|
||||
{...(elementProps as HTMLAttributes<HTMLElement>)}
|
||||
className={cx([style.inlineElements, style[relation], style[align], style[wrap], className])}
|
||||
>
|
||||
{children}
|
||||
</Element>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export default function InfoNif() {
|
||||
const handleClick = (address: string) => openLink(address);
|
||||
|
||||
return (
|
||||
<Panel.InlineElements>
|
||||
<Panel.InlineElements wrap='wrap'>
|
||||
{data.networkInterfaces.map((nif) => {
|
||||
// interfaces outside localhost wont have access
|
||||
if (nif.name === 'localhost' && !isLocalhost) return null;
|
||||
|
||||
Reference in New Issue
Block a user