0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

style(experience): remove the margin of dividers without a label (#4747)

This commit is contained in:
Xiao Yijun 2023-10-26 10:21:30 +08:00 committed by GitHub
parent fdba3ae742
commit dce2fd876d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View file

@ -11,12 +11,14 @@
height: 1px; height: 1px;
background: var(--color-line-divider); background: var(--color-line-divider);
&:first-child { &.withLabel {
margin-right: _.unit(4); &:first-child {
} margin-right: _.unit(4);
}
&:last-child { &:last-child {
margin-left: _.unit(4); margin-left: _.unit(4);
}
} }
} }
} }

View file

@ -11,13 +11,15 @@ type Props = {
}; };
const Divider = ({ className, label }: Props) => { const Divider = ({ className, label }: Props) => {
const lineStyle = classNames(styles.line, label && styles.withLabel);
return ( return (
<div className={classNames(styles.divider, className)}> <div className={classNames(styles.divider, className)}>
<i className={styles.line} /> <i className={lineStyle} />
{label && ( {label && (
<> <>
<DynamicT forKey={label} /> <DynamicT forKey={label} />
<i className={styles.line} /> <i className={lineStyle} />
</> </>
)} )}
</div> </div>