Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make files header go away #2604

Merged
merged 4 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan dette bare være en ul nå?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Altså uten div som wrapper?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja

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>
);
};
Loading