Skip to content

Commit 81135de

Browse files
committed
update
1 parent 178ddba commit 81135de

File tree

4 files changed

+346
-3871
lines changed

4 files changed

+346
-3871
lines changed

components/EditPagePanel.js

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,26 @@ import React from 'react';
33
const PATTERN = Buffer.from('NDI0Mg==', 'base64').toString();
44
const WIDTH = 55;
55

6+
const MARKDOC_CLIENT_ID = '3a8716adbaa6294da1ec';
67
function CreatePRButton({ createPR }) {
7-
const [prNumber, setPrNumber] = React.useState(null);
88
const [loading, setLoading] = React.useState(false);
99

10-
if (prNumber) {
11-
return (
12-
<div className="modal">
13-
Thank you for contributing! View your PR{' '}
14-
<a href={`https://github.com/markdoc/docs/pull/${prNumber}`}>here</a>
15-
<style jsx>{`
16-
.modal {
17-
z-index: 1000;
18-
padding: 100px;
19-
position: fixed;
20-
/* width: 400px; */
21-
/* height: 14px; */
22-
top: 0;
23-
bottom: 0;
24-
left: 0;
25-
right: 0;
26-
background: white;
27-
}
28-
`}</style>
29-
</div>
30-
);
31-
}
32-
3310
return (
3411
<div>
3512
<button
3613
className="create-pr-btn"
3714
onClick={async () => {
15+
// TODO: oauth is so annoying. We have to auth this and then get the code back, pass that to the server, but
16+
// it makes the UX annoying
17+
window.open(
18+
`https://github.com/login/oauth/authorize?client_id=${MARKDOC_CLIENT_ID}&redirect_uri=${window.location.href}`
19+
);
3820
setLoading(true);
3921
const prNumber = await createPR();
40-
setPrNumber(prNumber);
22+
window.open(
23+
`https://github.com/markdoc/docs/pull/${prNumber}`,
24+
'_blank'
25+
);
4126
setLoading(false);
4227
}}
4328
>

0 commit comments

Comments
 (0)