Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This PR adds Project creation functionality #2

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Sample from './components/Sample/Sample'
import Disputes from './components/Dashboard/Dashboard'
import { WalletProvider } from './providers/Wallet'
import { ActivityProvider } from './components/Activity/ActivityProvider'
// import { TokenContext } from './components/Profile/APIcall'

function App() {
return (
Expand Down
13 changes: 1 addition & 12 deletions src/components/Dashboard/Dashboard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable prettier/prettier */

import React, { useCallback, useMemo, useState } from 'react'
import { Header } from '@aragon/ui'

Expand All @@ -26,17 +25,7 @@ function Dashboard() {
{selectedDispute ? (
<DisputeDetail dispute={selectedDispute} onBack={handleBack} />
) : (
<DisputeList
disputes={disputes}
selectDispute={selectDispute}
// filteredDisputes={filteredDisputes}
// disputeStatusFilter={disputeStatusFilter}
// handleDisputeStatusFilterChange={handleDisputeStatusFilterChange}
// disputeAppFilter={disputeAppFilter}
// handleDisputeAppFilterChange={handleDisputeAppFilterChange}
// handleClearFilters={handleClearFilters}
// executionTargets={executionTargets}
/>
<DisputeList disputes={disputes} selectDispute={selectDispute} />
)}
</React.Fragment>
)
Expand Down
66 changes: 35 additions & 31 deletions src/components/Profile/APIcall.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ function APIcall() {
.then((response) => response.json())
.then(({ token }) => localStorage.setItem('ACCESS TOKEN', token))

// if (boolButtonText === 'CONNECT') {
// setBoolButtonText('DISCONNECT')
// } else {
// setBoolButtonText('CONNECT')
// }
setBoolButtonText('DISCONNECT')
}

Expand All @@ -36,34 +31,43 @@ function APIcall() {

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

const TokenContext = React.createContext(localStorage.getItem('ACCESS TOKEN'))
const TokenContext = React.createContext()

let TokenSave = localStorage.getItem('ACCESS TOKEN')

return (
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button mode='normal'>
{localStorage.getItem('ACCESS TOKEN') ? (
<GitHubLogin
clientId='69bc88033c4b1bc2b4dc'
redirectUri='http://localhost:3000/'
onSuccess={onSuccess_disconnect}
onFailure={onFailure_disconnect}
buttonText={boolButtonText_disconnect}
// buttonText='DISCONNECT'
className='buttonCustomStyle'
/>
) : (
<GitHubLogin
clientId='69bc88033c4b1bc2b4dc'
redirectUri='http://localhost:3000/'
onSuccess={onSuccess}
onFailure={onFailure}
buttonText={boolButtonText}
//buttonText='CONNECT'
className='buttonCustomStyle'
/>
)}
</Button>
</div>
(
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<Button mode='normal'>
{localStorage.getItem('ACCESS TOKEN') ? (
<GitHubLogin
clientId='69bc88033c4b1bc2b4dc'
redirectUri='http://localhost:3000/'
onSuccess={onSuccess_disconnect}
onFailure={onFailure_disconnect}
buttonText={boolButtonText_disconnect}
className='buttonCustomStyle'
/>
) : (
<GitHubLogin
clientId='69bc88033c4b1bc2b4dc'
redirectUri='http://localhost:3000/'
onSuccess={onSuccess}
onFailure={onFailure}
buttonText={boolButtonText}
className='buttonCustomStyle'
/>
)}
</Button>
</div>
),
(
<TokenContext.Provider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Context code block is hiding the CONNECT DISCONNECT button for some reason.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was for testing purpose only, will remove it in the next commit

value={{
TokenSave,
}}
></TokenContext.Provider>
)
)
}

Expand Down