Skip to content

Commit 7fc631c

Browse files
committed
chore: Refactor Accordion component and update package version
1 parent e74a953 commit 7fc631c

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@programmer_network/yail",
3-
"version": "1.0.186",
3+
"version": "1.0.187",
44
"description": "Programmer Network's official UI library for React",
55
"author": "Aleksandar Grbic - (https://programmer.network)",
66
"publishConfig": {

src/Components/Accordion/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import { AccordionOrderType, IAccordionProps } from "./types";
1818
const Accordion: FC<IAccordionProps> = ({
1919
className,
2020
sections,
21-
onSorted,
2221
sectionTitleClassName,
2322
onSectionItemClick,
2423
onSectionClick,
24+
onSorted,
2525
onSelected,
2626
onAddSection,
2727
addSectionLabel,
@@ -68,7 +68,7 @@ const Accordion: FC<IAccordionProps> = ({
6868
e.preventDefault();
6969
e.stopPropagation();
7070
if (draggedId != null && draggedOverId != null) {
71-
onSorted(
71+
onSorted?.(
7272
AccordionOrderType.SECTIONS,
7373
ArrayUtils.reorder(
7474
sections,
@@ -183,7 +183,7 @@ const Accordion: FC<IAccordionProps> = ({
183183
setSelectedItemId(item.id);
184184
}}
185185
onDragged={(items: IDraggableListItem[]) => {
186-
onSorted(
186+
onSorted?.(
187187
AccordionOrderType.LECTURES,
188188
[
189189
...sections.map(s =>

src/Components/Accordion/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface IAccordionProps {
2323
className?: string;
2424
sections: ISection[];
2525
sectionTitleClassName?: string;
26-
onSorted: (
26+
onSorted?: (
2727
type: AccordionOrderType,
2828
sections: ISection[],
2929
section: { sectionId: number; items: IDraggableListItem[] }

src/Components/Button/Button.stories.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ export const WithIconClassName: Story = {
8787
}
8888
};
8989

90+
export const LoadingWithIcon: Story = {
91+
args: {
92+
children: "Button",
93+
outlined: true,
94+
isLoading: true,
95+
className: "button--green",
96+
icon: {
97+
iconName: "IconBomb",
98+
iconPosition: "left"
99+
}
100+
}
101+
};
102+
90103
export const Red: Story = {
91104
args: {
92105
children: "Button",

src/Components/Button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const Button: React.FC<IButtonProps> = (
5656
<span
5757
className={classNames({
5858
"yl-flex yl-gap-1 yl-items-center": icon?.iconName,
59-
invisible: isLoading
59+
"yl-invisible": isLoading
6060
})}
6161
>
6262
{!isLoading && icon?.iconName && icon.iconPosition === "left" && (

0 commit comments

Comments
 (0)