Skip to content

Commit

Permalink
Zero left padding on first tab button
Browse files Browse the repository at this point in the history
  • Loading branch information
mpbrown committed Oct 3, 2024
1 parent 41c2c05 commit 3b1ad2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,21 @@ interface SectionTabButtonProps {
setTabSectionState: React.Dispatch<
React.SetStateAction<Record<string, string>>
>;
index: number;
}

const SectionTabButton = ({
selected,
parentSection,
tabSection,
setTabSectionState,
index,
}: SectionTabButtonProps) => {
return (
<div
className={`usa-nav__secondary-item padding-right-1 ${
selected ? "usa-current" : ""
}`}
} ${index === 0 ? "padding-left-0" : ""}`}
key={`${parentSection.slug}-${tabSection.slug}-tabpanel-item`}
>
<button
Expand Down Expand Up @@ -463,7 +465,7 @@ const CsvSchemaDocumentation: React.FC<CsvSchemaDocumentationProps> = ({
aria-owns={tabIds}
className="usa-nav__secondary-links prime-nav csv-section-tablist"
>
{section.tabs.map((tabSection) => {
{section.tabs.map((tabSection, index) => {
return (
<SectionTabButton
selected={
Expand All @@ -473,6 +475,7 @@ const CsvSchemaDocumentation: React.FC<CsvSchemaDocumentationProps> = ({
parentSection={section}
tabSection={tabSection}
setTabSectionState={setTabSectionState}
index={index}
/>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4838,7 +4838,7 @@ exports[`CsvSchemaDocumentation tests CsvSchemaDocumentation matches snapshot 1`
role="tablist"
>
<div
class="usa-nav__secondary-item padding-right-1 usa-current"
class="usa-nav__secondary-item padding-right-1 usa-current padding-left-0"
>
<button
aria-selected="true"
Expand All @@ -4850,7 +4850,7 @@ exports[`CsvSchemaDocumentation tests CsvSchemaDocumentation matches snapshot 1`
</button>
</div>
<div
class="usa-nav__secondary-item padding-right-1 "
class="usa-nav__secondary-item padding-right-1 "
>
<button
aria-selected="false"
Expand Down

0 comments on commit 3b1ad2a

Please sign in to comment.