Skip to content

Commit 917c223

Browse files
feat: add Refine AI landing page (#6744)
Co-authored-by: Batuhan Wilhelm <batuhanwilhelm@gmail.com>
1 parent c15e313 commit 917c223

31 files changed

+3241
-571
lines changed

.cursorignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ documentation/.docusaurus/
77
documentation/build/
88
documentation/node_modules/
99
documentation/plugins/
10-
documentation/src/
1110
documentation/static/
1211
documentation/test/
1312
documentation/versioned_docs/

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@v4
3939
with:
40-
fetch-depth: 0
40+
fetch-depth: ${{ github.ref == 'refs/heads/main' && 500 || 1 }}
4141
- uses: pnpm/action-setup@v3
4242
with:
4343
version: 9

documentation/src/components/banner/banner-examples.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ type Props = {
1414
};
1515

1616
export const BannerExamples: FC<Props> = ({
17-
title = "Open-source Retool alternative for enterprise",
18-
description = "Build React-based internal tools, dashboards & B2B apps with unmatched flexibility",
17+
title = "Refine AI is in closed beta!",
18+
description = "The next-gen approach to build enterprise-ready React-based internal tools apps with the power of GenAI.",
1919
button = {
20-
text: "Discover Refine",
21-
href: "https://s.refine.dev/blog-retool?ref=banner-retool-alternative",
20+
text: "Explore Refine AI",
21+
href: "https://s.refine.dev/blog-banner-no-image?ref=banner-examples",
2222
onClick: undefined,
2323
},
2424
}) => {

documentation/src/components/banner/banner-image-with-text.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const BannerImageWithText: FC<Props> = ({
2929
variant = "purple",
3030
button = {
3131
text: "Learn more",
32-
href: "https://refine.dev/",
32+
href: "https://s.refine.dev/banner-with-image?ref=banner-image-with-text",
3333
onClick: undefined,
3434
},
3535
bannerName,

documentation/src/components/banner/banner-random.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ import BrowserOnly from "@docusaurus/BrowserOnly";
66
const data = [
77
{
88
description:
9-
"Refine is a React Framework used by over monthly 15K developers for building enterprise internal tools, dashboards, and B2B apps",
9+
"The next-gen approach to build enterprise-ready React-based internal tools, admin panels, dashboards & B2B apps with the power of GenAI.",
1010
image: {
11-
src: "https://refine.ams3.cdn.digitaloceanspaces.com/website/static/banners/banner-tweet.jpg",
12-
alt: "X tweet about Refine",
13-
href: "https://s.refine.dev/blog-twitter?ref=banner-twitter",
11+
src: "https://refine.ams3.cdn.digitaloceanspaces.com/website/static/banners/banner-refine-ai.png",
12+
alt: "Refine AI Image",
13+
href: "https://s.refine.dev/banner-with-image?ref=refine-ai-banner",
1414
},
1515
button: {
16-
text: "Learn more",
17-
href: "https://s.refine.dev/blog-twitter?ref=banner-twitter",
16+
text: "Join the waitlist",
17+
href: "https://s.refine.dev/banner-join-waitlist?ref=banner-refine-ai-banner",
1818
},
19-
bannerName: "banner-twitter",
19+
bannerName: "banner-refine-ai",
2020
},
2121
/* {
2222
title: "Save developer hours!",

documentation/src/components/banner/banner-sidebar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { LandingRainbowButton } from "@site/src/refine-theme/landing-rainbow-but
44
import clsx from "clsx";
55
import React from "react";
66

7-
const text = "Struggling with internal tools?";
7+
const text = "Explore Refine AI";
88
const description =
9-
"Explore refine’s limitless possibilities in crafting CRUD apps, CRM solutions, HR dashboards, and more!";
9+
"The next-gen approach to build enterprise-ready React-based internal tools with the power of GenAI.";
1010
const image =
11-
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/banners/app-crm.png";
11+
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/banners/banner-sidebar-refine-ai.png";
1212

1313
export const BannerSidebar = ({ shouldShowBanner }) => {
1414
React.useEffect(() => {
@@ -40,7 +40,7 @@ export const BannerSidebar = ({ shouldShowBanner }) => {
4040
)}
4141
>
4242
<Link
43-
to={"https://s.refine.dev/blog-sidebar?ref=banner-sidebar"}
43+
to={"https://s.refine.dev/blog-sidebar-ai?ref=banner-sidebar"}
4444
target="_blank"
4545
rel="noopener noreferrer"
4646
className={clsx(
@@ -60,12 +60,12 @@ export const BannerSidebar = ({ shouldShowBanner }) => {
6060
<LandingRainbowButton
6161
className={clsx("w-max")}
6262
buttonClassname={clsx("!px-4", "!py-2")}
63-
href={"https://s.refine.dev/blog-sidebar?ref=banner-sidebar"}
63+
href={"https://s.refine.dev/blog-sidebar-ai?ref=banner-sidebar"}
6464
target="_blank"
6565
rel="noopener noreferrer"
6666
>
6767
<div className={clsx("text-gray-900", "text-base", "font-bold")}>
68-
Try online
68+
Learn more
6969
</div>
7070
<ArrowRightIcon className={clsx("ml-2", "w-4", "h-4")} />
7171
</LandingRainbowButton>

documentation/src/hooks/use-is-mobile.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
import { useEffect, useState } from "react";
22

3-
const getIsMobile = () =>
4-
typeof window !== "undefined" ? window.innerWidth <= 768 : false;
3+
const getIsMobile = (breakpoint: number) =>
4+
typeof window !== "undefined" ? window.innerWidth <= breakpoint : false;
55

6-
export default function useIsMobile() {
7-
const [isMobile, setIsMobile] = useState(getIsMobile());
6+
type UseIsMobileProps = {
7+
breakpoint?: number;
8+
};
9+
10+
export default function useIsMobile({
11+
breakpoint = 768,
12+
}: UseIsMobileProps = {}) {
13+
const [isMobile, setIsMobile] = useState(getIsMobile(breakpoint));
814

915
useEffect(() => {
1016
const onResize = () => {
11-
setIsMobile(getIsMobile());
17+
setIsMobile(getIsMobile(breakpoint));
1218
};
1319

1420
if (typeof window !== "undefined") {

documentation/src/hooks/use-tw-breakpoints.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,32 @@ import React from "react";
22

33
/**
44
* tailwindcss breakpoints
5+
* xs: 360px
56
* sm: 640px
67
* md: 768px
78
* lg: 1024px
89
* xl: 1280px
910
*
1011
* landing breakpoints
12+
* xs: 360px
1113
* sm: 720px
1214
* md: 960px
1315
* lg: 1296px
1416
* xl: 1440px
1517
*/
1618
const breakpoints = {
17-
landing: [720, 960, 1296, 1440, 1584],
18-
tw: [640, 768, 1024, 1280, 1536],
19+
landing: [375, 720, 960, 1296, 1440, 1584],
20+
tw: [360, 640, 768, 1024, 1280, 1536],
1921
};
2022

2123
/**
2224
* check tailwindcss breakpoints with matchMedia and addEventListener
2325
*/
2426

25-
export type TWBreakpoints = Record<"sm" | "md" | "lg" | "xl" | "xxl", boolean>;
27+
export type TWBreakpoints = Record<
28+
"xs" | "sm" | "md" | "lg" | "xl" | "xxl",
29+
boolean
30+
>;
2631

2732
type Props = {
2833
variant: "landing" | "tw";
@@ -33,6 +38,7 @@ export const useTWBreakpoints = (
3338
variant: "tw",
3439
},
3540
): TWBreakpoints => {
41+
const [xs, setXs] = React.useState(true);
3642
const [sm, setSm] = React.useState(true);
3743
const [md, setMd] = React.useState(true);
3844
const [lg, setLg] = React.useState(true);
@@ -41,10 +47,14 @@ export const useTWBreakpoints = (
4147

4248
React.useEffect(() => {
4349
if (typeof window !== "undefined") {
44-
const [smQuery, mdQuery, lgQuery, xlQuery, xxlQuery] = breakpoints[
45-
props.variant
46-
].map((bp) => window.matchMedia(`(min-width: ${bp}px)`));
50+
const [xsQuery, smQuery, mdQuery, lgQuery, xlQuery, xxlQuery] =
51+
breakpoints[props.variant].map((bp) =>
52+
window.matchMedia(`(min-width: ${bp}px)`),
53+
);
4754

55+
const xsHandler = (e: MediaQueryListEvent) => {
56+
setXs(e.matches);
57+
};
4858
const smHandler = (e: MediaQueryListEvent) => {
4959
setSm(e.matches);
5060
};
@@ -61,12 +71,14 @@ export const useTWBreakpoints = (
6171
setXxl(e.matches);
6272
};
6373

74+
xsQuery.addEventListener("change", xsHandler);
6475
smQuery.addEventListener("change", smHandler);
6576
mdQuery.addEventListener("change", mdHandler);
6677
lgQuery.addEventListener("change", lgHandler);
6778
xlQuery.addEventListener("change", xlHandler);
6879
xxlQuery.addEventListener("change", xxlHandler);
6980

81+
setXs(xsQuery.matches);
7082
setSm(smQuery.matches);
7183
setMd(mdQuery.matches);
7284
setLg(lgQuery.matches);
@@ -84,6 +96,7 @@ export const useTWBreakpoints = (
8496
}, []);
8597

8698
return {
99+
xs,
87100
sm,
88101
md,
89102
lg,

0 commit comments

Comments
 (0)