mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 23:49:15 +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 {
|
.inlineElements {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
&.inner {
|
&.inner {
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
@@ -213,6 +212,11 @@ $inner-padding: 1rem;
|
|||||||
&.apart {
|
&.apart {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.wrap {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
row-gap: 0.5rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes animloader {
|
@keyframes animloader {
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export function BlockQuote({ children }: { children: ReactNode }) {
|
|||||||
return <blockquote className={style.blockquote}>{children}</blockquote>;
|
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>;
|
return <div className={cx([style.fieldError, className])}>{children}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,16 +131,25 @@ type InlineProps<C extends AllowedInlineTags> = {
|
|||||||
as?: C;
|
as?: C;
|
||||||
relation?: 'inner' | 'component' | 'section';
|
relation?: 'inner' | 'component' | 'section';
|
||||||
align?: 'start' | 'end' | 'apart';
|
align?: 'start' | 'end' | 'apart';
|
||||||
className?: string;
|
wrap?: 'wrap' | 'nowrap';
|
||||||
};
|
} & Omit<React.JSX.IntrinsicElements[C], 'align'>;
|
||||||
|
|
||||||
export function InlineElements<C extends AllowedInlineTags = 'div'>({
|
export function InlineElements<C extends AllowedInlineTags = 'div'>({
|
||||||
children,
|
children,
|
||||||
as,
|
as,
|
||||||
relation = 'component',
|
relation = 'component',
|
||||||
align = 'start',
|
align = 'start',
|
||||||
|
wrap = 'nowrap',
|
||||||
className,
|
className,
|
||||||
|
...elementProps
|
||||||
}: PropsWithChildren<InlineProps<C>>) {
|
}: PropsWithChildren<InlineProps<C>>) {
|
||||||
const Element = as ?? 'div';
|
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);
|
const handleClick = (address: string) => openLink(address);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Panel.InlineElements>
|
<Panel.InlineElements wrap='wrap'>
|
||||||
{data.networkInterfaces.map((nif) => {
|
{data.networkInterfaces.map((nif) => {
|
||||||
// interfaces outside localhost wont have access
|
// interfaces outside localhost wont have access
|
||||||
if (nif.name === 'localhost' && !isLocalhost) return null;
|
if (nif.name === 'localhost' && !isLocalhost) return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user