Skip to content

Commit

Permalink
Merge pull request #2604 from NDLANO/file-header-h2
Browse files Browse the repository at this point in the history
Make files header go away
  • Loading branch information
gunnarvelle authored Jan 3, 2025
2 parents 05b33be + 0531bfe commit 9f88ae8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/ndla-ui/src/FileList/FileList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const DifferentFiles: StoryObj<typeof File> = {
),
};

export const NoHeader: StoryObj<typeof File> = {
export const JustTheFileItems: StoryObj<typeof File> = {
render: () => (
<ul>
<FileListItem>
Expand All @@ -108,7 +108,7 @@ export const NoHeader: StoryObj<typeof File> = {
),
};

export const FilesWithButtons: StoryObj<typeof File> = {
export const FileItemsWithButtons: StoryObj<typeof File> = {
render: () => (
<ul>
<FileListItem>
Expand Down
12 changes: 3 additions & 9 deletions packages/ndla-ui/src/FileList/FileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
*/

import { type ComponentPropsWithoutRef } from "react";
import { useTranslation } from "react-i18next";
import { ark } from "@ark-ui/react";
import { Heading } from "@ndla/primitives";
import { styled } from "@ndla/styled-system/jsx";

interface Props extends ComponentPropsWithoutRef<"div"> {}
interface Props extends ComponentPropsWithoutRef<"ul"> {}

export const FileListWrapper = styled("div", {
export const FileListWrapper = styled("ul", {
base: {
display: "flex",
flexDirection: "column",
Expand Down Expand Up @@ -42,13 +40,9 @@ export const FileListItem = styled(
);

export const FileListEmbed = ({ children, ...rest }: Props) => {
const { t } = useTranslation();
return (
<FileListWrapper {...rest} data-embed-type="file-list">
<Heading fontWeight="bold" textStyle="heading.small" asChild consumeCss>
<h3>{t("files")}</h3>
</Heading>
<ul>{children}</ul>
{children}
</FileListWrapper>
);
};

0 comments on commit 9f88ae8

Please sign in to comment.