Skip to content

Commit 7faa101

Browse files
authored
Merge pull request realvjy#3 from realvjy/dev
Dev - Good to go 🙌
2 parents 53394d4 + feba259 commit 7faa101

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4510
-131
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-coolshapes",
3-
"version": "0.0.1",
2+
"name": "coolshapes-react",
3+
"version": "0.0.5-alpha.0",
44
"description": "A react component library for coolshapes",
55
"keywords": [
66
"coolshapes",
@@ -41,11 +41,11 @@
4141
"homepage": "https://www.coolshap.es/",
4242
"repository": {
4343
"type": "git",
44-
"url": "https://github.com/realvjy/coolshap.es"
44+
"url": "https://github.com/realvjy/coolshapes-react"
4545
},
4646
"bugs": {
47-
"url": "https://github.com/realvjy/coolshap.es/issues",
48-
"email": "realvjy@gmail.com"
47+
"url": "https://github.com/realvjy/coolshapes-react/issues",
48+
"email": "yourbug@gmail.com"
4949
},
5050
"engines": {
5151
"node": ">=10"

src/lib/shapes.tsx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ interface BaseShapeOptions extends ShapeProps {
1919
const Coolshape: ForwardRefExoticComponent<ShapeOptions> = forwardRef(
2020
(options, ref) => {
2121
const { type, index, random, ...rest } = options;
22-
const [Shape, setShape] = useState<ShapeType | null>(null);
22+
const initialShape = index && type ? shapes[type][index - 1] : null;
23+
const [Shape, setShape] = useState<ShapeType | null>(initialShape);
2324
useEffect(() => {
24-
let shape;
2525
if (random || !type || !index) {
26-
shape = getRandomShape({ type }) as ShapeType;
27-
} else {
28-
shape = shapes[type][index - 1];
26+
const shape = getRandomShape({ type }) as ShapeType;
27+
setShape(shape);
2928
}
30-
setShape(shape);
3129
}, []);
3230
if (!Shape) {
3331
return null;
@@ -52,5 +50,20 @@ const getComponentWithShape = (
5250
const Star = getComponentWithShape("star");
5351
const Ellipse = getComponentWithShape("ellipse");
5452
const Flower = getComponentWithShape("flower");
53+
const Misc = getComponentWithShape("misc");
54+
const Moon = getComponentWithShape("moon");
55+
const Triangle = getComponentWithShape("triangle");
56+
const Rectangle = getComponentWithShape("rectangle");
57+
const Polygon = getComponentWithShape("polygon");
5558

56-
export { Coolshape, Star, Flower, Ellipse };
59+
export {
60+
Coolshape,
61+
Star,
62+
Flower,
63+
Ellipse,
64+
Misc,
65+
Moon,
66+
Triangle,
67+
Rectangle,
68+
Polygon,
69+
};

src/shapes/ellipse/e_7.tsx

Lines changed: 0 additions & 70 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)