Skip to content

Commit c800520

Browse files
adds button toggle, removes br tag, improves styling for the sidepanel
1 parent d3d05ce commit c800520

File tree

3 files changed

+55
-33
lines changed

3 files changed

+55
-33
lines changed

debug.log

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
[0526/174216.771:ERROR:crash_report_database_win.cc(469)] failed to stat report
1010
[0527/122222.926:ERROR:crash_report_database_win.cc(469)] failed to stat report
1111
[0527/122222.929:ERROR:crash_report_database_win.cc(469)] failed to stat report
12+
[0527/213826.020:ERROR:crash_report_database_win.cc(469)] failed to stat report
13+
[0527/213826.031:ERROR:crash_report_database_win.cc(469)] failed to stat report
14+
[0528/151733.993:ERROR:crash_report_database_win.cc(469)] failed to stat report
15+
[0528/151734.019:ERROR:crash_report_database_win.cc(469)] failed to stat report

src/components/Dashboard/APIcall.js

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/* eslint-disable */
2-
import React, { useState } from 'react'
2+
import React, { useState, useEffect } from 'react'
33
import GitHubLogin from 'react-github-login'
44
import { Button } from '@aragon/ui'
55
import './test.css'
6-
import { Octokit } from '@octokit/rest'
76

87
function APIcall() {
98
const [boolButtonText, setBoolButtonText] = useState('CONNECT')
10-
11-
const [boolSwitch, setboolSwitch] = useState(false)
9+
const [boolButtonText_disconnect, setBoolButtonText_disconnect] = useState(
10+
'DISCONNECT'
11+
)
1212

1313
const onSuccess = function(details) {
1414
const code = details.code
@@ -17,28 +17,58 @@ function APIcall() {
1717
.then((response) => response.json())
1818
.then(({ token }) => localStorage.setItem('ACCESS TOKEN', token))
1919

20-
if (boolButtonText === 'CONNECT') {
21-
setBoolButtonText('DISCONNECT')
22-
} else {
23-
setBoolButtonText('CONNECT')
24-
}
20+
// if (boolButtonText === 'CONNECT') {
21+
// setBoolButtonText('DISCONNECT')
22+
// } else {
23+
// setBoolButtonText('CONNECT')
24+
// }
25+
setBoolButtonText('DISCONNECT')
26+
}
27+
28+
const onSuccess_disconnect = function() {
29+
localStorage.removeItem('ACCESS TOKEN')
30+
setBoolButtonText_disconnect('CONNECT')
31+
}
2532

26-
setboolSwitch(true)
33+
const onFailure_disconnect = function() {
34+
return null
2735
}
2836

2937
const onFailure = (response) => console.error(response)
3038

3139
return (
3240
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
3341
<Button mode='normal'>
34-
<GitHubLogin
42+
{localStorage.getItem('ACCESS TOKEN') ? (
43+
<GitHubLogin
44+
clientId='69bc88033c4b1bc2b4dc'
45+
redirectUri='http://localhost:3000/'
46+
onSuccess={onSuccess_disconnect}
47+
onFailure={onFailure_disconnect}
48+
buttonText={boolButtonText_disconnect}
49+
// buttonText='DISCONNECT'
50+
className='testcss'
51+
/>
52+
) : (
53+
<GitHubLogin
54+
clientId='69bc88033c4b1bc2b4dc'
55+
redirectUri='http://localhost:3000/'
56+
onSuccess={onSuccess}
57+
onFailure={onFailure}
58+
buttonText={boolButtonText}
59+
//buttonText='CONNECT'
60+
className='testcss'
61+
/>
62+
)}
63+
64+
{/* <GitHubLogin
3565
clientId='69bc88033c4b1bc2b4dc'
3666
redirectUri='http://localhost:3000/'
3767
onSuccess={onSuccess}
3868
onFailure={onFailure}
3969
buttonText={boolButtonText}
4070
className='testcss'
41-
/>
71+
/> */}
4272
</Button>
4373
</div>
4474
)

src/components/Disputes/Import.js

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,32 +74,20 @@ function Import() {
7474
) : null}
7575

7676
<SidePanel onClose={handleClose} title='Repository' opened={opened}>
77-
<br />
78-
<br />
79-
<br />
80-
8177
<DropDown
8278
selected={selected}
8379
onChange={handleOnChange}
8480
items={[...list]}
81+
style={{ marginTop: '4rem' }}
8582
/>
86-
<br />
87-
88-
<div
89-
css={`
90-
padding: ${1 * GU}px;
91-
`}
92-
>
93-
<TextInput placeholder='Provide a Name' />
94-
</div>
95-
96-
<br />
97-
<TextInput placeholder='Budget' />
98-
<br />
99-
<br />
100-
<br />
101-
<br />
102-
<Button mode='positive'>Import Project</Button>
83+
84+
<TextInput style={{ marginTop: '2rem' }} placeholder='Provide a Name' />
85+
86+
<TextInput style={{ marginTop: '2rem' }} placeholder='Budget' />
87+
88+
<Button style={{ marginTop: '4rem' }} mode='positive'>
89+
Import Project
90+
</Button>
10391
</SidePanel>
10492
</>
10593
)

0 commit comments

Comments
 (0)