Skip to content

Commit

Permalink
Merge pull request #7 from millnut/feature/enforce-default-function
Browse files Browse the repository at this point in the history
fix: change to default function
  • Loading branch information
3LivesLeft authored Oct 12, 2023
2 parents 13582d8 + 285aade commit ca7e978
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"arrow-body-style": ["warn", "as-needed"],
"no-underscore-dangle": ["error", { "allow": ["_source", "_id", "__typename", "__session"] }],
"indent": "off",
"@typescript-eslint/indent": 0
"@typescript-eslint/indent": 0,
"import/prefer-default-export": ["error", { "target": "single" }]
}
}
2 changes: 1 addition & 1 deletion src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './Button';
import { buttonProps, buttonLinkProps } from './defaultProps';
import buttonProps, { buttonLinkProps } from './defaultProps';

// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
const meta = {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Button/defaultProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ export const buttonLinkProps: ButtonProps = {
label: 'Button',
url: 'https://example.com'
};

export default buttonProps;
2 changes: 1 addition & 1 deletion src/components/Card/Card.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import Card from './Card';
import { cardProps } from './defaultProps';
import cardProps from './defaultProps';

const meta = {
title: 'Example/Card',
Expand Down
2 changes: 2 additions & 0 deletions src/components/Card/defaultProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ export const cardProps: CardProps = {
title: 'Example title',
body: 'Example body text'
};

export default cardProps;
2 changes: 1 addition & 1 deletion src/components/Image/Image.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import Image from './Image';
import { imageProps } from './defaultProps';
import imageProps from './defaultProps';

const meta = {
title: 'Example/Image',
Expand Down
2 changes: 2 additions & 0 deletions src/components/Image/defaultProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export const imageProps: ImageProps = {
height: 500,
altText: 'An example image'
};

export default imageProps;
2 changes: 1 addition & 1 deletion src/components/TextImage/TextImage.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import TextImage from './TextImage';
import { textImageProps } from './defaultProps';
import textImageProps from './defaultProps';

const meta = {
title: 'Example/TextImage',
Expand Down
2 changes: 2 additions & 0 deletions src/components/TextImage/defaultProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ export const textImageProps: TextImageProps = {
altText: 'An example image'
}
};

export default textImageProps;
2 changes: 1 addition & 1 deletion src/hooks/useMedia.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';

export function useMobile(mobileWidth = '768px', boolean = true): boolean {
export default function useMobile(mobileWidth = '768px', boolean = true): boolean {
const [mobile, setMobile] = useState(boolean);

useEffect(() => {
Expand Down

0 comments on commit ca7e978

Please sign in to comment.