Skip to content

Commit cb66cdd

Browse files
export all enums
1 parent b2a94b7 commit cb66cdd

File tree

7 files changed

+59
-57
lines changed

7 files changed

+59
-57
lines changed

dist/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ChildButton from './ChildButton';
2-
import FloatingMenu from './FloatingMenu';
3-
import MainButton from './MainButton';
4-
export { ChildButton, FloatingMenu, MainButton };
1+
import ChildButton, { ChildButtonProps } from './ChildButton';
2+
import FloatingMenu, { Directions } from './FloatingMenu';
3+
import MainButton, { MainButtonProps } from './MainButton';
4+
export { ChildButton, FloatingMenu, MainButton, Directions, ChildButtonProps, MainButtonProps, };

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.modern.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.modern.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/App.tsx

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,56 @@
1-
import React, { useState } from 'react'
2-
import MdAdd from '@material-ui/icons/Add'
3-
import MdClose from '@material-ui/icons/Clear'
4-
import MdEdit from '@material-ui/icons/Edit'
5-
import MdStar from '@material-ui/icons/Star'
6-
import MdFavorite from '@material-ui/icons/Favorite'
1+
import React, { useState } from 'react';
2+
import MdAdd from '@material-ui/icons/Add';
3+
import MdClose from '@material-ui/icons/Clear';
4+
import MdEdit from '@material-ui/icons/Edit';
5+
import MdStar from '@material-ui/icons/Star';
6+
import MdFavorite from '@material-ui/icons/Favorite';
77
import {
88
MainButton,
99
ChildButton,
10-
FloatingMenu
11-
} from 'react-floating-button-menu'
12-
import 'react-floating-button-menu/dist/index.css'
10+
FloatingMenu,
11+
Directions,
12+
} from 'react-floating-button-menu';
13+
import 'react-floating-button-menu/dist/index.css';
1314

1415
const App = () => {
15-
const [isOpen, setIsOpen] = useState(false)
16+
const [isOpen, setIsOpen] = useState(false);
1617
return (
1718
<div>
18-
<FloatingMenu slideSpeed={500} isOpen={isOpen} spacing={8}>
19+
<FloatingMenu
20+
slideSpeed={500}
21+
isOpen={isOpen}
22+
spacing={8}
23+
direction={Directions.Left}
24+
>
1925
<MainButton
2026
isOpen={isOpen}
2127
iconResting={<MdAdd style={{ fontSize: 20 }} />}
2228
iconActive={<MdClose style={{ fontSize: 20 }} />}
23-
background='linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)'
29+
background="linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
2430
onClick={() => {
25-
setIsOpen((prev) => !prev)
31+
setIsOpen((prev) => !prev);
2632
}}
2733
size={56}
2834
/>
2935
<ChildButton
3036
icon={<MdEdit style={{ fontSize: 20 }} />}
31-
background='linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)'
37+
background="linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
3238
size={40}
3339
onClick={() => console.log('First button clicked')}
3440
/>
3541
<ChildButton
3642
icon={<MdFavorite style={{ fontSize: 20 }} />}
37-
background='linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)'
43+
background="linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
3844
size={40}
3945
/>
4046
<ChildButton
4147
icon={<MdStar style={{ fontSize: 20 }} />}
42-
background='linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)'
48+
background="linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
4349
size={40}
4450
/>
4551
</FloatingMenu>
4652
</div>
47-
)
48-
}
53+
);
54+
};
4955

50-
export default App
56+
export default App;

src/MainButton.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable react/no-unused-prop-types */
2-
import React from 'react'
3-
import styled from 'styled-components'
2+
import React from 'react';
3+
import styled from 'styled-components';
44

55
// @ts-ignore
66
const Wrapper = styled('a')(({ background, size }: any) => ({
@@ -17,8 +17,8 @@ const Wrapper = styled('a')(({ background, size }: any) => ({
1717
alignItems: 'center',
1818
width: size,
1919
height: size,
20-
background
21-
}))
20+
background,
21+
}));
2222

2323
// @ts-ignore
2424
const IconWrapper = styled(({ isOpen, ...rest }) => <div {...rest} />)(
@@ -28,17 +28,17 @@ const IconWrapper = styled(({ isOpen, ...rest }) => <div {...rest} />)(
2828
WebkitTransition: '-webkit-transform 300ms',
2929
transition: 'transform 300ms',
3030
WebkitTransform: `rotate(${isOpen ? 180 : 0}deg)`,
31-
transform: `rotate(${isOpen ? 180 : 0}deg)`
31+
transform: `rotate(${isOpen ? 180 : 0}deg)`,
3232
})
33-
)
33+
);
3434

3535
export interface MainButtonProps {
36-
iconActive: any
37-
iconResting: any
38-
isOpen?: boolean
39-
background: string
40-
onClick: any
41-
size: number
36+
iconActive: any;
37+
iconResting: any;
38+
isOpen?: boolean;
39+
background: string;
40+
onClick: any;
41+
size: number;
4242
}
4343

4444
const MainButton = ({
@@ -53,7 +53,7 @@ const MainButton = ({
5353
{isOpen ? iconActive : iconResting}
5454
</IconWrapper>
5555
</Wrapper>
56-
)
57-
}
56+
);
57+
};
5858

59-
export default MainButton
59+
export default MainButton;

src/index.tsx

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
// import * as React from 'react'
2-
// import styles from './styles.module.css'
3-
4-
// interface Props {
5-
// text: string
6-
// }
7-
8-
// export const ExampleComponent = ({ text }: Props) => {
9-
// return <div className={styles.test}>Example Component: {text}</div>
10-
// }
11-
12-
import ChildButton from './ChildButton'
13-
import FloatingMenu from './FloatingMenu'
14-
import MainButton from './MainButton'
15-
16-
export { ChildButton, FloatingMenu, MainButton }
1+
import ChildButton, { ChildButtonProps } from './ChildButton';
2+
import FloatingMenu, { Directions } from './FloatingMenu';
3+
import MainButton, { MainButtonProps } from './MainButton';
4+
5+
export {
6+
ChildButton,
7+
FloatingMenu,
8+
MainButton,
9+
Directions,
10+
ChildButtonProps,
11+
MainButtonProps,
12+
};

0 commit comments

Comments
 (0)