Skip to content

Commit

Permalink
Merge pull request #244 from oaknational/feat-updates-to-unit-list-it…
Browse files Browse the repository at this point in the history
…em-and-container

Feat updates to unit list item and container
  • Loading branch information
JBR90 authored Jul 25, 2024
2 parents bba0834 + db16865 commit e451385
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import React, { ComponentPropsWithoutRef, ElementType } from "react";
import React, {
ComponentPropsWithoutRef,
ElementType,
MutableRefObject,
} from "react";
import styled, { css } from "styled-components";

import { OakFlex, OakBox, OakP, OakHeading, OakSpan } from "@/components/atoms";
Expand Down Expand Up @@ -80,6 +84,7 @@ export type OakUnitListItemProps<C extends ElementType> = {
lessonCount: number | null;
isLegacy: boolean;
href: string;
firstItemRef?: MutableRefObject<HTMLAnchorElement | null> | null | undefined;
} & ComponentPropsWithoutRef<C>;

/**
Expand All @@ -100,6 +105,7 @@ export const OakUnitListItem = <C extends ElementType = "a">(
onClick,
index,
isLegacy,
firstItemRef,
...rest
} = props;

Expand All @@ -115,6 +121,7 @@ export const OakUnitListItem = <C extends ElementType = "a">(
$disabled={disabledOrUnavailable}
href={disabledOrUnavailable ? undefined : href}
onClick={disabledOrUnavailable ? undefined : onClick}
ref={firstItemRef}
{...rest}
>
<StyledOakIndexBox
Expand Down

0 comments on commit e451385

Please sign in to comment.