add stories for expand row

This commit is contained in:
AllenFang
2018-08-01 20:26:00 +08:00
parent 35b1e37940
commit dbd0f89a3d
5 changed files with 309 additions and 0 deletions
@@ -68,3 +68,17 @@ export const stockGenerator = (quantity = 5) =>
}));
export const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
export const productsExpandRowsGenerator = (quantity = 5, callback) => {
if (callback) return Array.from({ length: quantity }, callback);
// if no given callback, retrun default product format.
return (
Array.from({ length: quantity }, (value, index) => ({
id: index,
name: `Item name ${index}`,
price: 2100 + index,
expand: productsQualityGenerator(index)
}))
);
};