mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Use tabWidth 4 without actual tabs.
This commit is contained in:
@@ -4,53 +4,53 @@ import { Text } from "preact-i18n";
|
||||
import Button from "../../../components/ui/Button";
|
||||
|
||||
interface Props {
|
||||
email?: string;
|
||||
email?: string;
|
||||
}
|
||||
|
||||
function mapMailProvider(email?: string): [string, string] | undefined {
|
||||
if (!email) return;
|
||||
if (!email) return;
|
||||
|
||||
const match = /@(.+)/.exec(email);
|
||||
if (match === null) return;
|
||||
const match = /@(.+)/.exec(email);
|
||||
if (match === null) return;
|
||||
|
||||
const domain = match[1];
|
||||
switch (domain) {
|
||||
case "gmail.com":
|
||||
return ["Gmail", "https://gmail.com"];
|
||||
case "tuta.io":
|
||||
return ["Tutanota", "https://mail.tutanota.com"];
|
||||
case "outlook.com":
|
||||
return ["Outlook", "https://outlook.live.com"];
|
||||
case "yahoo.com":
|
||||
return ["Yahoo", "https://mail.yahoo.com"];
|
||||
case "wp.pl":
|
||||
return ["WP Poczta", "https://poczta.wp.pl"];
|
||||
case "protonmail.com":
|
||||
case "protonmail.ch":
|
||||
return ["ProtonMail", "https://mail.protonmail.com"];
|
||||
case "seznam.cz":
|
||||
case "email.cz":
|
||||
case "post.cz":
|
||||
return ["Seznam", "https://email.seznam.cz"];
|
||||
default:
|
||||
return [domain, `https://${domain}`];
|
||||
}
|
||||
const domain = match[1];
|
||||
switch (domain) {
|
||||
case "gmail.com":
|
||||
return ["Gmail", "https://gmail.com"];
|
||||
case "tuta.io":
|
||||
return ["Tutanota", "https://mail.tutanota.com"];
|
||||
case "outlook.com":
|
||||
return ["Outlook", "https://outlook.live.com"];
|
||||
case "yahoo.com":
|
||||
return ["Yahoo", "https://mail.yahoo.com"];
|
||||
case "wp.pl":
|
||||
return ["WP Poczta", "https://poczta.wp.pl"];
|
||||
case "protonmail.com":
|
||||
case "protonmail.ch":
|
||||
return ["ProtonMail", "https://mail.protonmail.com"];
|
||||
case "seznam.cz":
|
||||
case "email.cz":
|
||||
case "post.cz":
|
||||
return ["Seznam", "https://email.seznam.cz"];
|
||||
default:
|
||||
return [domain, `https://${domain}`];
|
||||
}
|
||||
}
|
||||
|
||||
export function MailProvider({ email }: Props) {
|
||||
const provider = mapMailProvider(email);
|
||||
if (!provider) return null;
|
||||
const provider = mapMailProvider(email);
|
||||
if (!provider) return null;
|
||||
|
||||
return (
|
||||
<div className={styles.mailProvider}>
|
||||
<a href={provider[1]} target="_blank">
|
||||
<Button>
|
||||
<Text
|
||||
id="login.open_mail_provider"
|
||||
fields={{ provider: provider[0] }}
|
||||
/>
|
||||
</Button>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div className={styles.mailProvider}>
|
||||
<a href={provider[1]} target="_blank">
|
||||
<Button>
|
||||
<Text
|
||||
id="login.open_mail_provider"
|
||||
fields={{ provider: provider[0] }}
|
||||
/>
|
||||
</Button>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user