Skip to content

Commit

Permalink
fix(docs): remove storybook errors (#2675)
Browse files Browse the repository at this point in the history
  • Loading branch information
illiteratewriter committed Mar 2, 2023
1 parent dac3587 commit d0f188b
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/Modal.js
Expand Up @@ -373,8 +373,8 @@ class Modal extends React.Component {
if (Modal.openCount < 1) {
Modal.originalBodyOverflow = window.getComputedStyle(
document.body,
).overflow;
};
).overflow;
}
conditionallyUpdateScrollbar();

if (Modal.openCount === 0) {
Expand Down
1 change: 0 additions & 1 deletion src/Navbar.js
Expand Up @@ -19,7 +19,6 @@ const propTypes = {
expand: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
/** Make the navbar fixed at the top */
fixed: PropTypes.string,
full: PropTypes.bool,
/** Add `.navbar-light` class */
light: PropTypes.bool,
role: PropTypes.string,
Expand Down
6 changes: 5 additions & 1 deletion stories/examples/Dropdown/DirectionKitchen.js
Expand Up @@ -12,7 +12,11 @@ export default function Example(args) {
return (
<div className="d-flex p-5 justify-content-center">
{directions.map((direction) => (
<UncontrolledDropdown direction={direction} className="me-2">
<UncontrolledDropdown
direction={direction}
key={direction}
className="me-2"
>
<DropdownToggle caret color="primary">
{`Drop${direction}`}
</DropdownToggle>
Expand Down
9 changes: 7 additions & 2 deletions stories/examples/Form/InputType.js
@@ -1,12 +1,17 @@
import React from 'react';
import React, { useState } from 'react';
import { Form, FormGroup, Label, Input, FormText } from 'reactstrap';

function Example(props) {
const [value, setValue] = useState('Some plain text/ static value');
return (
<Form>
<FormGroup>
<Label for="exampleEmail">Plain Text (Static)</Label>
<Input plaintext value="Some plain text/ static value" />
<Input
plaintext
value={value}
onChange={(e) => setValue(e.target.value)}
/>
</FormGroup>
<FormGroup>
<Label for="exampleEmail">Email</Label>
Expand Down
2 changes: 1 addition & 1 deletion stories/examples/Form/SwitchesExample.js
Expand Up @@ -14,7 +14,7 @@ function Example(props) {
<Input
type="switch"
checked={state}
onClick={() => {
onChange={() => {
setState(!state);
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion stories/examples/Modal/BackdropExample.js
Expand Up @@ -34,7 +34,7 @@ function Example(props) {

return (
<div>
<Form inline onSubmit={(e) => e.preventDefault()}>
<Form onSubmit={(e) => e.preventDefault()}>
<FormGroup>
<Label for="backdrop">Backdrop value</Label>{' '}
<Input
Expand Down
2 changes: 1 addition & 1 deletion stories/examples/Modal/DestructuringExample.js
Expand Up @@ -23,7 +23,7 @@ function ModalExample(props) {

return (
<div>
<Form inline onSubmit={(e) => e.preventDefault()}>
<Form onSubmit={(e) => e.preventDefault()}>
<FormGroup>
<Label for="unmountOnClose">UnmountOnClose value</Label>{' '}
<Input
Expand Down
2 changes: 1 addition & 1 deletion stories/examples/Modal/FocusAfterCloseExample.js
Expand Up @@ -21,7 +21,7 @@ function ModalFocusAfterClose(props) {

return (
<div>
<Form inline onSubmit={(e) => e.preventDefault()}>
<Form onSubmit={(e) => e.preventDefault()}>
<FormGroup>
<Label for="focusAfterClose">Focus After Close</Label>
<Input
Expand Down
1 change: 0 additions & 1 deletion stories/examples/Navbar/Navbar.js
Expand Up @@ -17,7 +17,6 @@ Example.args = {
color: 'light',
light: true,
dark: false,
full: false,
expand: 'md',
container: 'fluid',
};
Expand Down
2 changes: 1 addition & 1 deletion stories/examples/Navbar/NavbarExample.js
Expand Up @@ -38,7 +38,7 @@ function Example(args) {
<DropdownToggle nav caret>
Options
</DropdownToggle>
<DropdownMenu right>
<DropdownMenu end>
<DropdownItem>Option 1</DropdownItem>
<DropdownItem>Option 2</DropdownItem>
<DropdownItem divider />
Expand Down
8 changes: 4 additions & 4 deletions stories/examples/Props.js
Expand Up @@ -16,19 +16,19 @@ function Props({ component, components = [] }) {
<div>
{component ? <Info component={component} /> : undefined}
{components.map((c) => (
<Info component={c} />
<Info key={c.name} component={c} />
))}
</div>
);
}

Info.propTypes = {
component: PropTypes.node,
component: PropTypes.elementType,
};

Props.propTypes = {
component: PropTypes.node,
components: PropTypes.arrayOf(PropTypes.node),
component: PropTypes.elementType,
components: PropTypes.arrayOf(PropTypes.elementType),
};

export default Props;
2 changes: 1 addition & 1 deletion stories/examples/Table/Hover.js
Expand Up @@ -42,7 +42,7 @@ Example.parameters = {
docs: {
description: {
story:
'Add `hover` prop to enable a hover state on table rows within a <tbody>.',
'Add `hover` prop to enable a hover state on table rows within a `<tbody>`.',
},
},
};
2 changes: 1 addition & 1 deletion stories/examples/Table/Striped.js
Expand Up @@ -42,7 +42,7 @@ Example.parameters = {
docs: {
description: {
story:
'Use `striped` prop to add zebra-striping to any table row within the <tbody>.',
'Use `striped` prop to add zebra-striping to any table row within the `<tbody>`.',
},
},
};
2 changes: 1 addition & 1 deletion stories/examples/Table/Variants.js
Expand Up @@ -14,7 +14,7 @@ function Example(args) {
</thead>
<tbody>
{colors.map((color) => (
<tr className={`table-${color}`}>
<tr className={`table-${color}`} key={color}>
<td>{color}</td>
<td>Cell</td>
<td>Cell</td>
Expand Down
2 changes: 1 addition & 1 deletion stories/examples/Tooltip/DirectionsExample.js
Expand Up @@ -52,7 +52,7 @@ function TooltipExampleMulti(props) {
},
].map((tooltip, i) => {
// eslint-disable-next-line react/no-array-index-key
return <TooltipItem key={i} item={tooltip} id={i} />;
return <TooltipItem key={i} item={tooltip} id={`Tooltip-${i}`} />;
})}
</>
);
Expand Down

0 comments on commit d0f188b

Please sign in to comment.