0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Updated <KoenigComposer> props to use generic cardConfig object

refs aed55d415d

- `unsplashConfig` has changed to a generic `cardConfig` object
This commit is contained in:
Kevin Ansfield 2023-02-10 11:13:57 +00:00
parent b37aff52ca
commit d6b8ff124b
No known key found for this signature in database

View file

@ -109,15 +109,16 @@ export default class KoenigLexicalEditor extends Component {
}
ReactComponent = () => {
const API_VERSION = 'v1';
const APPLICATION_ID = '8672af113b0a8573edae3aa3713886265d9bb741d707f6c01a486cde8c278980';
const defaultHeaders = {
Authorization: `Client-ID ${APPLICATION_ID}`,
'Accept-Version': API_VERSION,
'Content-Type': 'application/json',
'App-Pragma': 'no-cache',
'X-Unsplash-Cache': true
const cardConfig = {
unsplash: {
defaultHeaders: {
Authorization: `Client-ID 8672af113b0a8573edae3aa3713886265d9bb741d707f6c01a486cde8c278980`,
'Accept-Version': 'v1',
'Content-Type': 'application/json',
'App-Pragma': 'no-cache',
'X-Unsplash-Cache': true
}
}
};
const [uploadProgress, setUploadProgress] = React.useState(0);
@ -158,7 +159,7 @@ export default class KoenigLexicalEditor extends Component {
<ErrorHandler>
<Suspense fallback={<p className="koenig-react-editor-loading">Loading editor...</p>}>
<KoenigComposer
unsplashConfig={defaultHeaders}
cardConfig={cardConfig}
initialEditorState={this.args.lexical}
onError={this.onError}
imageUploadFunction={{imageUploader, uploadProgress}}