-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update Proposal list #1472
Merged
Merged
Update Proposal list #1472
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
d2c3ff8
update Badge component with updated designs
Da-Colon f0e2538
create badge to display quorum
Da-Colon 910092c
update badge to use meetQuroum for linearERC20Strategy
Da-Colon 976ae20
update hover colors for timelock and frozen badges
Da-Colon 04c06ec
update Activity/Proposal description and title to updated designs
Da-Colon 19eaac2
add author to Description
Da-Colon f2df8cc
Replace ActivityGovernance with Updated ProposalCard
Da-Colon 680a38e
replace ActivityGovernance with ProposalCard
Da-Colon 4e2c15e
update to lastest badge colors
Da-Colon 4e2941c
remove unused file
Da-Colon 4fe5fa3
remove comments
Da-Colon 8e873f1
run lint/pretty
Da-Colon b496ced
fix badge colors
Da-Colon 574fbc8
fix alignment
Da-Colon 3bd3ecc
pretty/lint run
Da-Colon 7eff319
remove fragment
Da-Colon b728ea0
update colors to match figma
Da-Colon 36f73db
adjust padding
Da-Colon 3b0d3a6
clean up logic around description and title to more closely match des…
Da-Colon 72690ec
remove comment
Da-Colon f40fa6a
switch back to previous way to calc quorum
Da-Colon bdb272e
run pretty/lint
Da-Colon 533cf46
remove unused package
Da-Colon c51a58a
remove ugly hardcoded values
Da-Colon 6e8507e
update markdown css with maxWidth 0 to allow content to shrink
Da-Colon 2886d03
run pretty/lint
Da-Colon 78aa6e4
revent author on details screen
Da-Colon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 was deleted.
Oops, something went wrong.
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,76 @@ | ||
import { Box, Flex, Image, Text } from '@chakra-ui/react'; | ||
import { format } from 'date-fns'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Link } from 'react-router-dom'; | ||
import { DAO_ROUTES } from '../../../constants/routes'; | ||
import { useFractal } from '../../../providers/App/AppProvider'; | ||
import { ActivityEventType, FractalProposal, SnapshotProposal } from '../../../types'; | ||
import { DEFAULT_DATE_FORMAT } from '../../../utils'; | ||
import { ActivityDescription } from '../../Activity/ActivityDescription'; | ||
import { Badge } from '../../ui/badges/Badge'; | ||
import QuorumBadge from '../../ui/badges/QuorumBadge'; | ||
|
||
function ProposalCard({ proposal }: { proposal: FractalProposal }) { | ||
const { | ||
node: { daoAddress }, | ||
} = useFractal(); | ||
const { t } = useTranslation('common'); | ||
|
||
const eventDateLabel = t( | ||
proposal.eventType === ActivityEventType.Treasury | ||
? proposal.transaction?.to === daoAddress | ||
? 'received' | ||
: 'sent' | ||
: 'created', | ||
); | ||
|
||
const isSnapshotProposal = !!(proposal as SnapshotProposal).snapshotProposalId; | ||
|
||
return ( | ||
<Link to={DAO_ROUTES.proposal.relative(daoAddress, proposal.proposalId)}> | ||
<Box | ||
minHeight="6.25rem" | ||
bg="chocolate.900" | ||
_hover={{ bg: '#0B0A09' }} | ||
Da-Colon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
p="1.5rem" | ||
borderRadius="0.5rem" | ||
> | ||
{/* Top Row */} | ||
<Flex justifyContent="space-between"> | ||
<Flex | ||
gap={2} | ||
alignItems="center" | ||
> | ||
<Badge | ||
labelKey={proposal.state!} | ||
size="sm" | ||
proposal={proposal} | ||
/> | ||
{isSnapshotProposal && ( | ||
<Image | ||
src="/images/snapshot-icon-fill.svg" | ||
alt={t('snapshot')} | ||
ml={1} | ||
/> | ||
)} | ||
</Flex> | ||
<QuorumBadge proposal={proposal} /> | ||
</Flex> | ||
<ActivityDescription activity={proposal} /> | ||
<Box> | ||
{proposal.eventDate && ( | ||
<Text | ||
mt={2} | ||
textStyle="text-base-sans-regular" | ||
color="#838383" | ||
Da-Colon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> | ||
{eventDateLabel} {format(proposal.eventDate, DEFAULT_DATE_FORMAT)} | ||
</Text> | ||
)} | ||
</Box> | ||
</Box> | ||
</Link> | ||
); | ||
} | ||
|
||
export default ProposalCard; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main entry to changes. Replaces current
ActivityGovernance
component.