-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(senate 🏛️): fixes and improvements (#1153)
Co-authored-by: Cheslav Zhuravsky <[email protected]>
- Loading branch information
1 parent
dbbb2c6
commit 142b2e8
Showing
25 changed files
with
387 additions
and
485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.votesContainer { | ||
background-color: #ffffff14; | ||
border-radius: 5px; | ||
overflow: hidden; | ||
height: 10px; | ||
width: 100%; | ||
display: flex; | ||
} | ||
|
||
.voteSection { | ||
display: flex; | ||
height: 100%; | ||
} | ||
|
||
.voteYes { | ||
background-color: #3ab793; | ||
} | ||
|
||
.voteAbstain { | ||
background-color: #ccdcff; | ||
} | ||
|
||
.voteNo { | ||
background-color: #ffcf65; | ||
} | ||
|
||
.voteNoWithVeto { | ||
background-color: #fe8a8a; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/containers/governance/ProposalsDetailTableComments.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import SearchResults from '../Search/SearchResults'; | ||
import { useParams } from 'react-router-dom'; | ||
import { useBackend } from 'src/contexts/backend/backend'; | ||
import { getIpfsHash } from 'src/utils/ipfs/helpers'; | ||
import { encodeSlash } from '../../utils/utils'; | ||
import { useState, useEffect } from 'react'; | ||
|
||
function ProposalsDetailTableComments() { | ||
const { proposalId } = useParams(); | ||
const { ipfsApi } = useBackend(); | ||
const proposalQuery = `bostrom proposal ${proposalId}`; | ||
const [processedQuery, setProcessedQuery] = useState(''); | ||
const noComments = ( | ||
<> | ||
there are no comments to this particle <br /> be the first and create one | ||
</> | ||
); | ||
useEffect(() => { | ||
const processQuery = async () => { | ||
const hash = await getIpfsHash(encodeSlash(proposalQuery)); | ||
if (hash) { | ||
setProcessedQuery(hash); | ||
} else { | ||
const newHash = await ipfsApi.addContent(proposalQuery); | ||
setProcessedQuery(newHash); | ||
} | ||
}; | ||
|
||
processQuery(); | ||
}, [proposalQuery, ipfsApi]); | ||
|
||
return ( | ||
<div style={{ marginTop: '20px' }}> | ||
<SearchResults | ||
query={processedQuery} | ||
noCommentText={noComments} | ||
actionBarTextBtn="Comment" | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export default ProposalsDetailTableComments; |
Oops, something went wrong.