Skip to content

Commit 9994cc4

Browse files
committed
Merge branch 'main' into 19-adding-icon-options
2 parents e1deef4 + b92b49e commit 9994cc4

File tree

7 files changed

+11639
-26
lines changed

7 files changed

+11639
-26
lines changed

content/pages/home.mdx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,23 @@ blocks:
1616
_template: codeButton
1717
media: /uploads/TinaDocs Design System.png
1818
informationBlock1:
19-
title: Open Source
19+
title: 'Visual Editing '
2020
desc: >
21-
TinaDocs is open source and **free to use**. Edit and extend however you
22-
like.
21+
TinaDocs turns your static markdown into a **live editing experience**.
22+
Let your team edit content directly on the page.
23+
icon: Eye
2324
informationBlock2:
24-
title: GitHub Backed
25+
title: Git-Backed Workflow
2526
desc: >
26-
TinaDocs is backed by GitHub, so **you control your content** in
27-
document format.
27+
Content **lives in your repo,** not a database. Every edit is
28+
version-controlled by default.
29+
icon: FaGithub
2830
informationBlock3:
29-
title: API Generation
31+
title: 'API Documentation '
3032
desc: >
3133
Create document pages from **your own OpenAPI spec**, with tailored
3234
components for your API.
35+
icon: GitBranch
3336
_template: Hero
3437
- quote: 'Tina is {transforming} the way we do docs at Unity'
3538
author: Anton Iancu

next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { NextConfig } from 'next'
22

33
const nextConfig: NextConfig = {
4+
assetPrefix: '/tina-docs',
45
images: {
56
remotePatterns: [
67
{

src/components/blocks/Banner/Banner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export default function Banner({ data }: { data: any }) {
2323
<div className="flex flex-col max-w-2xl">
2424
<div className="flex text-4xl md:text-5xl pb-6">
2525
<p className="italic">
26-
<span className="text-orange-500 font-bold">"</span>
26+
<span className="text-primary font-bold">"</span>
2727
{formatQuoteWithBrackets(data.quote)}
28-
<span className="text-orange-500 font-bold">"</span>
28+
<span className="text-primary font-bold">"</span>
2929
</p>
3030
</div>
3131
<p className="text-lg md:text-xl">{data.author}</p>

src/components/blocks/Hero/Hero.template.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { iconOptions } from "@/src/constants";
12
import { Template } from "tinacms";
23

34
export const actionsButtonTemplateFields = {
@@ -71,7 +72,7 @@ export const HeroBlockSchema: Template = {
7172
name: "Hero",
7273
label: "Hero",
7374
ui: {
74-
previewSrc: '/blocks/hero.png',
75+
previewSrc: "/blocks/hero.png",
7576
},
7677
fields: [
7778
{ name: "title", type: "string", label: "Title" },
@@ -106,7 +107,12 @@ export const HeroBlockSchema: Template = {
106107
fields: [
107108
{ name: "title", type: "string", label: "Title" },
108109
{ name: "desc", type: "rich-text", label: "Description" },
109-
{ name: "icon", type: "image", label: "Icon" },
110+
{
111+
name: "icon",
112+
label: "Icon",
113+
type: "string",
114+
options: iconOptions,
115+
},
110116
],
111117
},
112118
{
@@ -116,7 +122,12 @@ export const HeroBlockSchema: Template = {
116122
fields: [
117123
{ name: "title", type: "string", label: "Title" },
118124
{ name: "desc", type: "rich-text", label: "Description" },
119-
{ name: "icon", type: "image", label: "Icon" },
125+
{
126+
name: "icon",
127+
label: "Icon",
128+
type: "string",
129+
options: iconOptions,
130+
},
120131
],
121132
},
122133
{
@@ -126,7 +137,12 @@ export const HeroBlockSchema: Template = {
126137
fields: [
127138
{ name: "title", type: "string", label: "Title" },
128139
{ name: "desc", type: "rich-text", label: "Description" },
129-
{ name: "icon", type: "image", label: "Icon" },
140+
{
141+
name: "icon",
142+
label: "Icon",
143+
type: "string",
144+
options: iconOptions,
145+
},
130146
],
131147
},
132148
],

src/components/blocks/Hero/Hero.tsx

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,33 @@ import {
1515
import Lenis from "lenis";
1616
import { CodeButton } from "@/components/ui/code-button";
1717
import { TinaMarkdown, TinaMarkdownContent } from "tinacms/dist/rich-text";
18+
import { Icon } from "../../icon";
1819

1920
function InformationBlock({
2021
title,
2122
description,
23+
icon,
2224
}: {
2325
title: string;
2426
description: TinaMarkdownContent;
27+
icon?: string;
2528
}) {
2629
return (
2730
<div className="max-w-md flex flex-col gap-4 border border-white/20 rounded-md p-4 bg-[#191918]/60 shadow-lg text-left 2xl:w-lg w-sm">
28-
<h2 className="text-2xl font-semibold">{title}</h2>
31+
<div className="flex items-center gap-2">
32+
{icon && (
33+
<Icon
34+
data={{
35+
name: icon,
36+
color: "primary",
37+
size: "small",
38+
style: "regular",
39+
}}
40+
/>
41+
)}
42+
<h2 className="text-2xl font-semibold">{title}</h2>
43+
</div>
44+
2945
<TinaMarkdown content={description} />
3046
</div>
3147
);
@@ -38,6 +54,10 @@ export default function Hero({ data }: { data?: PageBlocksHero }) {
3854
offset: ["start start", "end end"],
3955
});
4056

57+
useMotionValueEvent(scrollYProgress, "change", (latest) => {
58+
console.log("ScrollYProgress: ", latest);
59+
});
60+
4161
const [screenHeight, setScreenHeight] = useState(0);
4262
const [screenWidth, setScreenWidth] = useState(0);
4363

@@ -185,14 +205,17 @@ export default function Hero({ data }: { data?: PageBlocksHero }) {
185205
<InformationBlock
186206
title={data?.informationBlock1?.title || "Undefined Title"}
187207
description={data?.informationBlock1?.desc}
208+
icon={data?.informationBlock1?.icon || undefined}
188209
/>
189210
<InformationBlock
190211
title={data?.informationBlock2?.title || "Undefined Title"}
191212
description={data?.informationBlock2?.desc}
213+
icon={data?.informationBlock2?.icon || undefined}
192214
/>
193215
<InformationBlock
194216
title={data?.informationBlock3?.title || "Undefined Title"}
195217
description={data?.informationBlock3?.desc}
218+
icon={data?.informationBlock3?.icon || undefined}
196219
/>
197220
</motion.div>
198221

@@ -210,14 +233,17 @@ export default function Hero({ data }: { data?: PageBlocksHero }) {
210233
/>
211234
</motion.div>
212235
</div>
213-
<div className="block lg:hidden pt-16">
214-
<Image
215-
src={data.media}
216-
alt={data.title || ""}
217-
width={1000}
218-
height={1000}
219-
className="border-10 border-[#F6F6F513] rounded-lg shadow-xl"
220-
/>
236+
237+
<div className="block lg:hidden pt-16 px-10 min-h-[30vh] md:min-h-[50vh] overflow-hidden p-10">
238+
<div className="absolute left-1/2 -translate-x-1/2 bg-[#252934] rounded-lg border-[0.5px] border-sand-6 shadow-xl p-2 w-[calc(100%-2rem)] max-w-2xl">
239+
<Image
240+
src={data.media}
241+
alt={data.title || ""}
242+
width={1000}
243+
height={1000}
244+
className=" border-[#F6F6F513] rounded-lg shadow-xl "
245+
/>
246+
</div>
221247
</div>
222248
</>
223249
)}

styles.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,14 @@
120120
--color-amber-12: var(--amber-12);
121121
}
122122

123-
:root {
124-
--radius: 0.5rem;
123+
:root { --radius: 0.5rem;
125124
--background: #111110;
126125
--foreground: oklch(0.985 0 0);
127126
--card: oklch(0.205 0 0);
128127
--card-foreground: oklch(0.985 0 0);
129128
--popover: oklch(0.205 0 0);
130129
--popover-foreground: oklch(0.985 0 0);
131-
--primary: #CA3C11;
130+
--primary: #EC4815;
132131
--primary-foreground: oklch(0.205 0 0);
133132
--secondary: oklch(0.269 0 0);
134133
--secondary-foreground: oklch(0.985 0 0);
@@ -160,7 +159,11 @@
160159
* {
161160
@apply border-border outline-ring/50;
162161
}
162+
html {
163+
overflow-x: hidden;
164+
}
163165
body {
164166
@apply bg-background text-foreground;
167+
overflow-x: hidden;
165168
}
166169
}

tina/tina-lock.json

Lines changed: 11565 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)