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

feat: add new 'minus' icon and update TableOfContents component #377

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions packages/components/src/common/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
BiChart,
BiGlobe,
BiGroup,
BiMinus,
BiRightArrowAlt,
BiStar,
} from "react-icons/bi"
Expand All @@ -17,6 +18,7 @@ export const SUPPORTED_ICON_NAMES = [
"office-building",
"stars",
"globe",
"minus",
] as const

export type SupportedIconName = (typeof SUPPORTED_ICON_NAMES)[number]
Expand All @@ -31,4 +33,5 @@ export const SUPPORTED_ICONS_MAP: Record<SupportedIconName, SupportedIconType> =
"office-building": BiBuildings,
stars: BiStar,
globe: BiGlobe,
minus: BiMinus,
Copy link
Contributor

Choose a reason for hiding this comment

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

question: hmm the icon here means that we are making it available for users to use this icon (for instance in infocols), is this intended?

Copy link
Contributor

Choose a reason for hiding this comment

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

removed in b6a81d5

}
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import { BiRightArrowAlt } from "react-icons/bi"
import { BiMinus } from "react-icons/bi"

import type { TableOfContentsProps } from "~/interfaces"

const TableOfContents = ({ items }: TableOfContentsProps) => {
return (
<div className="flex flex-col gap-3 border-l-4 border-content pl-5">
<p className="text-lg font-semibold text-content-strong">On this page</p>
<div className="flex flex-col gap-3">
<div className="flex flex-col gap-3">
<p className="prose-headline-lg-medium text-base-content-strong">
On this page
</p>
<div className="prose-body-base flex flex-col gap-3">
{items.map(({ anchorLink, content }) => (
<div className="flex flex-row items-start gap-2">
<BiRightArrowAlt className="size-6 shrink-0 text-interaction-main" />
<BiMinus className="size-5 shrink-0 fill-base-content-strong" />
<a
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: I think the minus sign is not middle aligned
Screenshot 2024-07-29 at 11 18 59

Copy link
Contributor

Choose a reason for hiding this comment

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

addressed in 26b4234

href={anchorLink}
className="w-fit text-hyperlink underline underline-offset-2 hover:text-hyperlink-hover active:text-hyperlink"
className="w-fit text-link underline-offset-4 hover:text-link-hover hover:underline"
>
{content}
</a>
Expand Down
Loading