Skip to content

Commit 32546cf

Browse files
author
domyen
committed
Add props descriptions via docgen comments
1 parent abd7f9c commit 32546cf

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/components/Avatar.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ export function Avatar({ loading, username, src, size, ...props }) {
121121

122122
Avatar.propTypes = {
123123
loading: PropTypes.bool,
124+
/**
125+
The name of the user (not the nicename)
126+
*/
124127
username: PropTypes.string,
125128
src: PropTypes.string,
129+
/**
130+
Specify size
131+
*/
126132
size: PropTypes.oneOf(Object.keys(sizes)),
127133
};
128134

src/components/Button.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,24 @@ export function Button({
422422

423423
Button.propTypes = {
424424
loading: PropTypes.bool,
425+
/**
426+
When a button is in the loading state you can supply custom text
427+
*/
425428
loadingText: PropTypes.node,
429+
/**
430+
Buttons that have hrefs should use <a> instead of <button>
431+
*/
426432
isLink: PropTypes.bool,
427433
children: PropTypes.node.isRequired,
428434
appearance: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'outline']),
429435
disabled: PropTypes.bool,
436+
/**
437+
Prevents users from clicking on a button multiple times (for things like payment forms)
438+
*/
430439
unclickable: PropTypes.bool,
440+
/**
441+
Buttons with icons by themselves have a circular shape
442+
*/
431443
containsIcon: PropTypes.bool,
432444
size: PropTypes.oneOf(['small', 'medium']), // this is enum incase we need to add more sizes
433445
};

0 commit comments

Comments
 (0)