chore: removes pseudo element from mobile doc tabs

This commit is contained in:
Jacob Fletcher
2023-10-04 16:47:13 -04:00
parent c3abaf5f1d
commit 10bd20904a
2 changed files with 20 additions and 22 deletions

View File

@@ -1,6 +1,8 @@
@import '../../../../scss/styles.scss'; @import '../../../../scss/styles.scss';
.doc-tabs { .doc-tabs {
display: flex;
&__tabs { &__tabs {
display: flex; display: flex;
gap: calc(var(--base) / 2); gap: calc(var(--base) / 2);
@@ -18,20 +20,14 @@
&__tabs { &__tabs {
padding: 0; padding: 0;
margin-left: var(--gutter-h); margin-left: var(--gutter-h);
& > *:last-child {
// CSS hack, give the illusion of right margin within the overflowing container
// margin-right, padding-right, etc are tricky within overflowing flex-boxes
&::after {
content: '';
padding-right: var(--gutter-h);
height: 1px;
}
}
} }
} }
@include small-break { @include small-break {
&__tabs-container {
margin-right: var(--gutter-h);
}
&__tabs { &__tabs {
gap: var(--gutter-h); gap: var(--gutter-h);
} }

View File

@@ -17,20 +17,22 @@ export const DocumentTabs: React.FC<DocumentTabProps> = (props) => {
if ((collection && isEditing) || global) { if ((collection && isEditing) || global) {
return ( return (
<div className={baseClass}> <div className={baseClass}>
<ul className={`${baseClass}__tabs`}> <div className={`${baseClass}__tabs-container`}>
{tabs?.map((Tab, index) => { <ul className={`${baseClass}__tabs`}>
return <DocumentTab {...props} {...Tab} key={`tab-${index}`} /> {tabs?.map((Tab, index) => {
})} return <DocumentTab {...props} {...Tab} key={`tab-${index}`} />
{customViews?.map((CustomView, index) => { })}
const { Tab, path } = CustomView {customViews?.map((CustomView, index) => {
const { Tab, path } = CustomView
if (typeof Tab === 'function') { if (typeof Tab === 'function') {
return <Tab path={path} {...props} key={`tab-custom-${index}`} /> return <Tab path={path} {...props} key={`tab-custom-${index}`} />
} }
return <DocumentTab {...props} {...Tab} key={`tab-custom-${index}`} /> return <DocumentTab {...props} {...Tab} key={`tab-custom-${index}`} />
})} })}
</ul> </ul>
</div>
</div> </div>
) )
} }