-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
164 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// postcss.config.js | ||
module.exports = { | ||
plugins: { | ||
"postcss-import": {}, | ||
"tailwindcss/nesting": "postcss-nested", | ||
"tailwindcss": {}, | ||
"autoprefixer": {}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { Check } from "lucide-react"; | ||
import React, { Fragment } from "react"; | ||
|
||
const features: { title: string; description: string }[] = [ | ||
{ | ||
title: "Pretty simple", | ||
description: | ||
"No need to overcomplicate things. next-safe-action API is pretty simple, targeted for fast development.", | ||
}, | ||
{ | ||
title: "End-to-end type safety", | ||
description: | ||
"With next-safe-action you get full type safety between server and client code.", | ||
}, | ||
{ | ||
title: "Context-based clients (with middlewares)", | ||
description: | ||
"Powerful context-based clients with custom logic execution, thanks to middlewares.", | ||
}, | ||
{ | ||
title: "Input validation using Zod", | ||
description: | ||
"Input passed from the client to the server is validated using Zod schemas.", | ||
}, | ||
{ | ||
title: "Advanced server error handling", | ||
description: | ||
"Decide how to return execution errors to the client and how to log them on the server.", | ||
}, | ||
{ | ||
title: "Optimistic updates", | ||
description: | ||
"Need to update UI immediately without waiting for server response? You can do it with the powerful <code>useOptimisticAction</code> hook.", | ||
}, | ||
]; | ||
|
||
export default function Features() { | ||
return ( | ||
<div className="px-5 md:px-10"> | ||
<div className="mx-auto w-full max-w-4xl"> | ||
<div className="flex-col flex gap-y-20 max-[479px]:gap-[60px] items-center lg:items-center py-20 lg:py-24"> | ||
<div className="flex-col flex items-center justify-center gap-y-[60px] max-[479px]:gap-[60px]"> | ||
<div className="text-center font-bold text-3xl sm:text-4xl lg:text-5xl"> | ||
Why choose next-safe-action? | ||
</div> | ||
<div className="min-w-full bg-white dark:bg-stone-800 max-[479px]:px-5 max-[479px]:py-6 rounded-xl p-8 md:p-10 flex flex-col space-y-6"> | ||
{features.map(({ title, description }, idx) => ( | ||
<Fragment key={idx}> | ||
{idx > 0 ? ( | ||
<div className="h-px min-h-[1px] min-w-full bg-stone-200 dark:bg-stone-700"></div> | ||
) : null} | ||
<div className="flex space-x-2 sm:space-x-4 md:space-x-6"> | ||
<Check className="w-8 h-8 shrink-0" /> | ||
<div className="flex-col flex items-start gap-y-2 max-[479px]:pr-10"> | ||
<div className="font-bold text-xl sm:text-xl"> | ||
{title} | ||
</div> | ||
<div | ||
className="text-[#8a8880] text-base sm:text-base" | ||
dangerouslySetInnerHTML={{ __html: description }} | ||
/> | ||
</div> | ||
</div> | ||
</Fragment> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import React from "react"; | ||
import "../../css/tailwind.css"; | ||
import Hero from "../hero"; | ||
import Features from "./features"; | ||
|
||
export default function Landing() { | ||
return ( | ||
<main className="tailwind"> | ||
<main> | ||
<Hero /> | ||
<Features /> | ||
</main> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Star } from "lucide-react"; | ||
import React, { useEffect, useState } from "react"; | ||
|
||
function useFetchStarsCount() { | ||
const [starsCount, setStarsCount] = useState<number | null>(undefined); | ||
|
||
useEffect(() => { | ||
fetch("https://api.github.com/repos/TheEdoRan/next-safe-action") | ||
.then((res) => | ||
res.json().then((data) => { | ||
if (typeof data.stargazers_count === "number") { | ||
setStarsCount(data.stargazers_count); | ||
} | ||
}) | ||
) | ||
.catch(console.error); | ||
}, []); | ||
|
||
return { starsCount }; | ||
} | ||
|
||
export default function StarsButton({ | ||
width, | ||
height, | ||
}: { | ||
width: string; | ||
height: string; | ||
}) { | ||
// const { starsCount } = useFetchStarsCount(); | ||
const starsCount = 269; | ||
|
||
return ( | ||
<a | ||
href="https://github.com/TheEdoRan/next-safe-action" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="!no-underline hover:!bg-sky-100 transition !text-stone-900 cursor-pointer rounded-lg mr-4 bg-stone-50 px-3 py-2 font-bold inline-flex items-center justify-center space-x-1 text-sm sm:text-lg md:text-xl"> | ||
<Star className="w-4 h-4 sm:w-6 sm:h-6" /> | ||
<span>{starsCount ? starsCount : ". . ."} GitHub stars</span> | ||
</a> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters