Skip to content

Commit

Permalink
chore: add translations
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Nov 4, 2024
1 parent f444a78 commit 2c9d1e6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ class _FreePlanUpgradeButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
final isOwner = context
.watch<UserWorkspaceBloc>()
.state
.currentWorkspaceMember
?.role
.isOwner ??
false;
return Container(
alignment: Alignment.centerLeft,
child: FlowyTooltip(
Expand All @@ -233,16 +240,26 @@ class _FreePlanUpgradeButton extends StatelessWidget {
),
hoverColor: context.proSecondaryColor.withOpacity(0.9),
onTap: () {
showToastNotification(
context,
message:
LocaleKeys.settings_sites_namespace_redirectToPayment.tr(),
type: ToastificationType.info,
);
if (isOwner) {
showToastNotification(
context,
message:
LocaleKeys.settings_sites_namespace_redirectToPayment.tr(),
type: ToastificationType.info,
);

context.read<SettingsSitesBloc>().add(
const SettingsSitesEvent.upgradeSubscription(),
);
context.read<SettingsSitesBloc>().add(
const SettingsSitesEvent.upgradeSubscription(),
);
} else {
showToastNotification(
context,
message: LocaleKeys
.settings_sites_namespace_pleaseAskOwnerToSetHomePage
.tr(),
type: ToastificationType.info,
);
}
},
),
),
Expand Down
3 changes: 2 additions & 1 deletion frontend/resources/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@
"updateExistingNamespace": "Update existing namespace",
"upgradeToPro": "Upgrade to Pro Plan to set a homepage",
"redirectToPayment": "Redirecting to payment page...",
"onlyWorkspaceOwnerCanSetHomePage": "Only the workspace owner can set a homepage"
"onlyWorkspaceOwnerCanSetHomePage": "Only the workspace owner can set a homepage",
"pleaseAskOwnerToSetHomePage": "Please ask the workspace owner to upgrade to Pro Plan"
},
"publishedPage": {
"title": "All published pages",
Expand Down

0 comments on commit 2c9d1e6

Please sign in to comment.