Skip to content

Commit

Permalink
Merge branch 'main' into links
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeWilfried authored Feb 29, 2024
2 parents 2fad5c4 + de48b67 commit cedc24e
Show file tree
Hide file tree
Showing 121 changed files with 3,807 additions and 270 deletions.
2 changes: 1 addition & 1 deletion apps/marketing/content/blog/launch-week-2-day-2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ We are launching templates for Documenso! Templates are an easy way to reuse doc
/>

<figcaption className="text-center">
POV: You are a diligent german and create custom receipts with Documenso.
POV: You are a diligent german and create custom receipts with Documenso
</figcaption>
</figure>

Expand Down
53 changes: 53 additions & 0 deletions apps/marketing/content/blog/launch-week-2-day-3.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Launch Week II - Day 3 - API
description: Documenso's mission is to create a plattform developers all around the world can build upon. Today we are releasing the first version of our public API, included in all plans!
authorName: 'Timur Ercan'
authorImage: '/blog/blog-author-timur.jpeg'
authorRole: 'Co-Founder'
date: 2024-02-28
tags:
- Launch Week
- API
---

<video
id="vid"
width="100%"
src="https://github.com/documenso/design/assets/1309312/cb74d6cb-a127-4cac-a166-ad6b56c6140d"
autoPlay
loop
muted
></video>

> TLDR; The public API is now availible for all plans.
## Introducing the public Documenso API

Launch. Week. Day. 3 🎉 Documenso's mission is to create a platform that developers all around the world can build upon. Today we are releasing the first version of our public API, and we are pumped. Since this is the first version, we focused on the basics. With the new API you can:

- Get Documents (Individual or all Accessible)
- Upload Documents
- Delete Documents
- Create Documents from Templates
- Trigger Sending Documents for Singing

You can check out the detailed API documentation here:

> API DOCUMENTATION: [https://app.documenso.com/api/v1/openapi](https://app.documenso.com/api/v1/openapi)
## Pricing

We are building Documenso to be an open and extendable platform; therefore the API is included in all current plans. The API is authenticated via auth tokens, which every user can create at no extra cost, as can teams. Existing limits still apply (i.e., the number of included documents for the free plan). While we don't have all the details yet, we don't intend to price the API usage in itself (rather the accounts using it) since we want you to build on Documenso without being smothered by API costs.

> Try the API here for free: [https://documen.so/api](https://documen.so/api)
## What's next for the API

You tell us. This is by far the most requested feature, so we would like to hear from you. What should we add? How can we integrate even better?

Connect with us on [Twitter / X](https://twitter.com/eltimuro) (DM open) or [Discord](https://documen.so/discord) if you have any questions or comments! We're always here and would love to hear from you :)

> 🚨 We need you help to help us to make this the biggest launch week yet: <a href="https://twitter.com/intent/tweet?text=It's @Documenso Launch Week Day 3! The public API is here 👀 Check it out https://documen.so/day3"> Support us on Twitter </a> or anywhere to spread awareness for open signing! The best posts will receive merch codes 👀
Best from Hamburg\
Timur
33 changes: 33 additions & 0 deletions apps/marketing/src/app/(marketing)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

import React, { useEffect, useState } from 'react';

import Image from 'next/image';
import { usePathname } from 'next/navigation';

import launchWeekTwoImage from '@documenso/assets/images/background-lw-2.png';
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
import { NEXT_PUBLIC_WEBAPP_URL } from '@documenso/lib/constants/app';
import { cn } from '@documenso/ui/lib/utils';

import { Footer } from '~/components/(marketing)/footer';
Expand All @@ -17,6 +21,10 @@ export default function MarketingLayout({ children }: MarketingLayoutProps) {
const [scrollY, setScrollY] = useState(0);
const pathname = usePathname();

const { getFlag } = useFeatureFlags();

const showProfilesAnnouncementBar = getFlag('marketing_profiles_announcement_bar');

useEffect(() => {
const onScroll = () => {
setScrollY(window.scrollY);
Expand All @@ -38,6 +46,31 @@ export default function MarketingLayout({ children }: MarketingLayoutProps) {
'bg-background/50 backdrop-blur-md': scrollY > 5,
})}
>
{showProfilesAnnouncementBar && (
<div className="relative inline-flex w-full items-center justify-center overflow-hidden px-4 py-2.5">
<div className="absolute inset-0 -z-[1]">
<Image
src={launchWeekTwoImage}
className="h-full w-full object-cover"
alt="Launch Week 2"
/>
</div>

<div className="text-background text-center text-sm">
Claim your documenso public profile username now!{' '}
<span className="hidden font-semibold md:inline">documenso.com/u/yourname</span>
<div className="mt-1.5 block md:ml-4 md:mt-0 md:inline-block">
<a
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup?utm_source=marketing-announcement-bar`}
className="bg-background text-foreground rounded-md px-2.5 py-1 text-xs font-medium duration-300"
>
Claim Now
</a>
</div>
</div>
</div>
)}

<Header className="mx-auto h-16 max-w-screen-xl px-4 md:h-20 lg:px-8" />
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function SinglePlayerModeSuccessPage({
return notFound();
}

const signatures = await getRecipientSignatures({ recipientId: document.Recipient.id });
const signatures = await getRecipientSignatures({ recipientId: document.Recipient[0].id });

return <SinglePlayerModeSuccess document={document} signatures={signatures} />;
}
2 changes: 1 addition & 1 deletion apps/marketing/src/app/(marketing)/singleplayer/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const SinglePlayerClient = () => {
<p className="text-foreground mx-auto mt-4 max-w-[50ch] text-lg leading-normal">
Create a{' '}
<Link
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup`}
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup?utm_source=singleplayer`}
target="_blank"
className="hover:text-foreground/80 font-semibold transition-colors"
>
Expand Down
6 changes: 3 additions & 3 deletions apps/marketing/src/components/(marketing)/callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export const Callout = ({ starCount }: CalloutProps) => {
className="rounded-full bg-transparent backdrop-blur-sm"
onClick={onSignUpClick}
>
Get the Early Adopters Plan
<span className="bg-primary dark:text-background -mr-2.5 ml-2.5 rounded-full px-2 py-1.5 text-xs">
$30/mo. forever!
Claim Community Plan
<span className="bg-primary dark:text-background -mr-2.5 ml-2.5 rounded-full px-2 py-1.5 text-xs font-medium">
$30/mo
</span>
</Button>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HTMLAttributes } from 'react';
import type { HTMLAttributes } from 'react';

import Image from 'next/image';

Expand Down
9 changes: 8 additions & 1 deletion apps/marketing/src/components/(marketing)/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Link from 'next/link';
import LogoImage from '@documenso/assets/logo.png';
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';

import { HamburgerMenu } from './mobile-hamburger';
import { MobileNavigation } from './mobile-navigation';
Expand Down Expand Up @@ -61,12 +62,18 @@ export const Header = ({ className, ...props }: HeaderProps) => {
</Link>

<Link
href="https://documenso-app-q0ns.onrender.com/signin"
href="https://app.tampon.xyz/signin?utm_source=marketing-header"
target="_blank"
className="text-muted-foreground hover:text-muted-foreground/80 text-sm font-semibold"
>
Sign in
</Link>

<Button className="rounded-full" size="sm" asChild>
<Link href="https://app.tampon.xyz/signup?utm_source=marketing-header" target="_blank">
Sign up
</Link>
</Button>
</div>

<HamburgerMenu
Expand Down
9 changes: 4 additions & 5 deletions apps/marketing/src/components/(marketing)/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export const Hero = ({ className, ...props }: HeroProps) => {
className="rounded-full bg-transparent backdrop-blur-sm"
onClick={onSignUpClick}
>
Get the Early Adopters Plan
<span className="bg-primary dark:text-background -mr-2.5 ml-2.5 rounded-full px-2 py-1.5 text-xs">
$30/mo. forever!
Claim Community Plan
<span className="bg-primary dark:text-background -mr-2.5 ml-2.5 rounded-full px-2 py-1.5 text-xs font-medium">
$30/mo
</span>
</Button>

Expand Down Expand Up @@ -223,8 +223,7 @@ export const Hero = ({ className, ...props }: HeroProps) => {
<span className="bg-primary text-black">
(in a non-legally binding, but heartfelt way)
</span>{' '}
and lock in the early supporter plan for forever, including everything we build this
year.
and lock in the community plan for forever, including everything we build this year.
</p>

<div className="flex h-24 items-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ export const MENU_NAVIGATION_LINKS = [
text: 'Privacy',
},
{
href: 'https://documenso-app-q0ns.onrender.com/signin',
href: 'https://app.tampon.xyz/signin?utm_source=marketing-header',
text: 'Sign in',
},
{
href: 'https://app.documenso.com/signup?utm_source=marketing-header',
text: 'Sign up',
},
];

export const MobileNavigation = ({ isMenuOpen, onMenuOpenChange }: MobileNavigationProps) => {
Expand Down
11 changes: 9 additions & 2 deletions apps/marketing/src/components/(marketing)/pricing-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
</p>

<Button className="rounded-full text-base" asChild>
<Link href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup`} target="_blank" className="mt-6">
<Link
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup?utm_source=pricing-free-plan`}
target="_blank"
className="mt-6"
>
Signup Now
</Link>
</Button>
Expand Down Expand Up @@ -114,7 +118,10 @@ export const PricingTable = ({ className, ...props }: PricingTableProps) => {
</p>

<Button className="mt-6 rounded-full text-base" asChild>
<Link href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup`} target="_blank">
<Link
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup?utm_source=pricing-community`}
target="_blank"
>
Signup Now
</Link>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const SinglePlayerModeSuccess = ({

<SigningCard3D
className="mt-8"
name={document.Recipient.name || document.Recipient.email}
name={document.Recipient[0].name || document.Recipient[0].email}
signature={signatures.at(0)}
signingCelebrationImage={signingCelebration}
/>
Expand All @@ -65,7 +65,7 @@ export const SinglePlayerModeSuccess = ({
<div className="grid w-full max-w-sm grid-cols-2 gap-4">
<DocumentShareButton
documentId={document.id}
token={document.Recipient.token}
token={document.Recipient[0].token}
className="flex-1 bg-transparent backdrop-blur-sm"
/>

Expand All @@ -86,7 +86,7 @@ export const SinglePlayerModeSuccess = ({
<p className="text-muted-foreground/60 mt-16 text-center text-sm">
Create a{' '}
<Link
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup`}
href={`${NEXT_PUBLIC_WEBAPP_URL()}/signup?utm_source=singleplayer`}
target="_blank"
className="text-documenso-700 hover:text-documenso-600 whitespace-nowrap"
>
Expand Down
13 changes: 5 additions & 8 deletions apps/marketing/src/components/(marketing)/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
className="bg-foreground/5 col-span-12 flex flex-col rounded-2xl p-6 lg:col-span-5"
onSubmit={handleSubmit(onFormSubmit)}
>
<h3 className="text-2xl font-semibold">Sign up for the early adopters plan</h3>
<h3 className="text-xl font-semibold">Sign up to Community Plan</h3>
<p className="text-muted-foreground mt-2 text-xs">
with Timur Ercan & Lucas Smith from MonTampon
</p>
Expand All @@ -208,7 +208,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {

<AnimatePresence>
<motion.div key="email">
<label htmlFor="email" className="text-foreground text-lg font-semibold lg:text-xl">
<label htmlFor="email" className="text-foreground font-medium ">
What’s your email?
</label>

Expand All @@ -220,7 +220,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
<Input
id="email"
type="email"
placeholder=""
placeholder="[email protected]"
className="bg-background w-full pr-16"
disabled={isSubmitting}
onKeyDown={(e) =>
Expand Down Expand Up @@ -265,11 +265,8 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
transform: 'translateX(25%)',
}}
>
<label
htmlFor="name"
className="text-foreground text-lg font-semibold lg:text-xl"
>
and your name?
<label htmlFor="name" className="text-foreground font-medium ">
And your name?
</label>

<Controller
Expand Down
13 changes: 11 additions & 2 deletions apps/web/src/app/(dashboard)/documents/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import type { Metadata } from 'next';

import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';

import type { DocumentsPageViewProps } from './documents-page-view';
import { DocumentsPageView } from './documents-page-view';
import { UpcomingProfileClaimTeaser } from './upcoming-profile-claim-teaser';

export type DocumentsPageProps = {
searchParams?: DocumentsPageViewProps['searchParams'];
Expand All @@ -11,6 +14,12 @@ export const metadata: Metadata = {
title: 'Documents',
};

export default function DocumentsPage({ searchParams = {} }: DocumentsPageProps) {
return <DocumentsPageView searchParams={searchParams} />;
export default async function DocumentsPage({ searchParams = {} }: DocumentsPageProps) {
const { user } = await getRequiredServerComponentSession();
return (
<>
<UpcomingProfileClaimTeaser user={user} />
<DocumentsPageView searchParams={searchParams} />
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use client';

import { useCallback, useEffect, useState } from 'react';

import type { User } from '@documenso/prisma/client';
import { useToast } from '@documenso/ui/primitives/use-toast';

import { ClaimPublicProfileDialogForm } from '~/components/forms/public-profile-claim-dialog';

export type UpcomingProfileClaimTeaserProps = {
user: User;
};

export const UpcomingProfileClaimTeaser = ({ user }: UpcomingProfileClaimTeaserProps) => {
const { toast } = useToast();

const [open, setOpen] = useState(false);
const [claimed, setClaimed] = useState(false);

const onOpenChange = useCallback(
(open: boolean) => {
if (!open && !claimed) {
toast({
title: 'Claim your profile later',
description: 'You can claim your profile later on by going to your profile settings!',
});
}

setOpen(open);
localStorage.setItem('app.hasShownProfileClaimDialog', 'true');
},
[claimed, toast],
);

useEffect(() => {
const hasShownProfileClaimDialog =
localStorage.getItem('app.hasShownProfileClaimDialog') === 'true';

if (!user.url && !hasShownProfileClaimDialog) {
onOpenChange(true);
}
}, [onOpenChange, user.url]);

return (
<ClaimPublicProfileDialogForm
open={open}
onOpenChange={onOpenChange}
onClaimed={() => setClaimed(true)}
user={user}
/>
);
};
Loading

0 comments on commit cedc24e

Please sign in to comment.