Factor out links

This commit is contained in:
MartinBraquet
2025-09-18 11:30:59 +02:00
parent 14c12ffb08
commit d98982e6fd
11 changed files with 38 additions and 24 deletions

View File

@@ -1,6 +1,5 @@
'use client';
import {aColor, supportEmail} from "@/lib/client/constants";
import Image from 'next/image';
export default function PrivacyPage() {

View File

@@ -1,11 +1,2 @@
'use client';
export const supportEmail = 'compass.meet.marketing@gmail.com';
export const pStyle = "mt-1 text-gray-800 dark:text-white whitespace-pre-line";
export const aColor = <style jsx global>{`
a {
color: cornflowerblue;
}
`}</style>;

View File

@@ -1,4 +1,5 @@
import {Column, Img, Link, Row, Section, Text} from "@react-email/components";
import {discordLink, githubRepo, patreonLink, paypalLink} from "common/constants";
interface Props {
email?: string
@@ -13,7 +14,7 @@ export const Footer = ({
<hr style={{border: 'none', borderTop: '1px solid #e0e0e0', margin: '10px 0'}}/>
<Row>
<Column align="center">
<Link href="https://github.com/CompassConnections/Compass" target="_blank">
<Link href={githubRepo} target="_blank">
<Img
src="https://cdn-icons-png.flaticon.com/512/733/733553.png"
width="24"
@@ -22,7 +23,7 @@ export const Footer = ({
style={{ display: "inline-block", margin: "0 4px" }}
/>
</Link>
<Link href="https://discord.gg/8Vd7jzqjun" target="_blank">
<Link href={discordLink} target="_blank">
<Img
src="https://cdn-icons-png.flaticon.com/512/2111/2111370.png"
width="24"
@@ -31,7 +32,7 @@ export const Footer = ({
style={{ display: "inline-block", margin: "0 4px" }}
/>
</Link>
<Link href="https://patreon.com/CompassMeet" target="_blank">
<Link href={patreonLink} target="_blank">
<Img
src="https://static.vecteezy.com/system/resources/previews/027/127/454/non_2x/patreon-logo-patreon-icon-transparent-free-png.png"
width="24"
@@ -40,7 +41,7 @@ export const Footer = ({
style={{ display: "inline-block", margin: "0 4px" }}
/>
</Link>
<Link href="https://www.paypal.com/paypalme/CompassConnections" target="_blank">
<Link href={paypalLink} target="_blank">
<Img
src="https://cdn-icons-png.flaticon.com/512/174/174861.png"
width="24"

View File

@@ -1,2 +1,15 @@
export const MAX_INT = 99999
export const MIN_INT = -MAX_INT
export const supportEmail = 'compass.meet.info@gmail.com';
export const marketingEmail = 'compass.meet.marketing@gmail.com';
export const githubRepo = "https://github.com/CompassConnections/Compass";
export const githubIssues = `${githubRepo}/issues`
export const paypalLink = "https://www.paypal.com/paypalme/CompassConnections"
export const patreonLink = "https://patreon.com/CompassMeet"
export const discordLink = "https://discord.gg/8Vd7jzqjun"
export const formLink = "https://forms.gle/tKnXUMAbEreMK6FC6"
export const pStyle = "mt-1 text-gray-800 dark:text-white whitespace-pre-line";

View File

@@ -1,4 +1,5 @@
import { strip, getSocialUrl } from './socials'
import {discordLink} from "common/constants";
describe('strip', () => {
describe('x/twitter', () => {
@@ -75,6 +76,6 @@ describe('getSocialUrl', () => {
it('should handle discord user IDs and default invite', () => {
expect(getSocialUrl('discord', '123456789012345678')).toBe('https://discord.com/users/123456789012345678')
expect(getSocialUrl('discord', 'not-an-id')).toBe('https://discord.gg/8Vd7jzqjun')
expect(getSocialUrl('discord', 'not-an-id')).toBe({discordLink})
})
})

View File

@@ -1,3 +1,5 @@
import {discordLink} from "common/constants";
export const SITE_ORDER = [
'site', // personal site
'x', // twitter
@@ -73,7 +75,7 @@ const urler: { [key in Site]: (handle: string) => string } = {
discord: (s) =>
(s.length === 17 || s.length === 18) && !isNaN(parseInt(s, 10))
? `https://discord.com/users/${s}` // discord user id
: 'https://discord.gg/8Vd7jzqjun', // our server
: discordLink, // our server
bluesky: (s) => `https://bsky.app/profile/${s}`,
mastodon: (s) =>
s.includes('@') ? `https://${s.split('@')[1]}/@${s.split('@')[0]}` : s,

View File

@@ -0,0 +1,5 @@
export const aColor = <style jsx global>{`
a {
color: cornflowerblue;
}
`}</style>;

View File

@@ -5,6 +5,7 @@ import { Col } from 'web/components/layout/col'
import { Title } from 'web/components/widgets/title'
import { ExternalLinkIcon } from '@heroicons/react/outline'
import {discordLink, formLink, githubIssues} from "common/constants";
export default function Custom404(props: { customText?: string }) {
return (
@@ -27,7 +28,7 @@ export function Custom404Content(props: { customText?: string }) {
target="_blank"
rel="noopener noreferrer"
className="items-center hover:text-indigo-400 hover:underline"
href="https://forms.gle/tKnXUMAbEreMK6FC6"
href={formLink}
>
a Google Form
<ExternalLinkIcon className="ml-1 inline-block h-4 w-4 " />
@@ -36,7 +37,7 @@ export function Custom404Content(props: { customText?: string }) {
target="_blank"
rel="noopener noreferrer"
className="items-center hover:text-indigo-400 hover:underline"
href="https://discord.gg/8Vd7jzqjun"
href={discordLink}
>
Discord
<ExternalLinkIcon className="ml-1 inline-block h-4 w-4 " />
@@ -45,7 +46,7 @@ export function Custom404Content(props: { customText?: string }) {
target="_blank"
rel="noopener noreferrer"
className="items-center hover:text-indigo-400 hover:underline"
href="https://github.com/CompassConnections/Compass/issues"
href={githubIssues}
>
GitHub!
<ExternalLinkIcon className="ml-1 inline-block h-4 w-4 " />

View File

@@ -1,6 +1,7 @@
import {LovePage} from 'web/components/love-page'
import {ReactNode} from "react";
import Link from "next/link";
import {discordLink, formLink, githubRepo} from "common/constants";
export const AboutBlock = (props: {
@@ -79,7 +80,7 @@ export default function About() {
<p className="mb-4 text-center">Give suggestions or let us know you want to help through this
form!</p>
<a
href="https://forms.gle/tKnXUMAbEreMK6FC6"
href={formLink}
className="px-6 py-2 rounded-full bg-gray-200 text-gray-800 font-semibold text-lg shadow hover:bg-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 transition"
target="_blank" rel="noopener noreferrer"
>
@@ -90,7 +91,7 @@ export default function About() {
<h5 id="join-chats" className="font-bold mb-4 text-xl text-center">Join the Community</h5>
<p className="mb-4 text-center">Shape the product or chat with like-minded people.</p>
<a
href="https://discord.gg/8Vd7jzqjun"
href={discordLink}
className="px-6 py-2 rounded-full bg-gray-200 text-gray-800 font-semibold text-lg shadow hover:bg-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 transition"
target="_blank" rel="noopener noreferrer"
>
@@ -101,7 +102,7 @@ export default function About() {
<h5 id="share" className="font-bold mb-4 text-xl text-center">Develop the App</h5>
<p className="mb-4 text-center">The full source code and instructions are available on GitHub.</p>
<a
href="https://github.com/CompassConnections/Compass"
href={githubRepo}
className="px-6 py-2 rounded-full bg-gray-200 text-gray-800 font-semibold text-lg shadow hover:bg-gray-300 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 transition"
target="_blank" rel="noopener noreferrer">
View Code

View File

@@ -1,5 +1,5 @@
import {supportEmail} from "../../old/lib/client/constants";
import {LovePage} from "web/components/love-page";
import {supportEmail} from "common/constants";
// TODO: convert to MarkDown for better readability during modifications?
export default function PrivacyPage() {

View File

@@ -1,5 +1,5 @@
import {supportEmail} from "../../old/lib/client/constants";
import {LovePage} from "web/components/love-page";
import {supportEmail} from "common/constants";
// TODO: convert to MarkDown for better readability during modifications?
export default function TermsPage() {