Skip to content

Commit 45f12f2

Browse files
committed
fix: Fix next.js outer css import issue
1 parent 46a5194 commit 45f12f2

File tree

7 files changed

+251
-256
lines changed

7 files changed

+251
-256
lines changed

README.md

Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@
6969

7070
## Features 😁
7171

72-
- Downloading thumbnail images
73-
- Resizing the canvas
74-
- Filling the background with colors or pictures
75-
- Choosing a blur effect
76-
- Selecting font family, size, stroke, color, angle, lineHeight
77-
- Dragging and dropping text on the canvas
78-
- Adding custom web font families
79-
- Selecting the modal button and its location
80-
- Choosing the image type (png, jpg, webp, svg)
81-
- Supporting TypeScript and Next
72+
- Download thumbnail images
73+
- Resize the canvas
74+
- Fill the background with colors or pictures
75+
- Select a blur effect
76+
- Select font family, textAlign, size, stroke, color, angle, lineHeight
77+
- Drag and Drop text on the canvas
78+
- Add custom web font families
79+
- Select the modal button and its location
80+
- Choose the image type (png, jpg, webp, svg)
81+
- Support TypeScript and Next(v13)
8282

8383

8484
<br />
@@ -116,40 +116,38 @@ import iconImage from '../assets/colorImage.png';
116116

117117
const App = () => {
118118
return (
119-
<div>
120-
<ThumbnailGenerator
121-
buttonIcon={<img src={iconImage} width={30} height={30} alt="iconImage" />}
122-
// To insert the inner icon of the button that opens the thumbnail modal, use the ReactNode.
123-
// If you do not include this option, the default icon will be used.
124-
125-
iconSize="medium"
126-
// Through this property, you can specify the size of the button icon.
127-
// However, if you are inserting a custom button icon, this option is meaningless.
128-
129-
iconPosition={[0, 20, 20, 0]}
130-
// Through this property, you can specify the position of the button icon.
131-
// [top, right, bottom, left]
132-
133-
modalPosition='right'
134-
// Through this property, you can specify the position of the thumbnail generator.
135-
136-
additionalFontFamily={['Noto Sans', ...]}
137-
// You can add the font of your choice to your project, but that font must already applied to your project.
138-
139-
isFullWidth={true}
140-
// Setting this property to true will make the thumbnail generator full-width.
141-
142-
isDefaultOpen={false}
143-
// Setting this property to true will open the thumbnail generator by default.
144-
/>
145-
</div>
119+
<ThumbnailGenerator
120+
buttonIcon={<img src={iconImage} width={30} height={30} alt="iconImage" />}
121+
// To insert the inner icon of the button that opens the thumbnail modal, use the ReactNode.
122+
// If you do not include this option, the default icon will be used.
123+
124+
iconSize="medium"
125+
// Through this property, you can specify the size of the button icon.
126+
// However, if you are inserting a custom button icon, this option is meaningless.
127+
128+
iconPosition={[0, 20, 20, 0]}
129+
// Through this property, you can specify the position of the button icon.
130+
// [top, right, bottom, left]
131+
132+
modalPosition='right'
133+
// Through this property, you can specify the position of the thumbnail generator.
134+
135+
additionalFontFamily={['Noto Sans', ...]}
136+
// You can add the font of your choice to your project, but that font must already applied to your project.
137+
138+
isFullWidth={true}
139+
// Setting this property to true will make the thumbnail generator full-width.
140+
141+
isDefaultOpen={false}
142+
// Setting this property to true will open the thumbnail generator by default.
143+
/>
146144
)
147145
}
148146
```
149147

150148
<br />
151149

152-
## How to use Next 😊
150+
## How to use Next(v13) 😊
153151
### STEP 1️⃣
154152
- Install Package
155153
```
@@ -183,11 +181,9 @@ import Image from "next/image";
183181

184182
export default function Home() {
185183
return (
186-
<>
187-
<ThumbnailGenerator
188-
buttonIcon={<Image src={buttonIcon} width={30} height={30} alt="buttonIcon" />}
189-
/>
190-
</>
184+
<ThumbnailGenerator
185+
buttonIcon={<Image src={buttonIcon} width={30} height={30} alt="buttonIcon" />}
186+
/>
191187
);
192188
}
193189

@@ -231,11 +227,9 @@ import iconImage from '../assets/colorImage.png';
231227

232228
const App = () => {
233229
return (
234-
<div>
235-
<ThumbnailGenerator
236-
additionalFontFamily={["Zeyada"]} // (*)
237-
/>
238-
</div>
230+
<ThumbnailGenerator
231+
additionalFontFamily={["Zeyada"]} // (*)
232+
/>
239233
)
240234
}
241235
```
@@ -249,7 +243,6 @@ const App = () => {
249243

250244
<br />
251245
<br />
252-
<hr />
253246

254247
## API 📄
255248
- buttonIcon

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-thumbnail-generator",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "react-thumbnail-generator",
55
"main": "dist/index.js",
66
"module": "dist/index.js",
@@ -63,7 +63,6 @@
6363
"react-dom": "^18.2.0",
6464
"react-scripts": "^5.0.1",
6565
"rollup": "^3.23.1",
66-
"rollup-plugin-import-css": "^3.3.1",
6766
"rollup-plugin-peer-deps-external": "^2.2.4",
6867
"storybook": "^7.0.18",
6968
"tsconfig-paths-webpack-plugin": "^4.0.0",

rollup.config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import commonjs from '@rollup/plugin-commonjs';
66
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
77
import alias from '@rollup/plugin-alias';
88
import pkg from './package.json' assert { type: 'json' };
9-
import css from 'rollup-plugin-import-css';
109
import path from 'path';
1110

1211
const extensions = ['.js', '.jsx', '.ts', '.tsx'];
@@ -39,7 +38,6 @@ export default {
3938
alias({
4039
entries: [{ find: '@', replacement: path.resolve(__dirname, './src') }],
4140
}),
42-
css(),
4341
terser(),
4442
],
4543
};

src/components/ColorPicker/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@ import React, {
88
} from 'react';
99
import { Color, ColorPicker as PaletteColorPicker } from 'react-color-palette';
1010
import { IconButton } from '../Icon/styled';
11-
import './style.css';
1211

13-
interface ColorPickerPickerProps {
12+
interface ColorPickerProps {
1413
children: React.ReactNode;
1514
color: Color;
1615
setColor: (color: Color) => void;
1716
toggleIsBlockEvent: () => void;
1817
}
1918

20-
const ColorPickerPicker = ({
19+
const ColorPicker = ({
2120
children,
2221
color,
2322
toggleIsBlockEvent,
2423
setColor,
25-
}: ColorPickerPickerProps) => {
24+
}: ColorPickerProps) => {
2625
const [isOpenColorPicker, setIsOpenColorPicker] = useState(false);
2726
const colorRef = useRef<HTMLDivElement>(null);
2827

@@ -93,4 +92,4 @@ const ColorPickerPicker = ({
9392
);
9493
};
9594

96-
export default ColorPickerPicker;
95+
export default ColorPicker;

src/components/ColorPicker/style.css

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)