Skip to content
This repository was archived by the owner on Nov 19, 2018. It is now read-only.

Commit b12719d

Browse files
committed
fix(gallery.jsx): CSS files are required
This is a breaking change that requires integrators to either <link> the gallery.css file or import it themselves (assuming the proper Webpack/bundler CSS loader is in use). fixes #50
1 parent 27dc44e commit b12719d

File tree

10 files changed

+33
-29
lines changed

10 files changed

+33
-29
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ import React, { Component } from 'react'
307307
import FineUploaderTraditional from 'react-fine-uploader'
308308
import Gallery from 'react-fine-uploader/components/gallery'
309309

310+
// ...or load this specific CSS file using a <link> tag in your document
311+
import 'react-fine-uploader/components/gallery/gallery.css'
312+
310313
const uploader = new FineUploaderTraditional({
311314
options: {
312315
chunking: {

config/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = {
1313
},
1414
resolve: {
1515
alias: {
16+
lib: path.resolve('lib'),
1617
src: path.resolve('src'),
1718
test: path.resolve('src/test/unit')
1819
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-fine-uploader",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"license": "MIT",
55
"description": "React UI components for using Fine Uploader in a React-based project.",
66
"author": {

src/components/file-input/styleable-element.css

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

src/components/file-input/styleable-element.jsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
import React from 'react'
22

3-
import './styleable-element.css'
3+
const containerStyle = {
4+
display: 'inline-block',
5+
position: 'relative'
6+
}
7+
8+
const inputStyle = {
9+
bottom: 0,
10+
cursor: 'pointer',
11+
height: '100%',
12+
left: 0,
13+
margin: 0,
14+
opacity: 0,
15+
padding: 0,
16+
position: 'absolute',
17+
right: 0,
18+
top: 0,
19+
width: '100%'
20+
}
421

522
const StyleableFileInput = ({ children, className, onChange, ...params }) => (
6-
<div className={ `react-fine-uploader-file-input-container ${className || ''}` }>
23+
<div className={ `react-fine-uploader-file-input-container ${className || ''}` }
24+
style={ containerStyle }
25+
>
726
{ children }
827
<input { ...params }
928
className='react-fine-uploader-file-input'
1029
onChange={ onChange }
30+
style={ inputStyle }
1131
type='file'
1232
/>
1333
</div>

src/components/gallery/index.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import ProgressBar from '../progress-bar'
1313
import Status from '../status'
1414
import Thumbnail from '../thumbnail'
1515

16-
import './gallery.css'
1716
import PauseIcon from './pause-icon'
1817
import PlayIcon from './play-icon'
1918
import UploadIcon from './upload-icon'

src/components/thumbnail/index.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { Component, PropTypes } from 'react'
22

33
import Placeholder from './placeholder'
44

5-
import './thumbnail.css'
65
import NotAvailablePlaceholder from './not-available-placeholder'
76
import WaitingPlaceholder from './waiting-placeholder'
87

src/components/thumbnail/placeholder.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { PropTypes } from 'react'
22

33
const Placeholder = ({ className, image, size, status }) => {
44
const style = {
5+
display: 'inline-block',
56
maxHeight: size,
67
maxWidth: size
78
}

src/components/thumbnail/thumbnail.css

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

src/test/manual/tester.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import React, { Component } from 'react'
22

3-
import Gallery from 'src/components/gallery'
4-
import S3FineUploader from 'src/wrappers/s3'
5-
import TraditionalFineUploader from 'src/wrappers/traditional'
3+
import Gallery from 'lib/components/gallery'
4+
import S3FineUploader from 'lib/wrappers/s3'
5+
import TraditionalFineUploader from 'lib/wrappers/traditional'
6+
7+
import 'lib/components/gallery/gallery.css'
68

79
const traditionalUploader = new TraditionalFineUploader({
810
options: {

0 commit comments

Comments
 (0)