diff --git a/package-lock.json b/package-lock.json index 52cbf3f9..9ce534bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8951,21 +8951,6 @@ "node": ">=8" } }, - "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" - } - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -19560,21 +19545,6 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, - "node_modules/react-tweet": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/react-tweet/-/react-tweet-3.1.1.tgz", - "integrity": "sha512-8GQLa5y0G56kvGQkN7OiaKkjFAhWYVdyFq62ioY2qVtpMrjchVU+3KnqneCyp0+BemOQZkg6WWp/qoCNeEMH6A==", - "dependencies": { - "@swc/helpers": "^0.5.1", - "clsx": "^1.2.1", - "date-fns": "^2.30.0", - "swr": "^2.2.0" - }, - "peerDependencies": { - "react": ">= 18.0.0", - "react-dom": ">= 18.0.0" - } - }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -22171,18 +22141,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/swr": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/swr/-/swr-2.2.4.tgz", - "integrity": "sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==", - "dependencies": { - "client-only": "^0.0.1", - "use-sync-external-store": "^1.2.0" - }, - "peerDependencies": { - "react": "^16.11.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/tailwindcss": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz", @@ -24606,8 +24564,7 @@ "lucide-react": "^0.284.0", "prism-react-renderer": "^1.3.5", "react": "18.2.0", - "react-dom": "18.2.0", - "react-tweet": "^3.1.1" + "react-dom": "18.2.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "2.4.3", diff --git a/packages/website/package.json b/packages/website/package.json index 8994e490..6406517c 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -24,8 +24,7 @@ "lucide-react": "^0.284.0", "prism-react-renderer": "^1.3.5", "react": "18.2.0", - "react-dom": "18.2.0", - "react-tweet": "^3.1.1" + "react-dom": "18.2.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "2.4.3", diff --git a/packages/website/src/components/hero.tsx b/packages/website/src/components/hero.tsx index e24b3d5a..366b21fe 100644 --- a/packages/website/src/components/hero.tsx +++ b/packages/website/src/components/hero.tsx @@ -1,8 +1,8 @@ import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import React from "react"; -import StarButton from "./landing/stars-button"; +import { StarsButton } from "./landing/stars-button"; -export default function Hero() { +export function Hero() { const { siteConfig } = useDocusaurusContext(); return ( @@ -28,7 +28,7 @@ export default function Hero() { className="!no-underline hover:brightness-90 transition !text-stone-100 cursor-pointer rounded-lg mr-4 bg-stone-800 px-3 py-2 font-bold inline-flex items-center justify-center text-sm sm:text-lg md:text-xl"> Getting started 🎉 - + diff --git a/packages/website/src/components/landing/features.tsx b/packages/website/src/components/landing/features.tsx index 0ffd03f2..039a0f19 100644 --- a/packages/website/src/components/landing/features.tsx +++ b/packages/website/src/components/landing/features.tsx @@ -34,7 +34,7 @@ const features: { title: string; description: string }[] = [ }, ]; -export default function Features() { +export function Features() { return (
diff --git a/packages/website/src/components/landing/index.tsx b/packages/website/src/components/landing/index.tsx index 136753d0..ba49835d 100644 --- a/packages/website/src/components/landing/index.tsx +++ b/packages/website/src/components/landing/index.tsx @@ -1,12 +1,15 @@ import React from "react"; -import Hero from "../hero"; -import Features from "./features"; +import { Hero } from "../hero"; +import { Features } from "./features"; +import { Testimonials } from "./testimonials"; -export default function Landing() { +export function Landing() { return (
+
+
); } diff --git a/packages/website/src/components/landing/stars-button.tsx b/packages/website/src/components/landing/stars-button.tsx index 5f04984b..2b724e2b 100644 --- a/packages/website/src/components/landing/stars-button.tsx +++ b/packages/website/src/components/landing/stars-button.tsx @@ -19,13 +19,7 @@ function useFetchStarsCount() { return { starsCount }; } -export default function StarsButton({ - width, - height, -}: { - width: string; - height: string; -}) { +export function StarsButton() { // const { starsCount } = useFetchStarsCount(); const starsCount = 269; diff --git a/packages/website/src/components/landing/testimonials.tsx b/packages/website/src/components/landing/testimonials.tsx new file mode 100644 index 00000000..71d0a9c8 --- /dev/null +++ b/packages/website/src/components/landing/testimonials.tsx @@ -0,0 +1,70 @@ +import React from "react"; +import { Tweet, TweetProps } from "./tweet"; + +const libURLSpan = `https://github.com/TheEdoRan/next-safe-action`; + +const tweets: TweetProps[] = [ + { + tweetURL: "https://twitter.com/zaphodias/status/1654158096048979973", + authorName: "zaphodias", + authorHandle: "zaphodias", + authorImage: + "https://pbs.twimg.com/profile_images/1478681149824245762/OPY0MMZX_400x400.jpg", + date: "May, 4, 2023", + textHTML: `step 1: upgrade to next 13.4;
+step 2: understand actions;
+step 3: use @TheEdoRan's lib 🎉`, + }, + { + tweetURL: "https://twitter.com/rclmenezes/status/1654111420047409153", + authorName: "rigo", + authorHandle: "rclmenezes", + authorImage: + "https://pbs.twimg.com/profile_images/1298993375442382850/bMU83i0i_400x400.jpg", + date: "May 4, 2023", + textHTML: `I predict that ${libURLSpan} is going to get a loooooot of stars in a few hours :)

+Props @TheEdoRan`, + }, + { + tweetURL: "https://twitter.com/ErfanEbrahimnia/status/1699816975009013935", + authorName: "Erfan Ebrahimnia", + authorHandle: "ErfanEbrahimnia", + authorImage: + "https://pbs.twimg.com/profile_images/1590423813443002371/Cos1mBo0_400x400.jpg", + date: "Sep 7, 2023", + textHTML: `Using next-safe-action by @TheEdoRan in a project right now and really like it

+It handles input-validation and errors when using Server Actions

+${libURLSpan}`, + }, + { + tweetURL: "https://twitter.com/Xexr/status/1674154036788879360", + authorName: "Xexr", + authorHandle: "Xexr", + authorImage: + "https://pbs.twimg.com/profile_images/1301926733747236864/wkYpwNY1_400x400.jpg", + date: "Jun 28, 2023", + textHTML: `@t3dotgg I saw you mention next-safe-action on your live stream. I wanted to throw my hat in the ring and give it a shout out.

+It's honestly great, @TheEdoRan has done a fantastic job and it deserves way more attention, I suspect it will get it after the stream mention. 👇`, + }, +]; + +export function Testimonials() { + return ( +
+
+
+
+
+ Coolest web devs say: +
+
+ {tweets.map((tweet, idx) => ( + + ))} +
+
+
+
+
+ ); +} diff --git a/packages/website/src/components/landing/tweet.tsx b/packages/website/src/components/landing/tweet.tsx new file mode 100644 index 00000000..25a6b391 --- /dev/null +++ b/packages/website/src/components/landing/tweet.tsx @@ -0,0 +1,44 @@ +import React from "react"; + +export type TweetProps = { + tweetURL: string; + authorName: string; + authorHandle: string; + authorImage: string; + date: string; + textHTML: string; +}; + +export function Tweet({ + tweetURL, + authorName, + authorHandle, + authorImage, + date, + textHTML, +}: TweetProps) { + return ( + +
+ +
+ + {authorName} + + + @{authorHandle} + +
+
+
+
{date}
+
+ ); +} diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index 7ba31ca6..8dbd87e1 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -23,6 +23,10 @@ body { box-shadow: 0px 1px #e7e5e4 !important; } +.root_------node_modules-react-tweet-dist-twitter-theme-quoted-tweet-quoted-tweet-container-module { + display: none !important; +} + :root { --ifm-color-primary: #da6f0c; --ifm-color-primary-dark: #c4640b; diff --git a/packages/website/src/pages/index.tsx b/packages/website/src/pages/index.tsx index 162be30b..a514e79c 100644 --- a/packages/website/src/pages/index.tsx +++ b/packages/website/src/pages/index.tsx @@ -1,7 +1,7 @@ import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import Layout from "@theme/Layout"; import React from "react"; -import Landing from "../components/landing"; +import { Landing } from "../components/landing"; export default function Home(): JSX.Element { const { siteConfig } = useDocusaurusContext();