Skip to content

Commit e0cd6a8

Browse files
committed
feat: 🎸 use global to specify Dropbox app key
1 parent 82b236e commit e0cd6a8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎src/blocks/dropbox/index.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {BlockProps} from '../..';
44
const script = document.createElement('script');
55
script.type = 'text/javascript';
66
script.id = 'dropboxjs';
7-
script.setAttribute('data-app-key', 'n933i11a8tmjp1i');
7+
const DROPBOX_APP_KEY = (window as any).DROPBOX_APP_KEY;
8+
if (DROPBOX_APP_KEY) script.setAttribute('data-app-key', DROPBOX_APP_KEY);
89
script.src = 'https://www.dropbox.com/static/api/2/dropins.js';
910
document.body.append(script);
1011

@@ -13,9 +14,7 @@ declare const Dropbox: any;
1314
const DropboxUi: React.FC<BlockProps> = ({url, renderWrap}) => {
1415
const ref = React.useRef();
1516
React.useLayoutEffect(() => {
16-
console.log('Dropbox', Dropbox);
1717
if (!ref.current) return;
18-
console.log('ref.current', ref.current);
1918
const embed = (Dropbox as any).embed({
2019
link: url,
2120
file: {

0 commit comments

Comments
 (0)