-
Notifications
You must be signed in to change notification settings - Fork 21
/
Planetception.stories.tsx
78 lines (74 loc) · 1.92 KB
/
Planetception.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { makeStyles, Theme } from "@material-ui/core";
import { storiesOf } from "@storybook/react";
import * as React from "react";
import { Planet } from "../components";
import { withTheme } from "./index.stories";
import { generateSatellites } from "./storybook_utils.tsx/generateSatellites";
storiesOf("Planet", module).add("planetception (planets as satellites)", () => {
const classes = useStyles();
return withTheme(
<div className={classes.root}>
<Planet
centerContent={<div className={classes.planet} />}
open
orbitRadius={220}
>
<Planet
centerContent={<div className={classes.planetception} />}
autoClose
>
{generateSatellites(3)}
</Planet>
<Planet
centerContent={<div className={classes.planetception} />}
autoClose
open
>
{generateSatellites(3)}
</Planet>
<Planet
centerContent={<div className={classes.planetception} />}
autoClose
>
{generateSatellites(3)}
</Planet>
</Planet>
</div>
);
});
const useStyles = makeStyles((theme: Theme) => ({
root: {
display: "flex",
flex: 1,
width: "100%",
backgroundColor: "white",
justifyContent: "center",
alignItems: "center",
minHeight: 600,
},
planet: {
height: 100,
width: 100,
borderRadius: "50%",
backgroundColor: theme.palette.primary.main,
"&:hover": {
borderWidth: 10,
boxShadow: "0px 0px 15px 10px " + theme.palette.secondary.light,
cursor: "pointer",
},
},
planetception: {
position: "absolute",
top: -15,
left: -15,
height: 30,
width: 30,
backgroundColor: theme.palette.secondary.main,
borderRadius: "50%",
"&:hover": {
borderWidth: 10,
boxShadow: "0px 0px 15px 10px " + theme.palette.secondary.light,
cursor: "pointer",
},
},
}));