-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1103 from datopian/feat/portaljs-components-impro…
…vements Components API and docs improvements Related to: #1089
- Loading branch information
Showing
31 changed files
with
547 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@portaljs/components': major | ||
--- | ||
|
||
Components API tidying up and storybook docs improvements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import { CSSProperties } from "react"; | ||
import { CSSProperties } from 'react'; | ||
import { Data } from '../types/properties'; | ||
|
||
export interface IframeProps { | ||
url: string; | ||
data: Required<Pick<Data, 'url'>>; | ||
style?: CSSProperties; | ||
} | ||
|
||
export function Iframe({ | ||
url, style | ||
}: IframeProps) { | ||
export function Iframe({ data, style }: IframeProps) { | ||
const url = data.url; | ||
return ( | ||
<iframe src={url} style={style ?? { width: `100%`, height: `100%` }}></iframe> | ||
<iframe | ||
src={url} | ||
style={style ?? { width: `100%`, height: `100%` }} | ||
></iframe> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
// Core viewer | ||
import { Viewer, Worker, SpecialZoomLevel } from '@react-pdf-viewer/core'; | ||
import { defaultLayoutPlugin } from '@react-pdf-viewer/default-layout'; | ||
import { Data } from '../types/properties'; | ||
|
||
// Import styles | ||
import '@react-pdf-viewer/core/lib/styles/index.css'; | ||
import '@react-pdf-viewer/default-layout/lib/styles/index.css'; | ||
|
||
export interface PdfViewerProps { | ||
url: string; | ||
data: Required<Pick<Data, 'url'>>; | ||
layout: boolean; | ||
parentClassName?: string; | ||
} | ||
|
||
export function PdfViewer({ | ||
url, | ||
data, | ||
layout = false, | ||
parentClassName, | ||
parentClassName = 'h-screen', | ||
}: PdfViewerProps) { | ||
const url = data.url; | ||
const defaultLayoutPluginInstance = defaultLayoutPlugin(); | ||
return ( | ||
<Worker workerUrl="https://unpkg.com/[email protected]/build/pdf.worker.js"> | ||
|
Oops, something went wrong.