Skip to content

Commit

Permalink
22233: Added TraineeIcon, MINOR (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
lancegliser authored Nov 20, 2024
1 parent 877cea7 commit 8f8a1df
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 16 deletions.
13 changes: 13 additions & 0 deletions src/components/Icons/TraineeIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { FC } from "react";
import { type IconBaseProps } from "react-icons";
import { HiOutlineCubeTransparent } from "react-icons/hi2";

/**
* A generic Trainee icon.
* Where possible, an Identicon should be used.
* An appropriate usage contexts would include:
* - Create a trainee actions
**/
export const TraineeIcon: FC<IconBaseProps> = (props) => (
<HiOutlineCubeTransparent {...props} />
);
53 changes: 37 additions & 16 deletions src/components/Icons/icons.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IconBaseProps } from "react-icons";
import {
MapDependentFeatureAttributesIcon,
TraineeDefineIcon,
TraineeIcon,
TraineeLoadIcon,
TraineeTrainIcon,
} from ".";
Expand All @@ -22,22 +23,27 @@ const meta: Meta<IconBaseProps> = {
args: {},
render: (args) => (
<div className="flex gap-4">
<IconWithLabel
label={"MapDependentFeatureAttributesIcon"}
Icon={<MapDependentFeatureAttributesIcon {...args} />}
/>
<IconWithLabel
label={"TraineeLoadIcon"}
Icon={<TraineeLoadIcon {...args} />}
/>
<IconWithLabel
label={"TraineeDefineIcon"}
Icon={<TraineeDefineIcon {...args} />}
/>
<IconWithLabel
label={"TraineeTrainIcon"}
Icon={<TraineeTrainIcon {...args} />}
/>
<Section title="Action">
<IconWithLabel
label={"MapDependentFeatureAttributesIcon"}
Icon={<MapDependentFeatureAttributesIcon {...args} />}
/>
<IconWithLabel
label={"TraineeLoadIcon"}
Icon={<TraineeLoadIcon {...args} />}
/>
<IconWithLabel
label={"TraineeDefineIcon"}
Icon={<TraineeDefineIcon {...args} />}
/>
<IconWithLabel
label={"TraineeTrainIcon"}
Icon={<TraineeTrainIcon {...args} />}
/>
</Section>
<Section title="Concepts">
<IconWithLabel label={"TraineeIcon"} Icon={<TraineeIcon {...args} />} />
</Section>
</div>
),
};
Expand All @@ -51,6 +57,21 @@ export const Default: Story = {
args: {},
};

type SectionProps = {
title: ReactNode;
children: ReactNode;
};
const Section: FC<SectionProps> = ({ title, children }) => {
return (
<section className="my-3">
<header>
<h2 className="text-lg font-semibold">{title}</h2>
</header>
<div className="flex flex-wrap items-start gap-4">{children}</div>
</section>
);
};

type IconWithLabelProps = { label: string; Icon: ReactNode };
const IconWithLabel: FC<IconWithLabelProps> = ({ label, Icon }) => (
<div className="flex flex-col items-center justify-center">
Expand Down
1 change: 1 addition & 0 deletions src/components/Icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./MapDependentFeatureAttributesIcon";
export * from "./TraineeDefineIcon";
export * from "./TraineeIcon";
export * from "./TraineeLoadIcon";
export * from "./TraineeTrainIcon";

0 comments on commit 8f8a1df

Please sign in to comment.