chore: storybook
This commit is contained in:
parent
d5af4aed83
commit
3b08a87f39
|
@ -1,6 +1,6 @@
|
||||||
import {useEffect, useRef, useState} from 'react';
|
import {useEffect, useRef, useState} from 'react';
|
||||||
|
|
||||||
import Dom from '@/components/dom.jsx';
|
import Dom from '@/react-components/dom.jsx';
|
||||||
import {RESOLUTION} from '@/constants.js';
|
import {RESOLUTION} from '@/constants.js';
|
||||||
|
|
||||||
function Decorator({children, style}) {
|
function Decorator({children, style}) {
|
||||||
|
@ -26,6 +26,7 @@ function Decorator({children, style}) {
|
||||||
ref={ref}
|
ref={ref}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: '#1099bb',
|
backgroundColor: '#1099bb',
|
||||||
|
flexDirection: 'column',
|
||||||
opacity: 0 === scale ? 0 : 1,
|
opacity: 0 === scale ? 0 : 1,
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
height: `calc(${RESOLUTION.y}px * ${scale})`,
|
height: `calc(${RESOLUTION.y}px * ${scale})`,
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
import {useArgs} from '@storybook/preview-api';
|
import {useArgs} from '@storybook/preview-api';
|
||||||
import {fn} from '@storybook/test';
|
import {fn} from '@storybook/test';
|
||||||
|
|
||||||
import Hotbar from '@/components/hotbar.jsx';
|
import Hotbar from '@/react-components/hotbar.jsx';
|
||||||
|
|
||||||
import DomDecorator from './dom-decorator.jsx';
|
import DomDecorator from './dom-decorator.jsx';
|
||||||
|
|
||||||
import potion from '/assets/potion.png?url';
|
|
||||||
|
|
||||||
const slots = Array(10).fill({});
|
const slots = Array(10).fill({});
|
||||||
slots[2] = {image: potion, qty: 24};
|
slots[2] = {qty: 24, source: '/assets/potion'};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Dom/Inventory/Hotbar',
|
title: 'Dom/Inventory/Hotbar',
|
||||||
|
@ -25,7 +23,12 @@ export default {
|
||||||
};
|
};
|
||||||
return Hotbar();
|
return Hotbar();
|
||||||
},
|
},
|
||||||
DomDecorator(),
|
DomDecorator({
|
||||||
|
style: {
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
tags: ['autodocs'],
|
tags: ['autodocs'],
|
||||||
args: {
|
args: {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import Slot from '@/components/slot.jsx';
|
import Slot from '@/react-components/slot.jsx';
|
||||||
|
|
||||||
import DomDecorator from './dom-decorator.jsx';
|
import DomDecorator from './dom-decorator.jsx';
|
||||||
|
|
||||||
import potion from '/assets/potion.png?url';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Dom/Inventory/Slot',
|
title: 'Dom/Inventory/Slot',
|
||||||
component: Slot,
|
component: Slot,
|
||||||
|
@ -33,7 +31,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
image: potion,
|
source: '/assets/potion',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user