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:
parent
b37aff52ca
commit
d6b8ff124b
1 changed files with 11 additions and 10 deletions
|
@ -109,15 +109,16 @@ export default class KoenigLexicalEditor extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
ReactComponent = () => {
|
ReactComponent = () => {
|
||||||
const API_VERSION = 'v1';
|
const cardConfig = {
|
||||||
const APPLICATION_ID = '8672af113b0a8573edae3aa3713886265d9bb741d707f6c01a486cde8c278980';
|
unsplash: {
|
||||||
|
defaultHeaders: {
|
||||||
const defaultHeaders = {
|
Authorization: `Client-ID 8672af113b0a8573edae3aa3713886265d9bb741d707f6c01a486cde8c278980`,
|
||||||
Authorization: `Client-ID ${APPLICATION_ID}`,
|
'Accept-Version': 'v1',
|
||||||
'Accept-Version': API_VERSION,
|
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'App-Pragma': 'no-cache',
|
'App-Pragma': 'no-cache',
|
||||||
'X-Unsplash-Cache': true
|
'X-Unsplash-Cache': true
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const [uploadProgress, setUploadProgress] = React.useState(0);
|
const [uploadProgress, setUploadProgress] = React.useState(0);
|
||||||
|
@ -158,7 +159,7 @@ export default class KoenigLexicalEditor extends Component {
|
||||||
<ErrorHandler>
|
<ErrorHandler>
|
||||||
<Suspense fallback={<p className="koenig-react-editor-loading">Loading editor...</p>}>
|
<Suspense fallback={<p className="koenig-react-editor-loading">Loading editor...</p>}>
|
||||||
<KoenigComposer
|
<KoenigComposer
|
||||||
unsplashConfig={defaultHeaders}
|
cardConfig={cardConfig}
|
||||||
initialEditorState={this.args.lexical}
|
initialEditorState={this.args.lexical}
|
||||||
onError={this.onError}
|
onError={this.onError}
|
||||||
imageUploadFunction={{imageUploader, uploadProgress}}
|
imageUploadFunction={{imageUploader, uploadProgress}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue