Skip to content

Commit

Permalink
refactor: adjust proposal card redirection and button text
Browse files Browse the repository at this point in the history
  • Loading branch information
Zied-Dahmani committed Nov 18, 2024
1 parent b6b8162 commit 68d1389
Showing 1 changed file with 59 additions and 51 deletions.
110 changes: 59 additions & 51 deletions lib/ui/proposals/list/components/hypha_proposals_action_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,61 +24,69 @@ class HyphaProposalsActionCard extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Stack(
children: [
_buildVoteStatusOverlay(context),
HyphaCard(
child: Padding(
padding: const EdgeInsets.all(22),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ProposalHeader(_proposalModel.dao),
const Padding(
padding: EdgeInsets.symmetric(vertical: 18),
child: HyphaDivider(),
),
return GestureDetector(
onTap: () {
Get.Get.to(
ProposalDetailsPage(proposalId: _proposalModel.id,),
transition: Get.Transition.rightToLeft,
);
},
child: Stack(
children: [
_buildVoteStatusOverlay(context),
HyphaCard(
child: Padding(
padding: const EdgeInsets.all(22),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ProposalHeader(_proposalModel.dao),
const Padding(
padding: EdgeInsets.symmetric(vertical: 18),
child: HyphaDivider(),
),

Container(
alignment: Alignment.centerLeft,
height: 55,
child: Text(
_proposalModel.title ?? 'No title',
style: context.hyphaTextTheme.mediumTitles,
maxLines: 2,
Container(
alignment: Alignment.centerLeft,
height: 55,
child: Text(
_proposalModel.title ?? 'No title',
style: context.hyphaTextTheme.mediumTitles,
maxLines: 2,
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: ProposalPercentageIndicator(
'Unity',
_proposalModel.unityToPercent(),
_proposalModel.isPassing()
? HyphaColors.success
: HyphaColors.error,
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: ProposalPercentageIndicator(
'Unity',
_proposalModel.unityToPercent(),
_proposalModel.isPassing()
? HyphaColors.success
: HyphaColors.error,
),
),
),
ProposalPercentageIndicator(
'Quorum',
_proposalModel.quorumToPercent(),
_proposalModel.isPassing()
? HyphaColors.success
: HyphaColors.error),
const SizedBox(height: 20),
ProposalExpirationTimer(_proposalModel.formatExpiration(),),
const Padding(
padding: EdgeInsets.symmetric(vertical: 16),
child: HyphaDivider(),
),
_buildProposalCardFooter(
context,
_proposalModel.creator
),
],
ProposalPercentageIndicator(
'Quorum',
_proposalModel.quorumToPercent(),
_proposalModel.isPassing()
? HyphaColors.success
: HyphaColors.error),
const SizedBox(height: 20),
ProposalExpirationTimer(_proposalModel.formatExpiration(),),
const Padding(
padding: EdgeInsets.symmetric(vertical: 16),
child: HyphaDivider(),
),
_buildProposalCardFooter(
context,
_proposalModel.creator
),
],
),
),
),
),
],
],
),
);
}

Expand Down Expand Up @@ -124,7 +132,7 @@ class HyphaProposalsActionCard extends StatelessWidget {
children: [
Expanded(child: ProposalCreator(creator)),
ProposalButton(
'Details',
'Vote',
Icons.arrow_forward_ios,
() {
Get.Get.to(
Expand Down

0 comments on commit 68d1389

Please sign in to comment.