Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9eb29b2
adding landing page
Nov 24, 2023
36f7fb7
resolved no-use-vars
Nov 24, 2023
85944a6
resolved no-use-vars
Nov 24, 2023
f62e6c8
resolved no-use-vars
Nov 24, 2023
64aa154
'feat/resolve-redirect'
Nov 24, 2023
e2ff356
'feat/resolve-redirect'
Nov 24, 2023
891c4f7
'feat/resolve-redirect'
Nov 24, 2023
07e5713
'feat/resolve-redirect'
Nov 24, 2023
c5d96cc
'feat/resolve-redirect'
Nov 24, 2023
f017e1f
feat/reciving-data-on-flow-and-nodes-modeling
Nov 25, 2023
b4524e9
feats: new pages and search form to get saved maps
Nov 25, 2023
579081a
feats: new pages and search form to get saved maps
Nov 25, 2023
5c9c295
fix: cleanup old imports
Nov 26, 2023
6fdebea
fix: cleanup old imports
Nov 26, 2023
126b392
a
Nov 26, 2023
a39a8c4
feat/new-header-styled-from-framer
Nov 29, 2023
93a4705
feat/new-header-styled-from-framer
Nov 29, 2023
89e6a98
feat/home-link-update
Nov 29, 2023
b7036a5
fix/resolved-lazy-styled-components-load
Nov 29, 2023
61f2e42
feat/map-styles-update-and-fix-height-on-safari
Nov 30, 2023
14bbbff
major updates: mobile header updated, seus-maps updated, mapas update…
Dec 4, 2023
97ddddd
feat/node-status-update and page-text-corrections
Dec 10, 2023
8c2e6ad
community link updated
izichtl Dec 12, 2023
570c12b
feat/new-form-update
izichtl Dec 15, 2023
8773d54
feat/added-google-form-embed
izichtl Dec 20, 2023
55bfac5
feat/google-forms-now-open-on-modal
izichtl Dec 22, 2023
a57deb5
login-updates and insights
izichtl Feb 1, 2024
432a6b0
feat/styles-corrections-and-new-features-release
izichtl Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"workbench.colorCustomizations": {
"activityBar.background": "#083428",
"titleBar.activeBackground": "#0B4937",
"titleBar.activeForeground": "#F2FDFA"
"activityBar.background": "#9afde2",
"titleBar.activeBackground": "#e2fff7",
"titleBar.activeForeground": "#0f1010"
},
"cSpell.words": [
"atencao",
"reasonslist"
"formik",
"mapadavida",
"mapjson",
"reasonslist",
"smoothstep",
"swipeable",
"Swipeable"
]
}
24 changes: 1 addition & 23 deletions app/(default)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
'use client'

import { useEffect } from 'react'

import AOS from 'aos'
import 'aos/dist/aos.css'

import Footer from '@/components/ui/footer'

export default function DefaultLayout({
children,
}: {
children: React.ReactNode
}) {

useEffect(() => {
AOS.init({
once: true,
disable: 'phone',
duration: 700,
easing: 'ease-out-cubic',
})
})

return (
<>
<main className="grow">

{children}

</main>

<Footer />
{children}
</>
)
}
13 changes: 9 additions & 4 deletions app/(default)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@

import React, { useEffect } from "react";
import React from "react";
import { redirect } from 'next/navigation';

export const metadata = {
title: 'Home - Simple',
description: 'Page description',
}
import FlowContainer from '@/components/flowContainer'

const RedirectComponent = ({ externalUrl }: any): null => {
redirect(externalUrl)
}

export default async function Home({ params }: any) {

return (
<FlowContainer />
<RedirectComponent externalUrl={"http://mapadavida.com"}/>
)
}
}
50 changes: 7 additions & 43 deletions app/api/form-handler/route.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,16 @@
import { NextResponse, NextRequest } from "next/server";
import crypto from 'crypto';
import NodeCache from 'node-cache';
import { cleanString } from "@/utils/string-modeling";
import { saveMap } from "@/database/save-map";
// @ts-ignore
import { v4 as uuidv4 } from 'uuid';
import { getMapFromHash } from "@/database/get-map";
const cache = new NodeCache();

export async function GET(request: NextRequest, response: any) {

const url = new URL(request.url);
const searchParams = new URLSearchParams(url.search);
const hash = searchParams.get("hash")
// const dados = cache.get(hash as string);
console.log(hash)
// const mockData = JSON.stringify({"firstName":"Ivan ","lastName":"Zichtl ","email":"izichtl@gmail.com","health":["Bom","Bom","Ruim"],"accept":"Sim","motivo":"OEOEOEOEOEOEOE"})
// console.log(mockData)
const mapData = await getMapFromHash(hash as string)
console.log(mapData)
return new NextResponse(JSON.stringify(mapData) as string, {
status: 200,
});

}
// export async function PUT(request: NextRequest, response: any) {
// console.log('@@@@@@@@@@@@@@')
// const jsonData = {
// submission_id: '19191919191',
// }
// const resultOfDB = await saveMap(jsonData)
// console.log(resultOfDB)
// return new NextResponse('' as string, {
// status: 200,
// });

// }



export async function POST(request: Request, response: any) {
console.log(process.env.DB_HOST)
export async function POST(request: Request) {
const bodyData = await request.formData() // bodyData now contains body
// TRANSFORMA EM ARRAY A KEYS PODENDO ITERAR SOBRE ELAS
const keysArray = Array.from(bodyData.keys());

const dataArry = keysArray.map((item: any) => {
const a = item.toString()
return { [a]: bodyData.get(item)}
})

// const keysArray = Array.from(bodyData.keys());
console.log(bodyData)
const submission_id = bodyData.get('submission_id')
const fullName = bodyData.get('name')
const email = bodyData.get('email')
Expand Down Expand Up @@ -100,11 +61,14 @@ export async function POST(request: Request, response: any) {
maps: [mindMap, bodyMap, spiritMap],
reasons: reasons.filter((reason: any) => reason !== null),
}
console.log(jsonData)
const hash = uuidv4()
const resultOfDB = await saveMap(jsonData, hash)
console.log(resultOfDB)

return NextResponse.redirect(new URL(`/loading?hash=${hash}`, request.url))
return NextResponse.redirect(`https://lifeflow.vercel.app/loading?hash=${hash}`, {
status: 301,
});
}


35 changes: 35 additions & 0 deletions app/api/map-handler/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { NextResponse, NextRequest } from "next/server";
import { getMapFromHash } from "@/database/get-map";
import { getMapFromUserData } from "@/database/get-maps";

export async function GET(request: NextRequest, response: any) {
const url = new URL(request.url);
const searchParams = new URLSearchParams(url.search);
const hash = searchParams.get("hash")
const mapData = await getMapFromHash(hash as string)
return new NextResponse(JSON.stringify(mapData) as string, {
status: 200,
});
}

export async function POST(request: Request, response: Response) {
const data = await request.json()
const mapData = await getMapFromUserData(data.day, data.mount, data.year, data.email)
if (mapData[0] === undefined) {
return new NextResponse(JSON.stringify({
success: false,
data: ['no-data']
}) as string, {
status: 200,
});
}
return new NextResponse(JSON.stringify({
success: true,
data: mapData
}) as string, {
status: 200,
});

}


14 changes: 14 additions & 0 deletions app/general-styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { PRIMARY_GRAY, PRIMARY_GREEN, SECONDARY_GRAY } from '@/utils/colors'
import styled from 'styled-components'

export const StyledMain = styled.main`
display: flex;
flex-direction: column;
height: 100%;
flex-grow: 1;
padding: 0px 100px;
background-color: "#F8F8FF";
@media (max-width: 768px) {
padding: 30px;
}
`
69 changes: 52 additions & 17 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,70 @@
'use client'
import './css/style.css'

import { Inter } from 'next/font/google'

import Header from '@/components/ui/header'
import { Oxygen, Noto_Serif } from 'next/font/google'
import StyleRegistry from './registry'
import Banner from '@/components/banner'
import { ThemeProvider, createTheme } from '@mui/material/styles';

const inter = Inter({
const oxygen = Oxygen({
subsets: ['latin'],
variable: '--font-inter',
display: 'swap'
weight: ['300', '400','700'],
variable: '--font-oxygen',
})

export const metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}
const noto_Serif = Noto_Serif({
subsets: ['latin'],
weight: ['400'],
variable: '--font-noto-Serif',
})

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {


const theme = createTheme({
palette: {
primary: {
main: '#018868',
},
secondary: {
main: '#A52A2A',
},
success: {
main: '#83C16C',
},
error: {
main: '#D32F2F',
},
warning: {
main: '#EF6C00',
},
info: {
main: '#D32F2F',
},
background: {
// @ts-ignore
default: '#E3E5E5',
},
},
});

return (
<html lang="en">
<body className={`${inter.variable} font-inter antialiased bg-white text-gray-900 tracking-tight`}>
<div className="flex flex-col min-h-screen overflow-hidden supports-[overflow:clip]:overflow-clip">
{/* <Header /> */}
{children}
{/* <Banner /> */}
</div>
<body className={`${noto_Serif.variable} ${oxygen.variable} antialiased bg-white text-gray-900 tracking-tight`}>
<ThemeProvider theme={theme}>
<StyleRegistry>
<div className="flex flex-col min-h-screen overflow-hidden supports-[overflow:clip]:overflow-clip">
{children}
<Banner />
</div>
</StyleRegistry>
</ThemeProvider>
</body>
</html>
)
}


24 changes: 1 addition & 23 deletions app/loading/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
'use client'

import { useEffect } from 'react'

import AOS from 'aos'
// import 'aos/dist/aos.css'

import Footer from '@/components/ui/footer'

export default function DefaultLayout({
children,
}: {
children: React.ReactNode
}) {

// useEffect(() => {
// AOS.init({
// once: true,
// disable: 'phone',
// duration: 700,
// easing: 'ease-out-cubic',
// })
// })

return (
<>
{/* <main className="grow"> */}

{children}

{/* </main> */}

{/* <Footer /> */}
{children}
</>
)
}
4 changes: 1 addition & 3 deletions app/loading/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ export const metadata = {
title: 'Home - Simple',
description: 'Page description',
}
import LoadingContainer from '@/components/loadingContainer'
import LoadingContainer from '@/components/LoadingContainer/loadingContainer'

export default async function Home({ params }: any) {


return (
<div className="flex items-center justify-center h-screen">
<div className="flex flex-col items-center justify-center p-8 w-350 h-350">
<LoadingContainer />
<p className="text-center mt-5">Loading!</p>
</div>
</div>
)
Expand Down
Loading