File tree Expand file tree Collapse file tree 2 files changed +40
-5
lines changed
packages/components/src/components Expand file tree Collapse file tree 2 files changed +40
-5
lines changed Original file line number Diff line number Diff line change
1
+ import { Meta , StoryObj } from '@storybook/react' ;
2
+ import { hiveThemeDecorator } from '../../../../.storybook/hive-theme-decorator' ;
3
+ import {
4
+ ContactButton ,
5
+ ContactButtonProps ,
6
+ ContactTextLink ,
7
+ ContactTextLinkProps ,
8
+ } from './contact-us' ;
9
+
10
+ export default {
11
+ title : 'Components/ContactUs' ,
12
+ component : ContactButton ,
13
+ decorators : [ hiveThemeDecorator ] ,
14
+ parameters : {
15
+ padding : true ,
16
+ } ,
17
+ } satisfies Meta < ContactButtonProps > ;
18
+
19
+ export const Default : StoryObj < ContactButtonProps > = {
20
+ name : 'ContactButton' ,
21
+ args : {
22
+ // `children` is optional
23
+ children : 'Contact us' ,
24
+ variant : 'secondary-inverted' ,
25
+ } ,
26
+ } ;
27
+
28
+ export const TextLink : StoryObj < ContactTextLinkProps > = {
29
+ name : 'ContactTextLink' ,
30
+ render : args => < ContactTextLink { ...args } /> ,
31
+ args : {
32
+ children : 'Reach out to us about the Enterprise plan' ,
33
+ } ,
34
+ } ;
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ const openCrisp = (event: React.MouseEvent<HTMLAnchorElement>) => {
10
10
}
11
11
} ;
12
12
13
- // the errors are more readable if you add an interface for this
14
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
15
13
export interface ContactTextLinkProps
16
- extends Omit < React . HTMLAttributes < HTMLAnchorElement > , 'href' | 'onClick' > { }
14
+ extends Omit < React . HTMLAttributes < HTMLAnchorElement > , 'href' | 'onClick' > {
15
+ children ?: React . ReactNode ;
16
+ }
17
17
18
18
export function ContactTextLink ( props : ContactTextLinkProps ) {
19
19
return (
@@ -31,9 +31,10 @@ export function ContactTextLink(props: ContactTextLinkProps) {
31
31
) ;
32
32
}
33
33
34
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
35
34
export interface ContactButtonProps
36
- extends Omit < CallToActionProps . AnchorProps , 'onClick' | 'href' > { }
35
+ extends Omit < CallToActionProps . AnchorProps , 'onClick' | 'href' | 'children' > {
36
+ children ?: React . ReactNode ;
37
+ }
37
38
38
39
export function ContactButton ( props : ContactButtonProps ) {
39
40
return (
You can’t perform that action at this time.
0 commit comments