Skip to content

Commit f8efef0

Browse files
author
spoeck
committed
add edge story
1 parent 44a0166 commit f8efef0

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

src/components/Satellite.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function Satellite(props: Props) {
5757
rotation,
5858
orientation
5959
),
60-
config: { mass, tension, friction },
60+
config: { mass, tension, friction, clamp: true },
6161
});
6262

6363
useLayoutEffect(() => {

src/stories/ScreenEdge.stories.tsx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { makeStyles, Theme } from '@material-ui/core';
2+
import { storiesOf } from '@storybook/react';
3+
import * as React from 'react';
4+
import { Planet } from '../components';
5+
import { withTheme } from './index.stories';
6+
import { generateSatellites } from './storybook_utils.tsx/generateSatellites';
7+
8+
storiesOf('Planet', module).add('-> configure', () => {
9+
const classes = useStyles();
10+
11+
return withTheme(
12+
<div className={classes.screen}>
13+
<div className={classes.planetContainer}>
14+
<Planet
15+
centerContent={<div className={classes.planet} />}
16+
open
17+
autoClose
18+
hideOrbit={true}
19+
rotation={120}
20+
mass={3}
21+
tension={500}
22+
friction={17}
23+
>
24+
{generateSatellites(3)}
25+
<div />
26+
<div />
27+
</Planet>
28+
</div>
29+
</div>
30+
);
31+
});
32+
33+
const useStyles = makeStyles((theme: Theme) => ({
34+
screen: {
35+
display: 'flex',
36+
backgroundColor: '#cbdcf7',
37+
justifyContent: 'center',
38+
alignItems: 'center',
39+
height: 400,
40+
width: 400,
41+
margin: 100,
42+
},
43+
44+
planetContainer: {
45+
position: 'absolute',
46+
top: 375,
47+
left: 120,
48+
},
49+
50+
planet: {
51+
height: 100,
52+
width: 100,
53+
borderRadius: '50%',
54+
backgroundColor: theme.palette.primary.main,
55+
'&:hover': {
56+
borderWidth: 10,
57+
boxShadow: '0px 0px 15px 10px ' + theme.palette.secondary.light,
58+
cursor: 'pointer',
59+
},
60+
},
61+
}));

0 commit comments

Comments
 (0)