Skip to content

Commit

Permalink
[homework2] linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sosninroman committed Oct 3, 2024
1 parent f425d54 commit 739b609
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 116 deletions.
12 changes: 6 additions & 6 deletions src/shared/header/Header.stories.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Header } from './Header'
import { Header } from './Header';

const meta = {
title: 'Otus/Common/Header',
component: Header
}
title: 'Otus/Common/Header',
component: Header,
};

export default meta
export default meta;

export const Default = {}
export const Default = {};
19 changes: 10 additions & 9 deletions src/shared/layout/Layout.stories.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { Layout } from './Layout'
import { React } from 'react';
import { Layout } from './Layout';

const meta = {
title: 'Otus/Common/Layout',
component: Layout,
}
title: 'Otus/Common/Layout',
component: Layout,
};

export default meta
export default meta;

export const Default = {
args: {
children: [<div style={{ margins: 0, height: "500px" }} />]
},
}
args: {
children: [<div key={1} style={{ margins: 0, height: '500px' }} />],
},
};
10 changes: 5 additions & 5 deletions src/shared/logo/Logo.stories.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Logo } from './Logo'
import { Logo } from './Logo';

const meta = {
title: 'Otus/Common/Logo',
component: Logo,
title: 'Otus/Common/Logo',
component: Logo,
};

export default meta
export default meta;

export const Default = {}
export const Default = {};
31 changes: 18 additions & 13 deletions src/shared/modal/Modal.stories.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import { Modal } from './Modal'
import { React } from 'react';
import { Modal } from './Modal';

const meta = {
title: 'Otus/Common/Modal',
component: Modal,
argTypes: {
visible: { control: 'boolean' },
},
}
title: 'Otus/Common/Modal',
component: Modal,
argTypes: {
visible: { control: 'boolean' },
},
};

export default meta
export default meta;

export const Default = {
args: {
visible: true,
children: [<p style={{ textAlign: "center" }}>"Hello, World!" </p>]
},
}
args: {
visible: true,
children: [
<p key={1} style={{ textAlign: 'center' }}>
Hello, World!
</p>,
],
},
};
28 changes: 14 additions & 14 deletions src/shared/shopping/cartitem/CartItem.stories.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { CartItem } from "./CartItem"
import { CartItem } from './CartItem';

const meta = {
title: 'Otus/Shopping/CartItem',
component: CartItem,
tags: ['autodocs'],
argTypes: {
title: {
control: 'text'
},
title: 'Otus/Shopping/CartItem',
component: CartItem,
tags: ['autodocs'],
argTypes: {
title: {
control: 'text',
},
}
},
};

export default meta
export default meta;

export const Default = {
args: {
title: "Awesome thing",
},
}
args: {
title: 'Awesome thing',
},
};
44 changes: 22 additions & 22 deletions src/shared/shopping/itemcard/ItemCard.stories.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { ItemCard } from "./ItemCard"
import { ItemCard } from './ItemCard';

const meta = {
title: 'Otus/Shopping/ItemCard',
component: ItemCard,
tags: ['autodocs'],
argTypes: {
price: {
control: 'number'
},
title: {
control: 'text'
},
desc: {
control: 'text'
},
title: 'Otus/Shopping/ItemCard',
component: ItemCard,
tags: ['autodocs'],
argTypes: {
price: {
control: 'number',
},
}
title: {
control: 'text',
},
desc: {
control: 'text',
},
},
};

export default meta
export default meta;

export const Default = {
args: {
price: 100,
title: "Awesome thing",
desc: "Everyone needs it!"
},
}
args: {
price: 100,
title: 'Awesome thing',
desc: 'Everyone needs it!',
},
};
28 changes: 14 additions & 14 deletions src/shared/shopping/itempage/ItemPage.stories.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { ItemPage } from "./ItemPage"
import { ItemPage } from './ItemPage';

const meta = {
title: 'Otus/Shopping/ItemPage',
component: ItemPage,
tags: ['autodocs']
}
title: 'Otus/Shopping/ItemPage',
component: ItemPage,
tags: ['autodocs'],
};

export default meta
export default meta;

export const Default = {
args: {
price: 100,
title: "Awesome thing",
desc: "Everyone needs it!",
images: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
category: "food",
},
}
args: {
price: 100,
title: 'Awesome thing',
desc: 'Everyone needs it!',
images: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
category: 'food',
},
};
54 changes: 27 additions & 27 deletions src/shared/shopping/purchasebutton/PurchaseButton.stories.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { PurchaseButton } from './PurchaseButton'
import { PurchaseButton } from './PurchaseButton';

const meta = {
title: 'Otus/Shopping/PurchaseButton',
component: PurchaseButton,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'Button to add item to the cart'
}
}
title: 'Otus/Shopping/PurchaseButton',
component: PurchaseButton,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'Button to add item to the cart',
},
},
argTypes: {
count: {
description: "Number of items in the cart",
control: 'number'
},
},
argTypes: {
count: {
description: 'Number of items in the cart',
control: 'number',
},
}
},
};

export default meta
export default meta;

export const EmptyCartButton = {
name: "Without items",
args: {
count: 0
},
}
name: 'Without items',
args: {
count: 0,
},
};

export const ButtonWithPurchase = {
name: "With items",
args: {
count: 2
},
}
name: 'With items',
args: {
count: 2,
},
};
7 changes: 1 addition & 6 deletions src/stories/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ interface ButtonProps {
export function Button({ primary = false, size = 'medium', backgroundColor, label, ...props }: ButtonProps) {
const mode = primary ? s.primary : s.secondary;
return (
<button
type="button"
className={[s.button, s[size], mode].join(' ')}
style={{ backgroundColor }}
{...props}
>
<button type="button" className={[s.button, s[size], mode].join(' ')} style={{ backgroundColor }} {...props}>
{label}
</button>
);
Expand Down

0 comments on commit 739b609

Please sign in to comment.