Skip to content

Commit

Permalink
refactor stories
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberDex committed Jul 29, 2023
1 parent 9e82bf0 commit 53c031d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 53 deletions.
19 changes: 1 addition & 18 deletions src/stories/styles/ConditionalStylesMax.stories.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { Text } from '@pixi/text';

const assets = {
bg: 'verticalBG.png',
a1: 'avatar-01.png',
a2: 'avatar-02.png',
a3: 'avatar-03.png',
a4: 'avatar-04.png',
a5: 'avatar-05.png',
};

const args = {
maxWidth: 500,
maxHeight: 500,
Expand All @@ -36,14 +26,7 @@ class LayoutStory
h: number;
content: Text;

constructor(props)
{
preloadAssets(Object.values(assets)).then(() =>
this.createLayout(props)
);
}

createLayout(props: Props)
constructor(props: Props)
{
this.props = props;

Expand Down
17 changes: 0 additions & 17 deletions src/stories/styles/ConditionalStylesMin.stories.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { Text } from '@pixi/text';

const assets = {
bg: 'verticalBG.png',
a1: 'avatar-01.png',
a2: 'avatar-02.png',
a3: 'avatar-03.png',
a4: 'avatar-04.png',
a5: 'avatar-05.png',
};

const args = {
minWidth: 500,
minHeight: 500,
Expand All @@ -37,13 +27,6 @@ class LayoutStory
content: Text;

constructor(props)
{
preloadAssets(Object.values(assets)).then(() =>
this.createLayout(props)
);
}

createLayout(props: Props)
{
this.props = props;

Expand Down
19 changes: 1 addition & 18 deletions src/stories/styles/ConditionalStylesPortraitLandscape.stories.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { toolTip } from '../components/ToolTip';

const assets = {
bg: 'verticalBG.png',
a1: 'avatar-01.png',
a2: 'avatar-02.png',
a3: 'avatar-03.png',
a4: 'avatar-04.png',
a5: 'avatar-05.png',
};

const args = {
portraitColor: 'white',
landscapeColor: 'blue',
Expand All @@ -26,14 +16,7 @@ class LayoutStory
w: number;
h: number;

constructor(props)
{
preloadAssets(Object.values(assets)).then(() =>
this.createLayout(props)
);
}

createLayout({ portraitColor, landscapeColor }: any)
constructor({ portraitColor, landscapeColor }: any)
{
this.addTooltip(`Resize view area from portrait to landscape and back to see the styles change`);

Expand Down

0 comments on commit 53c031d

Please sign in to comment.