Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions frontend/src/Pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function Page() {
const {
state: { organizations, routerState },
} = useRemails();
const { subscription } = useSubscription();
const { currentSubscription } = useSubscription();

if (organizations?.length === 0 && routerState.name != "invite") {
return <Setup />;
Expand All @@ -67,8 +67,8 @@ function Page() {
!(routerState.name === "settings") &&
!routerState.name.startsWith("organizations") &&
!routerState.name.startsWith("admin") &&
subscription &&
subscription.status !== "active"
currentSubscription &&
currentSubscription.status !== "active"
) {
return <SetupSubscription />;
}
Expand Down
25 changes: 25 additions & 0 deletions frontend/src/components/InfoTooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { MantineSize, ThemeIcon, Tooltip } from "@mantine/core";
import { IconInfoCircle } from "@tabler/icons-react";

interface InfoTooltipProps {
text: string;
size?: MantineSize | number;
}

export default function InfoTooltip({ text, size }: InfoTooltipProps) {
return (
<Tooltip
label={text}
styles={{
tooltip: {
maxWidth: "40em",
whiteSpace: "normal",
},
}}
>
<ThemeIcon variant="transparent" c="dimmed" size={size ?? "sm"}>
<IconInfoCircle />
</ThemeIcon>
</Tooltip>
);
}
4 changes: 2 additions & 2 deletions frontend/src/components/SetupSubscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { IconReload } from "@tabler/icons-react";
import { useOrganizations } from "../hooks/useOrganizations.ts";

export default function SetupSubscription() {
const { subscription, reloadSubscription, navigateToSales } = useSubscription();
const { currentSubscription, reloadSubscription, navigateToSales } = useSubscription();
const { currentOrganization } = useOrganizations();

if (!currentOrganization || !subscription) {
if (!currentOrganization || !currentSubscription) {
return null;
}

Expand Down
10 changes: 3 additions & 7 deletions frontend/src/components/domains/DomainVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { useOrganizations } from "../../hooks/useOrganizations.ts";
import { useRemails } from "../../hooks/useRemails.ts";
import { useDomains } from "../../hooks/useDomains.ts";
import { VerifyResult } from "../../types.ts";
import { IconInfoCircle } from "@tabler/icons-react";
import { Badge, Button, Code, Group, Loader, Paper, Popover, Table, Text, ThemeIcon, Tooltip } from "@mantine/core";
import { Badge, Button, Code, Group, Loader, Paper, Popover, Table, Text } from "@mantine/core";
import { dkimRecord, dmarcValue, spfRecord } from "./DnsRecords.tsx";
import { useVerifyDomain } from "../../hooks/useVerifyDomain.ts";
import { formatDateTime } from "../../util.ts";
import { CopyableCode } from "../CopyableCode.tsx";
import React, { useState } from "react";
import InfoTooltip from "../InfoTooltip.tsx";

const badgeColors: { [key in VerifyResult["status"]]: string } = {
Success: "green",
Expand Down Expand Up @@ -157,11 +157,7 @@ export default function DomainVerification() {
recordValue: (
<Group gap="xs">
any
<Tooltip label="Some mail services may require an A record to be set for the sender domain">
<ThemeIcon variant="transparent" c="dimmed" size="sm">
<IconInfoCircle />
</ThemeIcon>
</Tooltip>
<InfoTooltip text="Some mail services may require an A record to be set for the sender domain" />
</Group>
),
verifyResult: verificationResult?.a,
Expand Down
54 changes: 13 additions & 41 deletions frontend/src/components/emails/EmailOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
import {
Accordion,
ActionIcon,
Badge,
Box,
Button,
Code,
Group,
MultiSelect,
NativeSelect,
Text,
ThemeIcon,
Tooltip,
} from "@mantine/core";
import { Accordion, ActionIcon, Badge, Box, Button, Code, Group, MultiSelect, NativeSelect, Text } from "@mantine/core";
import { useEmails } from "../../hooks/useEmails.ts";
import { Loader } from "../../Loader.tsx";
import { formatDateTime } from "../../util.ts";
import { useRemails } from "../../hooks/useRemails.ts";
import {
IconArrowLeft,
IconArrowRight,
IconCheck,
IconClock,
IconEye,
IconInfoCircle,
IconRefresh,
IconX,
} from "@tabler/icons-react";
import { IconArrowLeft, IconArrowRight, IconCheck, IconClock, IconEye, IconRefresh, IconX } from "@tabler/icons-react";
import { getFullStatusDescription } from "./EmailDetails.tsx";
import { DateTimePicker } from "@mantine/dates";
import dayjs from "dayjs";
Expand All @@ -38,6 +16,7 @@ import Label from "./Label.tsx";
import { EmailStatus } from "../../types.ts";
import OrganizationHeader from "../organizations/OrganizationHeader.tsx";
import ProjectLink from "../ProjectLink.tsx";
import InfoTooltip from "../InfoTooltip.tsx";

function statusIcons(status: EmailStatus) {
if (status == "processing" || status == "accepted") {
Expand Down Expand Up @@ -184,30 +163,23 @@ export function EmailOverview() {
<>
{routerState.name == "emails" && <OrganizationHeader />}

{routerState.name == "emails" ? (
<InfoAlert stateName="messages">
This page shows a list of all emails sent in this organization. Use it to check delivery status, inspect
metadata, and troubleshoot issues. You’ll see timestamps, recipient addresses, and SMTP-level details for each
message.
</InfoAlert>
) : (
<InfoAlert stateName="messages">
This page shows a list of all emails sent in this project. Use it to check delivery status, inspect metadata,
and troubleshoot issues. You’ll see timestamps, recipient addresses, and SMTP-level details for each message.
</InfoAlert>
)}
<InfoAlert stateName="messages">
This page shows a list of all emails sent in this {routerState.name == "emails" ? "organization" : "project"}.
Use it to check delivery status, inspect metadata, and troubleshoot issues. You’ll see timestamps, recipient
addresses, and SMTP-level details for each message. Messages are automatically deleted after the rentention
period set in the project settings.
</InfoAlert>

<Group justify="space-between" align="flex-end">
<Group>
<MultiSelect
label={
<Group gap={4} align="center">
Label
<Tooltip label="Labels can be used to catagorize emails. Specify the label by setting the X-REMAILS-LABEL header or using the REST API.">
<ThemeIcon variant="transparent" c="dimmed" size="xs">
<IconInfoCircle />
</ThemeIcon>
</Tooltip>
<InfoTooltip
size="xs"
text="Labels can be used to catagorize emails. Specify the label by setting the X-REMAILS-LABEL header or using the REST API."
/>
</Group>
}
placeholder="Pick labels"
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/organizations/Members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import UpdateRole from "./UpdateRole";
export default function Members() {
const { currentOrganization } = useOrganizations();
const { isAdmin } = useOrgRole();
const { subscription } = useSubscription();
const { currentSubscription } = useSubscription();
const { invites, setInvites } = useInvites();
const { members, setMembers } = useMembers();
const user = useSelector((state) => state.user);
const { dispatch, navigate } = useRemails();

const [opened, { open, close }] = useDisclosure(false);

if (!currentOrganization || !subscription) {
if (!currentOrganization || !currentSubscription) {
return null;
}

Expand Down Expand Up @@ -217,7 +217,7 @@ export default function Members() {
<Table.Td>
<Tooltip
label={"As soon as you choose a subscription, you'll become admin"}
disabled={subscription.status !== "none"}
disabled={currentSubscription.status !== "none"}
events={{ hover: true, focus: false, touch: true }}
>
<Text size="sm">
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/organizations/SubscriptionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { formatDate } from "../../util.ts";
import { useOrgRole } from "../../hooks/useOrganizations.ts";

export default function SubscriptionCard() {
const { subscription, navigateToSales, navigateToCustomerPortal } = useSubscription();
const { currentSubscription, navigateToSales, navigateToCustomerPortal } = useSubscription();
const { isAdmin } = useOrgRole();

if (!subscription) {
if (!currentSubscription) {
return null;
}

Expand Down Expand Up @@ -77,7 +77,7 @@ export default function SubscriptionCard() {
Your subscription
</Title>
<Card shadow="sm" padding="lg" radius="md" withBorder>
<Stack gap="md">{details(subscription)}</Stack>
<Stack gap="md">{details(currentSubscription)}</Stack>
</Card>
</Container>
);
Expand Down
Loading
Loading