Skip to content

Commit 041a402

Browse files
authored
feat(cat-voices): missing links pt2 (#2361)
* implement newsletter URL and update wallet links * feat: adding missing links
1 parent 2dafb7c commit 041a402

File tree

7 files changed

+123
-15
lines changed

7 files changed

+123
-15
lines changed

catalyst_voices/apps/voices/lib/app/view/app_mobile_access_restriction.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ class _Actions extends StatelessWidget with LaunchUrlMixin {
7070
const SizedBox(height: 52),
7171
VoicesFilledButton(
7272
child: Text(context.l10n.joinNewsletter),
73-
onTap: () {
74-
// TODO(LynxLynxx): implement url launching
73+
onTap: () async {
74+
await launchUri(VoicesConstants.joinNewsletterUrl.getUri());
7575
},
7676
),
7777
const SizedBox(height: 12),

catalyst_voices/apps/voices/lib/common/constants/constants.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ abstract class VoicesConstants {
4747
'https://docs.projectcatalyst.io/catalyst-tools/catalyst-app/my-account';
4848
static const insertNewImageDocsUrl =
4949
'https://docs.projectcatalyst.io/catalyst-tools/catalyst-app/create-and-submit-proposals-in-workspace/using-images';
50+
static const joinNewsletterUrl =
51+
'https://mpc.projectcatalyst.io/newsletter-signup';
5052

5153
static String cardanoScanStakeAddressUrl(ShelleyAddress stakeAddress) {
5254
switch (stakeAddress.network) {

catalyst_voices/apps/voices/lib/pages/registration/no_wallet_found_dialog.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,17 +259,17 @@ class _RightSide extends StatelessWidget {
259259
SupportedWallet(
260260
image: VoicesAssets.images.eternlWallet,
261261
name: context.l10n.eternlWallet,
262-
url: 'https://www.example.com', // TODO(LynxLynxx): add url
262+
url: 'https://eternl.io/',
263263
),
264264
SupportedWallet(
265265
image: VoicesAssets.images.laceWallet,
266266
name: context.l10n.laceWallet,
267-
url: 'https://www.example.com', // TODO(LynxLynxx): add url
267+
url: 'https://www.lace.io/',
268268
),
269269
SupportedWallet(
270270
image: VoicesAssets.images.namiWallet,
271271
name: context.l10n.namiWallet,
272-
url: 'https://www.example.com', // TODO(LynxLynxx): add url
272+
url: 'https://www.namiwallet.io/',
273273
),
274274
const VoicesDivider.expanded(),
275275
const Spacer(),

catalyst_voices/apps/voices/lib/pages/workspace/user_proposals/user_proposals.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,21 @@ class _UserProposalsState extends State<UserProposals> {
5454
items: _submitted,
5555
emptyTextMessage: context.l10n.noFinalUserProposals,
5656
title: context.l10n.submittedForReview(_submitted.length, 5),
57-
// TODO(LynxLynxx): update when we get info from designers
58-
info: 'Info',
57+
info: context.l10n.submittedForReviewInfoMarkdown,
5958
learnMoreUrl: VoicesConstants.proposalPublishingDocsUrl,
6059
),
6160
UserProposalSection(
6261
items: _draft,
6362
emptyTextMessage: context.l10n.noDraftUserProposals,
6463
title: context.l10n.sharedForPublicInProgress,
65-
// TODO(LynxLynxx): update when we get info from designers
66-
info: 'Info',
64+
info: context.l10n.sharedForPublicInfoMarkdown,
6765
learnMoreUrl: VoicesConstants.proposalPublishingDocsUrl,
6866
),
6967
UserProposalSection(
7068
items: _local,
7169
emptyTextMessage: context.l10n.noLocalUserProposals,
7270
title: context.l10n.notPublished,
73-
// TODO(LynxLynxx): update when we get info from designers
74-
info: 'Info',
71+
info: context.l10n.notPublishedInfoMarkdown,
7572
learnMoreUrl: VoicesConstants.proposalPublishingDocsUrl,
7673
),
7774
],

catalyst_voices/apps/voices/lib/widgets/headers/section_learn_more_header.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import 'package:catalyst_voices/common/ext/build_context_ext.dart';
22
import 'package:catalyst_voices/widgets/buttons/learn_more_button.dart';
3-
import 'package:catalyst_voices/widgets/widgets.dart';
3+
import 'package:catalyst_voices/widgets/tooltips/voices_markdown_tooltip.dart';
44
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
5-
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart';
65
import 'package:catalyst_voices_shared/catalyst_voices_shared.dart';
76
import 'package:flutter/material.dart';
87

@@ -43,8 +42,9 @@ class SectionLearnMoreHeader extends StatelessWidget with LaunchUrlMixin {
4342
),
4443
),
4544
const SizedBox(width: 4),
46-
VoicesPlainTooltip(
47-
message: context.l10n.learnMore,
45+
VoicesMarkdownTooltip(
46+
message: info,
47+
constraints: const BoxConstraints(maxWidth: 312),
4848
child: VoicesAssets.icons.informationCircle.buildIcon(
4949
color: context.colors.textOnPrimaryLevel1,
5050
),
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import 'package:catalyst_voices/common/ext/build_context_ext.dart';
2+
import 'package:catalyst_voices/widgets/common/affix_decorator.dart';
3+
import 'package:catalyst_voices/widgets/widgets.dart';
4+
import 'package:catalyst_voices_brands/catalyst_voices_brands.dart';
5+
import 'package:catalyst_voices_models/catalyst_voices_models.dart';
6+
import 'package:flutter/material.dart';
7+
8+
/// A tooltip widget that renders Markdown formatted text with a child widget.
9+
///
10+
/// **Notes:**
11+
/// - Supports Markdown syntax in the message
12+
/// - The tooltip's text is constrained to a maximum
13+
/// width of 200 pixels by default
14+
///
15+
/// **Usage:**
16+
/// ```dart
17+
/// VoicesMarkdownTooltip(
18+
/// message: "**Bold** and *italic* text",
19+
/// child: Icon(Icons.info),
20+
/// )
21+
/// ```
22+
class VoicesMarkdownTooltip extends StatelessWidget {
23+
/// The Markdown formatted message to display in the tooltip.
24+
final String message;
25+
26+
/// Optional widget that will be shown before the Markdown content.
27+
final Widget? leading;
28+
29+
/// Optional widget that will be shown after the Markdown content.
30+
final Widget? trailing;
31+
32+
/// Optional constraints for tooltip widget.
33+
final BoxConstraints constraints;
34+
35+
/// The widget that triggers tooltip visibility.
36+
final Widget child;
37+
38+
const VoicesMarkdownTooltip({
39+
super.key,
40+
required this.message,
41+
this.leading,
42+
this.trailing,
43+
this.constraints = const BoxConstraints(maxWidth: 200),
44+
required this.child,
45+
});
46+
47+
@override
48+
Widget build(BuildContext context) {
49+
final theme = Theme.of(context);
50+
51+
final textStyle = (theme.textTheme.bodySmall ?? const TextStyle()).copyWith(
52+
color: theme.colors.iconsBackground,
53+
);
54+
55+
return Tooltip(
56+
key: const Key('MarkdownTooltip'),
57+
richMessage: WidgetSpan(
58+
child: ConstrainedBox(
59+
key: const ValueKey('VoicesMarkdownTooltipContentKey'),
60+
constraints: constraints,
61+
child: DefaultTextStyle(
62+
style: textStyle,
63+
child: AffixDecorator(
64+
prefix: leading,
65+
suffix: trailing,
66+
gap: 12,
67+
child: MarkdownText(
68+
MarkdownData(message),
69+
pColor: context.colors.textOnPrimaryLevel0,
70+
),
71+
),
72+
),
73+
),
74+
),
75+
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
76+
decoration: BoxDecoration(
77+
color: theme.colors.elevationsOnSurfaceNeutralLv2,
78+
borderRadius: BorderRadius.circular(8),
79+
boxShadow: const [
80+
BoxShadow(
81+
offset: Offset(0, 2),
82+
blurRadius: 6,
83+
spreadRadius: 2,
84+
color: Color(0x02600000),
85+
),
86+
BoxShadow(
87+
offset: Offset(0, 1),
88+
blurRadius: 2,
89+
spreadRadius: 0,
90+
color: Color(0x4D000000),
91+
),
92+
],
93+
),
94+
child: child,
95+
);
96+
}
97+
}

catalyst_voices/packages/internal/catalyst_voices_localization/lib/l10n/intl_en.arb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,6 +2637,18 @@
26372637
"@invalidSeedPhraseWord": {
26382638
"description": "Error shown when user inputs SeedPhrase word but invalid does not match any"
26392639
},
2640+
"submittedForReviewInfoMarkdown": "**Locked final**\n\nThese proposals are finished/final, and published to the review stage. Final proposals enter the ballot on approval. You are allowed to publish a maximum of 5 proposals.\n\n**Important Note:**\n\nAll Publishing happens in the proposal editor, so you minimize the chances of making mistakes.",
2641+
"@submittedForReviewInfoMarkdown": {
2642+
"description": "Info message shown in tooltip info in workspace page"
2643+
},
2644+
"sharedForPublicInfoMarkdown": "**In progress**\n\nThese proposals are in progress/draft and published draft iterations make their rounds in the discovery space, and people can provide feedback.\n\nYou can make a new local iteration of a published draft, just be sure to share as draft if you want to receive feedback, or as final if you think your proposal is ready.\n\n**Important Note:**\n\nAll Publishing happens in the proposal editor, so you minimize the chances of making mistakes.",
2645+
"@sharedForPublicInfoMarkdown": {
2646+
"description": "Info message shown in tooltip info in workspace page"
2647+
},
2648+
"notPublishedInfoMarkdown": "**Not published**\n\nThese private proposals are only stored on your local device, and cannot be seen by anybody but you.",
2649+
"@notPublishedInfoMarkdown": {
2650+
"description": "Info message shown in tooltip info in workspace page"
2651+
},
26402652
"deleteLocalVersionIfWantToPublishThisVersion": "If you want to publish this iteration as final, please delete the local draft.",
26412653
"@deleteLocalVersionIfWantToPublishThisVersion": {
26422654
"description": "Message shown when user tries to publish a draft proposal as final proposal but there is a newer local draft proposal."

0 commit comments

Comments
 (0)