forked from React-js-OTUS/react-start-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f425d54
commit 739b609
Showing
9 changed files
with
117 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' }} />], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
54
src/shared/shopping/purchasebutton/PurchaseButton.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters