FunctionDownloadableFiles

Component for rendering post-submission downloadable files such as PDFs and attachments. The only thing required is the formSubmissionResult.

It is also recommended to import the css from this library as well.

import { DownloadableFiles } from '@oneblink/apps-react'
import '@oneblink/apps-react/dist/styles.css'
import React from 'react'
import ReactDOM from 'react-dom'
import { DownloadableFiles } from '@oneblink/apps-react'
import '@oneblink/apps-react/dist/styles.css'

function SubmissionContainer() {

const [state, setState] = useState(null)

const handleSubmit = React.useCallback(async () => {
...
setState(result)
}, [])

return (
<div>
...
{state && (
<DownloadableFiles formSubmissionResult={state} />
)}
</div>
)
}

function App() {
return (
<IsOfflineContextProvider>
<SubmissionContainer />
</IsOfflineContextProvider>
)
}

const root = document.getElementById('root')
if (root) {
ReactDOM.render(<App />, root)
}
  • NOTE: Exotic components are not callable.

    Parameters

    • props: {
          divider?: boolean;
          formSubmissionResult: FormSubmissionResult;
          layout?: LayoutType;
      }
      • Optionaldivider?: boolean

        Whether to render a divider above the content.

      • formSubmissionResult: FormSubmissionResult

        The form submission with the pdf and/or attachments config on it.

      • Optionallayout?: LayoutType

        The layout to use for the downloadable files. Options are GRID and LIST. Defaults to GRID. GRID will render files next to each other at some screen sizes. LIST will always render each file on a new line.

    Returns null | ReactElement<any, string | JSXElementConstructor<any>>

Properties

$$typeof: symbol
displayName?: string
type: ((__namedParameters: {
    divider?: boolean;
    formSubmissionResult: FormSubmissionResult;
    layout?: LayoutType;
}) => null | Element)