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
5 changes: 3 additions & 2 deletions apps/macos/Sources/EWizKit/EWizLinks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ public enum EWizLinks {
/// one. The license window and the "isn't linked to a Mac" error send people here.
public static let license = URL(string: "https://ewiz.app/license")!

/// Settings › About › Donate.
public static let donate = URL(string: "https://ewiz.app/donate")!
/// Settings › About › Donate: the website redirects this to the pay-what-you-want
/// checkout, so the checkout link can change without an app release.
public static let donate = URL(string: "https://ewiz.app/donate/checkout")!

/// Where Contact Support and the license window's help link write to.
public static let supportEmail = "hello@ewiz.app"
Expand Down
8 changes: 7 additions & 1 deletion apps/web/src/components/landing/landing-data.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
export const LINKS = {
github: "https://github.com/stroke-app/ewiz",
/** This website's source. */
siteSource: "https://github.com/stroke-app/ewiz-releases",
siteSource: "https://github.com/stroke-app/ewiz/tree/main/apps/web",
releases: "https://github.com/stroke-app/ewiz/releases",
feedback: "https://github.com/stroke-app/ewiz/issues",
/**
* Pay-what-you-want donation checkout (Dodo). Every Donate button goes through
* /donate/checkout, which redirects here, so the target can change without an
* app release.
*/
donateCheckout: "https://checkout.dodopayments.com/session/cks_0NsOth7ruTtl42VyOoxxM",
x: "https://x.com/broisnischal",
stroke: "https://stroke.click",
site: "https://nischal-dahal.com.np",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/landing/landing-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -724,12 +724,12 @@ function ClosingCta() {
</div>
<p className="mt-4 text-sm text-muted-foreground">
Already using it and want to help?{" "}
<Link
to="/donate"
<a
href="/donate/checkout"
className="text-foreground underline decoration-border underline-offset-4 transition-colors hover:decoration-foreground"
>
Donate
</Link>
</a>
</p>
</Container>
</section>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/site/site-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const FOOTER_COLUMNS: Array<{ title: string; links: FooterLink[] }> = [
{ label: "Download", to: "/download" },
{ label: "Changelog", to: "/changelog" },
{ label: "Blog", to: "/blog" },
{ label: "Donate", to: "/donate" },
{ label: "Donate", href: "/donate/checkout" },
],
},
{
Expand Down
21 changes: 21 additions & 0 deletions apps/web/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { Route as BlogIndexRouteImport } from './routes/blog/index'
import { Route as LegalTermsRouteImport } from './routes/legal/terms'
import { Route as LegalPrivacyRouteImport } from './routes/legal/privacy'
import { Route as LegalLicenseRouteImport } from './routes/legal/license'
import { Route as DonateCheckoutRouteImport } from './routes/donate_.checkout'
import { Route as BlogSlugRouteImport } from './routes/blog/$slug'
import { Route as GuestLoginRouteImport } from './routes/_guest/login'
import { Route as AuthAppRouteRouteImport } from './routes/_auth/app/route'
Expand Down Expand Up @@ -151,6 +152,11 @@ const LegalLicenseRoute = LegalLicenseRouteImport.update({
path: '/license',
getParentRoute: () => LegalRouteRoute,
} as any)
const DonateCheckoutRoute = DonateCheckoutRouteImport.update({
id: '/donate_/checkout',
path: '/donate/checkout',
getParentRoute: () => rootRouteImport,
} as any)
const BlogSlugRoute = BlogSlugRouteImport.update({
id: '/$slug',
path: '/$slug',
Expand Down Expand Up @@ -198,6 +204,7 @@ export interface FileRoutesByFullPath {
'/app': typeof AuthAppRouteRouteWithChildren
'/login': typeof GuestLoginRoute
'/blog/$slug': typeof BlogSlugRoute
'/donate/checkout': typeof DonateCheckoutRoute
'/legal/license': typeof LegalLicenseRoute
'/legal/privacy': typeof LegalPrivacyRoute
'/legal/terms': typeof LegalTermsRoute
Expand All @@ -224,6 +231,7 @@ export interface FileRoutesByTo {
'/terms': typeof TermsRoute
'/login': typeof GuestLoginRoute
'/blog/$slug': typeof BlogSlugRoute
'/donate/checkout': typeof DonateCheckoutRoute
'/legal/license': typeof LegalLicenseRoute
'/legal/privacy': typeof LegalPrivacyRoute
'/legal/terms': typeof LegalTermsRoute
Expand Down Expand Up @@ -255,6 +263,7 @@ export interface FileRoutesById {
'/_auth/app': typeof AuthAppRouteRouteWithChildren
'/_guest/login': typeof GuestLoginRoute
'/blog/$slug': typeof BlogSlugRoute
'/donate_/checkout': typeof DonateCheckoutRoute
'/legal/license': typeof LegalLicenseRoute
'/legal/privacy': typeof LegalPrivacyRoute
'/legal/terms': typeof LegalTermsRoute
Expand Down Expand Up @@ -285,6 +294,7 @@ export interface FileRouteTypes {
| '/app'
| '/login'
| '/blog/$slug'
| '/donate/checkout'
| '/legal/license'
| '/legal/privacy'
| '/legal/terms'
Expand All @@ -311,6 +321,7 @@ export interface FileRouteTypes {
| '/terms'
| '/login'
| '/blog/$slug'
| '/donate/checkout'
| '/legal/license'
| '/legal/privacy'
| '/legal/terms'
Expand Down Expand Up @@ -341,6 +352,7 @@ export interface FileRouteTypes {
| '/_auth/app'
| '/_guest/login'
| '/blog/$slug'
| '/donate_/checkout'
| '/legal/license'
| '/legal/privacy'
| '/legal/terms'
Expand Down Expand Up @@ -369,6 +381,7 @@ export interface RootRouteChildren {
RobotsDottxtRoute: typeof RobotsDottxtRoute
SitemapDotxmlRoute: typeof SitemapDotxmlRoute
TermsRoute: typeof TermsRoute
DonateCheckoutRoute: typeof DonateCheckoutRoute
ApiAuthSplatRoute: typeof ApiAuthSplatRoute
}

Expand Down Expand Up @@ -535,6 +548,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LegalLicenseRouteImport
parentRoute: typeof LegalRouteRoute
}
'/donate_/checkout': {
id: '/donate_/checkout'
path: '/donate/checkout'
fullPath: '/donate/checkout'
preLoaderRoute: typeof DonateCheckoutRouteImport
parentRoute: typeof rootRouteImport
}
'/blog/$slug': {
id: '/blog/$slug'
path: '/$slug'
Expand Down Expand Up @@ -659,6 +679,7 @@ const rootRouteChildren: RootRouteChildren = {
RobotsDottxtRoute: RobotsDottxtRoute,
SitemapDotxmlRoute: SitemapDotxmlRoute,
TermsRoute: TermsRoute,
DonateCheckoutRoute: DonateCheckoutRoute,
ApiAuthSplatRoute: ApiAuthSplatRoute,
}
export const routeTree = rootRouteImport
Expand Down
32 changes: 25 additions & 7 deletions apps/web/src/routes/donate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { Container, SitePage } from "#/components/site/site-shell";
import { Button } from "#/components/ui/button";
import { seo } from "#/lib/seo";

// Settings › About › Donate in the app opens this page.
// Copies of the app up to 0.19.10 open this page from Settings › About › Donate;
// newer ones go straight to /donate/checkout.
export const Route = createFileRoute("/donate")({
head: () => ({
...seo({
title: "Support eWiz",
description: "Buying a license, starring the repo or reporting a bug keeps eWiz going.",
description:
"Donate any amount, buy a license, star the repo or report a bug to keep eWiz going.",
path: "/donate",
}),
}),
Expand Down Expand Up @@ -44,12 +46,28 @@ function DonatePage() {
<HeartIcon className="size-8 fill-rose text-rose" aria-hidden />
<h1 className="mt-4 text-3xl font-semibold tracking-tight">Support eWiz</h1>
<p className="mt-2 text-lg leading-relaxed text-pretty text-muted-foreground">
The best way to support eWiz is a license: it&apos;s a one-time {PRICE}, and it keeps
updates coming for everyone.
eWiz is made by one person. Donate whatever it&apos;s worth to you, or buy a license for{" "}
{PRICE} once. Either keeps updates coming for everyone.
</p>
<Button type="button" onClick={buy} disabled={loading} className="mt-6 text-[15px]">
Buy a license · {PRICE}
</Button>
<div className="mt-6 flex flex-wrap gap-2">
<Button
render={<a href="/donate/checkout" aria-label="Donate any amount" />}
nativeButton={false}
className="text-[15px]"
>
<HeartIcon className="size-4" aria-hidden />
Donate any amount
</Button>
<Button
type="button"
variant="outline"
onClick={buy}
disabled={loading}
className="text-[15px]"
>
Buy a license · {PRICE}
</Button>
</div>
<div className="mt-10 flex flex-col gap-3">
{ways.map((w) => (
<a
Expand Down
20 changes: 20 additions & 0 deletions apps/web/src/routes/donate_.checkout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { createFileRoute } from "@tanstack/react-router";

import { LINKS } from "#/components/landing/landing-data";

/**
* Every Donate button (the site, and Settings › About › Donate in the app) points
* here, and this sends the visitor on to the pay-what-you-want checkout. Keeping
* the hop on ewiz.app means the checkout link can change without an app release.
*/
export const Route = createFileRoute("/donate_/checkout")({
server: {
handlers: {
GET: () =>
new Response(null, {
status: 302,
headers: { location: LINKS.donateCheckout, "cache-control": "no-store" },
}),
},
},
});
Loading