Skip to content

Commit

Permalink
feat: add pages to sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
OliwierSellig committed Dec 30, 2024
1 parent 6092e14 commit 31dcd6d
Show file tree
Hide file tree
Showing 14 changed files with 436 additions and 69 deletions.
34 changes: 7 additions & 27 deletions apps/astro/src/global/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,13 @@ html {
scroll-padding-top: 123px;
}
body {
overflow: clip;
min-width: 320px;
-webkit-tap-highlight-color: transparent;
background: var(--background-100, #fffcf9);
color: var(--primary-900, #001b19);
font-family: 'Poppins', sans-serif;
font-size: 1rem;
line-height: 158%;
background-color: var(--neutral-200, #e9f2ed);
color: var(--neutral-800, #48514a);
font-family: 'Inter', sans-serif;
font-size: var(--typography-body-l, 1.125rem);
line-height: 1.55;
}

main,
Expand All @@ -175,11 +174,6 @@ main,
margin: 0 auto;
height: 100%;
}
main {
display: grid;
row-gap: var(--gap);
margin: clamp(32px, calc(80vw / 7.68), 80px) auto var(--gap);
}

h1,
.h1,
Expand All @@ -194,23 +188,9 @@ h5,
h6,
.h6 {
overflow-wrap: anywhere;
font-weight: 400;
font-weight: 500;
line-height: 128%;
color: var(--primary-800, #01403b);
strong {
font-weight: 400;
color: var(--primary-900, #001b19);
}
}
h1,
.h1,
h2,
.h2 {
font-size: clamp(calc(28rem / 16), calc(42vw / 7.68), calc(42rem / 16));
}
h3,
.h3 {
font-size: clamp(calc(18rem / 16), calc(24vw / 7.68), calc(24rem / 16));
font-family: 'Cabinet Grotesk', sans-serif;
}

.link {
Expand Down
14 changes: 7 additions & 7 deletions apps/sanity/schema/collectionTypes/Faq_Collection.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineField, defineType } from "sanity";
import { toPlainText } from "../../utils/to-plain-text";
import { defineField, defineType } from 'sanity'
import { toPlainText } from '../../utils/to-plain-text'

const title = 'Zbiór elementów FAQ';
const icon = () => '❓';
const title = 'FAQ items collection'
const icon = () => '❓'

export default defineType({
name: 'Faq_Collection',
Expand All @@ -14,13 +14,13 @@ export default defineType({
name: 'question',
type: 'Heading',
title: 'Pytanie',
validation: Rule => Rule.required(),
validation: (Rule) => Rule.required(),
}),
defineField({
name: 'answer',
type: 'PortableText',
title: 'Odpowiedź',
validation: Rule => Rule.required(),
validation: (Rule) => Rule.required(),
}),
],
preview: {
Expand All @@ -34,4 +34,4 @@ export default defineType({
icon,
}),
},
});
})
41 changes: 41 additions & 0 deletions apps/sanity/schema/singleTypes/About_Page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineField, defineType } from 'sanity'
import { defineSlugForDocument } from '../../utils/define-slug-for-document'

const name = 'About_Page'
const title = 'About us'
const slug = '/o-nas'
const icon = () => '👨‍🌾'

export default defineType({
name: name,
type: 'document',
title: title,
icon: icon,
options: { documentPreview: true },
fields: [
...defineSlugForDocument({ slug: slug }),
defineField({
name: 'components',
type: 'components',
title: 'Page Components',
}),
defineField({
name: 'seo',
type: 'seo',
title: 'SEO',
group: 'seo',
}),
],
groups: [
{
name: 'seo',
title: 'SEO',
},
],
preview: {
prepare: () => ({
title,
subtitle: slug,
}),
},
})
41 changes: 41 additions & 0 deletions apps/sanity/schema/singleTypes/ArchitectsZone_Page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineField, defineType } from 'sanity'
import { defineSlugForDocument } from '../../utils/define-slug-for-document'

const name = 'ArchitectsZone_Page'
const title = "Architect's Zone"
const slug = '/architects-zone'
const icon = () => '🏛️'

export default defineType({
name: name,
type: 'document',
title: title,
icon: icon,
options: { documentPreview: true },
fields: [
...defineSlugForDocument({ slug: slug }),
defineField({
name: 'components',
type: 'components',
title: 'Page Components',
}),
defineField({
name: 'seo',
type: 'seo',
title: 'SEO',
group: 'seo',
}),
],
groups: [
{
name: 'seo',
title: 'SEO',
},
],
preview: {
prepare: () => ({
title,
subtitle: slug,
}),
},
})
41 changes: 41 additions & 0 deletions apps/sanity/schema/singleTypes/Blog_Page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineField, defineType } from 'sanity'
import { defineSlugForDocument } from '../../utils/define-slug-for-document'

const name = 'Blog_Page'
const title = 'Blog'
const slug = '/blog'
const icon = () => '📰'

export default defineType({
name: name,
type: 'document',
title: title,
icon: icon,
options: { documentPreview: true },
fields: [
...defineSlugForDocument({ slug: slug }),
defineField({
name: 'components',
type: 'components',
title: 'Page Components',
}),
defineField({
name: 'seo',
type: 'seo',
title: 'SEO',
group: 'seo',
}),
],
groups: [
{
name: 'seo',
title: 'SEO',
},
],
preview: {
prepare: () => ({
title,
subtitle: slug,
}),
},
})
41 changes: 41 additions & 0 deletions apps/sanity/schema/singleTypes/BusinessServices_Page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineField, defineType } from 'sanity'
import { defineSlugForDocument } from '../../utils/define-slug-for-document'

const name = 'BusinessServices_Page'
const title = 'Business Services'
const slug = '/business-services'
const icon = () => '💼'

export default defineType({
name: name,
type: 'document',
title: title,
icon: icon,
options: { documentPreview: true },
fields: [
...defineSlugForDocument({ slug: slug }),
defineField({
name: 'components',
type: 'components',
title: 'Page Components',
}),
defineField({
name: 'seo',
type: 'seo',
title: 'SEO',
group: 'seo',
}),
],
groups: [
{
name: 'seo',
title: 'SEO',
},
],
preview: {
prepare: () => ({
title,
subtitle: slug,
}),
},
})
41 changes: 41 additions & 0 deletions apps/sanity/schema/singleTypes/Contact_Page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineField, defineType } from 'sanity'
import { defineSlugForDocument } from '../../utils/define-slug-for-document'

const name = 'Contact_Page'
const title = 'Contact'
const slug = '/contact'
const icon = () => '📧'

export default defineType({
name: name,
type: 'document',
title: title,
icon: icon,
options: { documentPreview: true },
fields: [
...defineSlugForDocument({ slug: slug }),
defineField({
name: 'components',
type: 'components',
title: 'Page Components',
}),
defineField({
name: 'seo',
type: 'seo',
title: 'SEO',
group: 'seo',
}),
],
groups: [
{
name: 'seo',
title: 'SEO',
},
],
preview: {
prepare: () => ({
title,
subtitle: slug,
}),
},
})
41 changes: 41 additions & 0 deletions apps/sanity/schema/singleTypes/InteriorDesign_Page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineField, defineType } from 'sanity'
import { defineSlugForDocument } from '../../utils/define-slug-for-document'

const name = 'InteriorDesign_Page'
const title = 'Interior Design'
const slug = '/interior-design'
const icon = () => '🛋️'

export default defineType({
name: name,
type: 'document',
title: title,
icon: icon,
options: { documentPreview: true },
fields: [
...defineSlugForDocument({ slug: slug }),
defineField({
name: 'components',
type: 'components',
title: 'Page Components',
}),
defineField({
name: 'seo',
type: 'seo',
title: 'SEO',
group: 'seo',
}),
],
groups: [
{
name: 'seo',
title: 'SEO',
},
],
preview: {
prepare: () => ({
title,
subtitle: slug,
}),
},
})
40 changes: 40 additions & 0 deletions apps/sanity/schema/singleTypes/NotFound_Page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { defineField, defineType } from 'sanity'
import { defineSlugForDocument } from '../../utils/define-slug-for-document'

const name = 'NotFound_Page'
const title = 'Not Found Page (404)'
const slug = '/404'

export default defineType({
name: name,
type: 'document',
title: title,
icon: () => '🔍',
options: { documentPreview: true },
fields: [
...defineSlugForDocument({ slug: slug }),
defineField({
name: 'components',
type: 'components',
title: 'Page Components',
}),
defineField({
name: 'seo',
type: 'seo',
title: 'SEO',
group: 'seo',
}),
],
groups: [
{
name: 'seo',
title: 'SEO',
},
],
preview: {
prepare: () => ({
title: title,
subtitle: slug,
}),
},
})
Loading

0 comments on commit 31dcd6d

Please sign in to comment.