Skip to content

Commit

Permalink
feat: add a deployed app with latest react adobe embed component
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziping Liu committed Oct 27, 2023
1 parent 3db1312 commit cbdd7f7
Show file tree
Hide file tree
Showing 8 changed files with 445 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/canaryapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build and Deploy

on:
push:
branches: [ "slave" ]
pull_request:
branches: [ "slave" ]

jobs:
build:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
- name: Build and then Deploy the static react canary app that uses the react adobe coponent
uses: omkartapale/react-deployment-gh-pages@v1.0.0


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
build
122 changes: 122 additions & 0 deletions canary/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { HashRouter as Router, Route, Link, Routes } from 'react-router-dom';

import ReactViewAdobe from "../src/index"

export const App = () => {

return (
<Router>
<header>
<nav className='navbar navbar-default navbar-fixed'>
<div className="container">
<div className="navbar-header">
<div className="navbar-collapse">

<ul style={{
display: "inline-flex",
flexDirection: "row",
justifyContent: "center",
alignItems: "center",
alignContent: "center",
listStyle: "none",
margin: "0",

}} className="nav navbar-nav">
<li className="dropdown">
<Link
style={{
textDecoration: "none",
padding: "10px",
}}
className="dropdown" to="/test">Test Route</Link>
</li>
<li className="dropdown">
<Link
style={{
textDecoration: "none",
padding: "10px",
}}
className='dropdown' to="/home">Home Route</Link>
</li>
</ul>
</div>
</div>
</div>

</nav>

</header>
<Routes>
<Route path="/test" element={
<div className="section container">
<div className="row">
<div className="col s12">
<h5 data-testid="test-route" className="header">Test Route View</h5>
<iframe src="https://ziping-liu-corporation.github.io/react-adobe-embed" style={{
width: "100%",
height: "900px",
border: "1px solid black",
alignContent: "center",
justifyContent: "center",

}}></iframe>
</div>
</div>
</div>
} />
<Route path="*" element={
<ReactViewAdobe
previewConfig={
{
embedMode: "FULL_WINDOW",
defaultViewMode: "FIT_PAGE",

enableLinearization: true,


}
}

fileMeta= {
{
"fileName": "23andMe_Ancestry_Book.pdf",
}
}

style={{
width: "100%",
height: "900px",
border: "1px solid black",
alignContent: "center",
justifyContent: "center",

}}
url="https://storage.googleapis.com/laotzu/awslegal/notarized/23andMe_Ancestry_Book.pdf"
clientId={
window.location.hostname === 'localhost' ?
'324caa2a91b84f688935436cd2d25217' :
'9c16d364507948289a9f65f9ab9da8bf'}
/>
} />
</Routes>
</Router>
);
}


const appelem = document.getElementById('app');

if (appelem) {

const reactrootapp = ReactDOM.createRoot(appelem);

reactrootapp.render(<App />);

}





Loading

0 comments on commit cbdd7f7

Please sign in to comment.