Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed Feb 25, 2017
1 parent 7d69e52 commit 134a7e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/Converter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class Sanitizer extends Component {
<div className="row">
<div className="switch">
{
operations.map(op => (
Object.keys(fileTypes).map(op => (
<button
className={`switch__btn merge ${this.state.operation === op ? 'switch__btn-active' : ''}`}
onClick={() => this.setState({
Expand Down
1 change: 0 additions & 1 deletion src/helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
[CONVERT]: ['png', 'jpg', 'bmp', 'tiff'],
[MERGE]: ['pdf', 'gif']
},
operations: [MERGE, CONVERT],
blue,
lightBlue,
offwhite,
Expand Down
8 changes: 4 additions & 4 deletions src/helpers/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const filterImages = files => Object.keys(files)

const createOutputFileName = (files, outputType) => `ALCHEMY-${concatFiles(files)}.${outputType || 'pdf'}`

const centerEllipsis = str => (
(str.length > 15) ?
`${str.substr(0, 7)}...${str.substr(str.length - 7, str.length)}` :
function centerEllipsis(str, length = 7) {
return (str.length > (length * 2) + 1) ?
`${str.substr(0, length)}...${str.substr(str.length - length, str.length)}` :
str
)
}

// TODO curry?
const displayOutputFileName = (files, outputType) =>
Expand Down

0 comments on commit 134a7e0

Please sign in to comment.