Compare commits

..

1 Commits

Author SHA1 Message Date
606e73c254 chore: add translations 2025-10-31 20:04:06 +00:00
9 changed files with 4604 additions and 3082 deletions

View File

@ -282,6 +282,18 @@ export const OrgMenuSwitcher = () => {
</DropdownMenuItem>
)}
<DropdownMenuItem className="text-muted-foreground px-4 py-2" asChild>
<Link to="/inbox">
<Trans>Personal Inbox</Trans>
</Link>
</DropdownMenuItem>
<DropdownMenuItem className="text-muted-foreground px-4 py-2" asChild>
<Link to="/settings/profile">
<Trans>Account</Trans>
</Link>
</DropdownMenuItem>
{currentOrganisation &&
canExecuteOrganisationAction(
'MANAGE_ORGANISATION',
@ -302,18 +314,6 @@ export const OrgMenuSwitcher = () => {
</DropdownMenuItem>
)}
<DropdownMenuItem className="text-muted-foreground px-4 py-2" asChild>
<Link to="/inbox">
<Trans>Personal Inbox</Trans>
</Link>
</DropdownMenuItem>
<DropdownMenuItem className="text-muted-foreground px-4 py-2" asChild>
<Link to="/settings/profile">
<Trans>Account</Trans>
</Link>
</DropdownMenuItem>
<DropdownMenuItem
className="text-muted-foreground px-4 py-2"
onClick={() => setLanguageSwitcherOpen(true)}

View File

@ -1,74 +0,0 @@
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react';
import { Trans } from '@lingui/react/macro';
import { CreditCardIcon } from 'lucide-react';
import { Link } from 'react-router';
import { useSession } from '@documenso/lib/client-only/providers/session';
import { IS_BILLING_ENABLED } from '@documenso/lib/constants/app';
import { ORGANISATION_MEMBER_ROLE_MAP } from '@documenso/lib/constants/organisations-translations';
import { formatAvatarUrl } from '@documenso/lib/utils/avatars';
import { canExecuteOrganisationAction } from '@documenso/lib/utils/organisations';
import { AvatarWithText } from '@documenso/ui/primitives/avatar';
import { Button } from '@documenso/ui/primitives/button';
import { Card, CardContent } from '@documenso/ui/primitives/card';
export const AccountBillingOrganisations = () => {
const { _ } = useLingui();
const { user, organisations } = useSession();
if (!IS_BILLING_ENABLED()) {
return null;
}
// Filter to only organisations where user can manage billing
const billingOrganisations = organisations.filter((org) =>
canExecuteOrganisationAction('MANAGE_BILLING', org.currentOrganisationRole),
);
if (billingOrganisations.length === 0) {
return null;
}
return (
<div className="max-w-xl">
<h3 className="text-foreground mb-2 text-lg font-semibold">
<Trans>Billing Management</Trans>
</h3>
<p className="text-muted-foreground mb-4 text-sm">
<Trans>Manage billing for organisations where you have billing permissions.</Trans>
</p>
<div className="space-y-3">
{billingOrganisations.map((org) => (
<Card key={org.id} className="overflow-hidden">
<CardContent className="p-4">
<div className="flex items-center justify-between">
<div className="flex items-center space-x-3">
<AvatarWithText
avatarSrc={formatAvatarUrl(org.avatarImageId)}
avatarClass="h-10 w-10"
avatarFallback={org.name.slice(0, 1).toUpperCase()}
primaryText={<span className="font-medium">{org.name}</span>}
secondaryText={
org.ownerUserId === user.id
? _(msg`Owner`)
: _(ORGANISATION_MEMBER_ROLE_MAP[org.currentOrganisationRole])
}
/>
</div>
<Button variant="outline" size="sm" asChild>
<Link to={`/o/${org.url}/settings/billing`}>
<CreditCardIcon className="mr-2 h-4 w-4" />
<Trans>Manage Billing</Trans>
</Link>
</Button>
</div>
</CardContent>
</Card>
))}
</div>
</div>
);
};

View File

@ -10,7 +10,6 @@ import { AnimateGenericFadeInOut } from '@documenso/ui/components/animate/animat
import { AccountDeleteDialog } from '~/components/dialogs/account-delete-dialog';
import { AvatarImageForm } from '~/components/forms/avatar-image';
import { ProfileForm } from '~/components/forms/profile';
import { AccountBillingOrganisations } from '~/components/general/organisations/account-billing-organisations';
import { SettingsHeader } from '~/components/general/settings-header';
import { TeamEmailUsage } from '~/components/general/teams/team-email-usage';
import { appMetaTags } from '~/utils/meta';
@ -48,8 +47,6 @@ export default function SettingsProfile() {
)}
</AnimatePresence>
<AccountBillingOrganisations />
<AccountDeleteDialog />
</div>
</div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff