Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Commit 3f408de

Browse files
committed
Add examples and demo project
1 parent c877b42 commit 3f408de

Some content is hidden

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

53 files changed

+9741
-341
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: '20.x'
16+
registry-url: 'https://registry.npmjs.org'
17+
- run: npm ci
18+
- run: npm run build
19+
- run: npm publish --access public
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,10 @@ yarn-error.log*
3838
*.tsbuildinfo
3939
next-env.d.ts
4040

41-
src/app/style.scss
41+
# src/app/style.scss
42+
43+
index.mjs
44+
index.umd.js
45+
next.svg
46+
vercel.svg
47+
style.css

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A versatile and user-friendly file management system built with React, Next.js a
55
<img src="./gifs/full.gif"/>
66

77
Checkout the live demo on, codesandbox <br />
8-
[![codesandbox.io](https://codesandbox.io/favicon.ico)](https://codesandbox.io/p/sandbox/cranky-breeze-r4hht7?file=%2Fsrc%2Fmain.js)
8+
[![codesandbox.io](https://codesandbox.io/favicon.ico)](https://codesandbox.io/p/devbox/eager-mountain-n4zgs6?file=%2Fsrc%2FApp.tsx%3A29%2C40)
99

1010
---
1111

@@ -20,7 +20,7 @@ Checkout the live demo on, codesandbox <br />
2020
- [Square View](#square-view)
2121
- [Horizontal Long Square View](#horizontal-long-square-view)
2222
- [Circular View](#circular-view)
23-
- [Over-ride CSS](#over-ride-css)
23+
- [Use/Over-ride CSS](#useover-ride-css)
2424
- [Properties and Events](#properties-and-events)
2525
- [Usage](#usage)
2626
- [Contributing](#contributing)
@@ -95,7 +95,13 @@ We are providing some examples with design. so, you can easily use it in your pr
9595

9696
<img src="./gifs/round-view.gif"/>
9797

98-
### Over-ride CSS
98+
### Use/Over-ride CSS
99+
100+
- Use `style.css` for UI using,
101+
102+
```js
103+
import "@canopassoftware/react-file-upload/style.css"
104+
```
99105

100106
For over-riding the design of default buttons, you can over-ride it's CSS by class name. <br>
101107
For example., <br>
@@ -192,11 +198,17 @@ To manage and preview files with this library, follow these steps:
192198
193199
```js
194200
// using CommonJS
195-
const { SingleFileUpload, MultipleFileUpload } = require("@canopassoftware/react-file-upload");
201+
const {
202+
SingleFileUpload,
203+
MultipleFileUpload,
204+
} = require("@canopassoftware/react-file-upload");
196205
197-
OR
206+
OR;
198207
// using esModules
199-
import { SingleFileUpload, MultipleFileUpload } from "@canopassoftware/react-file-upload";
208+
import {
209+
SingleFileUpload,
210+
MultipleFileUpload,
211+
} from "@canopassoftware/react-file-upload";
200212
```
201213

202214
### Creating custom UI with file preview
@@ -250,8 +262,8 @@ export default function App() {
250262
<SingleFileUpload
251263
uploadedFile={setPreviewFileData}
252264
callback={handleFileUploading}
253-
uploadBtn={"Save"}
254-
progressBtn={"Saving..."}
265+
uploadBtnText={"Save"}
266+
progressBtnText={"Saving..."}
255267
>
256268
<!-- write a code to manage file design or use code from examples -->
257269
</SingleFileUpload>
@@ -265,10 +277,9 @@ export default function App() {
265277
```js
266278
"use client";
267279

268-
import Image from "next/image";
280+
import Image, { StaticImageData } from "next/image";
269281
import React from "react";
270282
import MultipleFileUpload from "@canopassoftware/react-file-upload";
271-
import { StaticImageData } from "next/image";
272283

273284
export default function App() {
274285
const uploadedFiles = [] as Array<{
@@ -301,8 +312,9 @@ return (
301312
accept=""
302313
uploadedFiles={uploadedFiles}
303314
callback={handleFilesUploading}
304-
uploadBtn={"Save"}
305-
progressBtn={"Saving..."}
315+
removeBtnText={"remove"}
316+
uploadBtnText={"Save"}
317+
progressBtnText={"Saving..."}
306318
>
307319
{(file: any) => (
308320
<!-- write a code to manage file design or use code from examples -->
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)