2
0

chore(lp): 📦️ Import existing Landing page

This commit is contained in:
Baptiste Arnaud
2022-02-09 18:40:40 +01:00
parent 65b30bfc48
commit 36be3577e1
136 changed files with 14867 additions and 20 deletions

View 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 })

View 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

View 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
}

View 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