Skip to content

Commit 61a982b

Browse files
committed
Fix the dang JSS
1 parent f0a1fd2 commit 61a982b

6 files changed

Lines changed: 19 additions & 7 deletions

File tree

docs/demos/themed/description.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
To customize the theme of an `Alert`, wrap it in a [react-jss](https://github.com/cssinjs/react-jss) higher-order component
2-
or provide it with a `classes` prop shaped like the one react-jss provides:
2+
or provide it with a `sheet` prop shaped like the one react-jss provides:
33
```
4-
{
4+
classes: {
55
[className]: String
66
}
77
```

src/alert-list.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ import Alert, { PropTypes as AlertPropTypes } from "./alert-timer";
1515
import AlertTransition from "./alert-transition";
1616
import styles from "./container/styles";
1717

18-
const AlertList = ({ position, alerts, onDismiss, ...props }) => (
19-
<Container position={position}>
18+
const AlertList = ({
19+
position,
20+
alerts,
21+
onDismiss,
22+
sheet: { classes },
23+
...props
24+
}) => (
25+
<Container position={position} className={classes.container}>
2026
<TransitionGroup>
2127
{alerts.map(item => {
2228
const dismiss = onDismiss ? () => onDismiss(item) : null;

src/alert-transition.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import useSheet from "react-jss";
66

77
const timeout = { enter: ENTER_TIMEOUT, exit: EXIT_TIMEOUT };
88

9-
const AlertTransition = ({ classes, ...props }) =>
9+
const AlertTransition = ({ sheet: { classes }, ...props }) =>
1010
props && props.children ? (
1111
<CSSTransition timeout={timeout} classNames={classes} {...props} />
1212
) : null;

src/alert/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Alert = ({
99
headline,
1010
onDismiss,
1111
dismissTitle = "Dismiss",
12-
classes,
12+
sheet: { classes },
1313
showIcon = true
1414
}) => {
1515
const isDismissable = !!onDismiss;

src/alert/styles.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { bootstrap } from "toetag";
22
import useSheet from "react-jss";
3+
import { transitionStyles } from "../alert-transition";
34

45
export default useSheet({
6+
...transitionStyles,
57
alert: {
68
composes: "alert",
79
marginBottom: bootstrap.paddingBaseVertical,

src/container/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import styles from "./styles";
77
export const ENTER_TIMEOUT = 500;
88
export const EXIT_TIMEOUT = 300;
99

10-
const AlertContainer = ({ position = "top-right", children, classes }) => {
10+
const AlertContainer = ({
11+
position = "top-right",
12+
children,
13+
sheet: { classes }
14+
}) => {
1115
return (
1216
<div className={`${classes.container} ${classes[position]}`}>
1317
<TransitionGroup>

0 commit comments

Comments
 (0)