Skip to content

Commit

Permalink
Merge pull request #10 from trussworks/pm-add-xls-unsupported-view
Browse files Browse the repository at this point in the history
update unsupported view
  • Loading branch information
pearl-truss authored Jan 4, 2023
2 parents ece2793 + a797d75 commit 9c74c57
Show file tree
Hide file tree
Showing 7 changed files with 447 additions and 520 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ case 'rtf':
return RtfViewer;
```

### Viewing local changes in a secondary repo

If you are working on a feature branch and need to see changes introduced in that branch in another repo that using this library, here are the steps:

1. Run `yarn build` in this react-file-viewer repo
2. In the secondary repo, update `package.json` to point the trussworks/react-file-viewer declaration to your branch in the react-file-viewer repo:

```
"@trussworks/react-file-viewer": "git+https://github.com/trussworks react-file-viewer#your-branch-name"
```

3. In the secondary repo, reinstall frontend packages and then run the client.

4. When your react-file-viewer branch is merged into main, update the `package.json` in the secondary repo to declare the react-file-viewer libary normally

`"@trussworks/react-file-viewer": "git+https://github.com/trussworks react-file-viewer"`

## Roadmap

- [ ] Remove ignored linting rules and fix them
Expand Down
9 changes: 2 additions & 7 deletions dist/index.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions dist/index.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* @license
* Copyright 2010-2022 Three.js Authors
* SPDX-License-Identifier: MIT
*/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"sass-loader": "^10.1.1",
"style-loader": "^1.2.1",
"url-loader": "^4.1.0",
"webpack": "^4.43.0",
"webpack": "^5.75.0",
"webpack-bundle-analyzer": "^3.8.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
Expand Down
22 changes: 14 additions & 8 deletions src/components/drivers/unsupported-viewer.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
// Copyright (c) 2017 PlanGrid, Inc.

import React from 'react';
import 'styles/unsupported.scss';
import React from 'react'
import 'styles/unsupported.scss'

const UnsupportedViewer = props => (
const UnsupportedViewer = (props) => (
<div className="pg-driver-view">
<div className="unsupported-message">
{props.unsupportedComponent
? <props.unsupportedComponent {...props} />
: <p className="alert"><b>{`.${props.fileType}`}</b> is not supported.</p>}
{props.unsupportedComponent ? (
<props.unsupportedComponent {...props} />
) : (
<p>
No preview available for this kind of file.
<br />
Download file to see the contents.
</p>
)}
</div>
</div>
);
)

export default UnsupportedViewer;
export default UnsupportedViewer
7 changes: 6 additions & 1 deletion src/styles/unsupported.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

.unsupported-message {
padding: 46px;
background: white;
background: #DCDEE0;
color: #3D4551;
margin: auto;
text-align: center;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
Loading

0 comments on commit 9c74c57

Please sign in to comment.