chore(lp): 📦️ Import existing Landing page
This commit is contained in:
78
apps/landing-page/lib/chakraTheme.ts
Normal file
78
apps/landing-page/lib/chakraTheme.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import { extendTheme } from '@chakra-ui/react'
|
||||
|
||||
const fonts = {
|
||||
heading: 'Outfit',
|
||||
body: 'Open Sans',
|
||||
}
|
||||
|
||||
const colors = {
|
||||
blue: {
|
||||
50: '#e0edff',
|
||||
100: '#b0caff',
|
||||
200: '#7ea6ff',
|
||||
300: '#4b83ff',
|
||||
400: '#1a5fff',
|
||||
500: '#0042da',
|
||||
600: '#0036b4',
|
||||
700: '#002782',
|
||||
800: '#001751',
|
||||
900: '#1a202c',
|
||||
},
|
||||
orange: {
|
||||
50: '#fff1da',
|
||||
100: '#ffd7ae',
|
||||
200: '#ffbf7d',
|
||||
300: '#ffa54c',
|
||||
400: '#ff8b1a',
|
||||
500: '#e67200',
|
||||
600: '#b45800',
|
||||
700: '#813e00',
|
||||
800: '#4f2500',
|
||||
900: '#200b00',
|
||||
},
|
||||
yellow: {
|
||||
50: '#fff9da',
|
||||
100: '#ffedad',
|
||||
200: '#ffe17d',
|
||||
300: '#ffd54b',
|
||||
400: '#ffc91a',
|
||||
500: '#e6b000',
|
||||
600: '#b38800',
|
||||
700: '#806200',
|
||||
800: '#4e3a00',
|
||||
900: '#1d1400',
|
||||
},
|
||||
}
|
||||
|
||||
const components = {
|
||||
Button: {
|
||||
defaultProps: {
|
||||
colorScheme: 'blue',
|
||||
},
|
||||
},
|
||||
NumberInput: {
|
||||
defaultProps: {
|
||||
focusBorderColor: 'blue.200',
|
||||
},
|
||||
},
|
||||
Input: {
|
||||
defaultProps: {
|
||||
focusBorderColor: 'blue.200',
|
||||
},
|
||||
},
|
||||
Popover: {
|
||||
baseStyle: {
|
||||
popper: {
|
||||
width: 'fit-content',
|
||||
maxWidth: 'fit-content',
|
||||
},
|
||||
},
|
||||
},
|
||||
Link: {
|
||||
baseStyle: {
|
||||
_hover: { textDecoration: 'none' },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const theme = extendTheme({ fonts, components, colors })
|
||||
16
apps/landing-page/lib/landbot.ts
Normal file
16
apps/landing-page/lib/landbot.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
const loadLandbot = (): Promise<void> =>
|
||||
new Promise((resolve) => {
|
||||
const existingScript = document.getElementById('landbot-lib')
|
||||
if (!existingScript) {
|
||||
const script = document.createElement('script')
|
||||
script.src = 'https://static.landbot.io/landbot-3/landbot-3.0.0.js'
|
||||
script.id = 'landbot-lib'
|
||||
document.body.appendChild(script)
|
||||
script.onload = () => {
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
if (existingScript) resolve()
|
||||
})
|
||||
|
||||
export default loadLandbot
|
||||
62
apps/landing-page/lib/notion.ts
Normal file
62
apps/landing-page/lib/notion.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Client } from '@notionhq/client'
|
||||
|
||||
const notion = new Client({
|
||||
auth: process.env.NOTION_API_TOKEN,
|
||||
})
|
||||
|
||||
export const getDatabase = async (databaseId: string) => {
|
||||
const response = await notion.databases.query({
|
||||
database_id: databaseId,
|
||||
sorts: [
|
||||
{
|
||||
property: 'Created',
|
||||
direction: 'descending',
|
||||
},
|
||||
],
|
||||
filter: {
|
||||
property: 'Published',
|
||||
checkbox: {
|
||||
equals: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
return response.results
|
||||
}
|
||||
|
||||
export const getFullDatabase = async (databaseId: string) => {
|
||||
const response = await notion.databases.query({
|
||||
database_id: databaseId,
|
||||
sorts: [
|
||||
{
|
||||
property: 'Created',
|
||||
direction: 'descending',
|
||||
},
|
||||
],
|
||||
})
|
||||
return response.results
|
||||
}
|
||||
|
||||
export const getPage = async (databaseId: string, slug: string) => {
|
||||
const { results } = await notion.databases.query({
|
||||
database_id: databaseId,
|
||||
filter: {
|
||||
property: 'Slug',
|
||||
text: {
|
||||
equals: slug,
|
||||
},
|
||||
},
|
||||
})
|
||||
if (results.length === 0) return
|
||||
const page_id = results.pop()?.id
|
||||
if (!page_id) return
|
||||
const response = await notion.pages.retrieve({ page_id })
|
||||
return response
|
||||
}
|
||||
|
||||
export const getBlocks = async (blockId: string) => {
|
||||
const response = await notion.blocks.children.list({
|
||||
block_id: blockId,
|
||||
page_size: 50,
|
||||
})
|
||||
return response.results
|
||||
}
|
||||
14
apps/landing-page/lib/typeform.ts
Normal file
14
apps/landing-page/lib/typeform.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
const loadTypeform = (): Promise<void> =>
|
||||
new Promise((resolve) => {
|
||||
const existingScript = document.getElementById('typeform-lib')
|
||||
if (!existingScript) {
|
||||
const script = document.createElement('script')
|
||||
script.innerHTML = `(function() { var qs,js,q,s,d=document, gi=d.getElementById, ce=d.createElement, gt=d.getElementsByTagName, id="typef_orm", b="https://embed.typeform.com/"; if(!gi.call(d,id)) { js=ce.call(d,"script"); js.id=id; js.src=b+"embed.js"; q=gt.call(d,"script")[0]; q.parentNode.insertBefore(js,q) } })()`
|
||||
script.id = 'typeform-lib'
|
||||
document.body.appendChild(script)
|
||||
resolve()
|
||||
}
|
||||
if (existingScript) resolve()
|
||||
})
|
||||
|
||||
export default loadTypeform
|
||||
Reference in New Issue
Block a user