Skip to content

Commit 94ce116

Browse files
committed
change editor with @cesdk/cesdk-js
0 parents  commit 94ce116

File tree

164 files changed

+14475
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+14475
-0
lines changed

.editorconfig

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
12+
# Matches multiple files with brace expansion notation
13+
# Set default charset
14+
# 4 space indentation
15+
[*.{js,jsx,ts,tsx}]
16+
indent_style = space
17+
indent_size = 2
18+
19+
# Matches the exact files either package.json or .travis.yml
20+
[{package.json,.travis.yml}]
21+
indent_style = space
22+
indent_size = 2
23+

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NEXT_PUBLIC_SUPABASE_URL=supabase_url
2+
NEXT_PUBLIC_SUPABASE_ANON_KEY=supabase_key
3+
NEXT_PUBLIC_GOOGLE_FONTS_API_KEY=google_font_api_key

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# env files
29+
.env*
30+
!.env.example
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts
38+
/test-results/
39+
/playwright-report/
40+
/playwright/.cache/
41+
/tests/.auth/

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.13.0

.prettierignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# env files
29+
.env*
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

.prettierrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailingCommas": "es5",
3+
"semi": true,
4+
"singleQuote": false
5+
}

README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# FlapJack Editor
2+
3+
Menu editor.
4+
5+
## Requirements
6+
7+
This project uses [Supabase](https://supabase.com/) for the database.
8+
9+
To be able to run this project, make sure you have these installed on your local machine:
10+
11+
- [Node](https://nodejs.org/en)
12+
- [Docker](https://docs.docker.com/engine/install/)
13+
- [Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable) as the package manager
14+
15+
## Available Commands
16+
17+
### `yarn dev`
18+
19+
Run the development server.
20+
21+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
22+
23+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
24+
25+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
26+
27+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
28+
29+
### `yarn db:start`
30+
31+
Start the local database.
32+
33+
To start the local database, make sure you have **docker-daemon** running.
34+
35+
After starting the local database, you can go to [localhost:54323](http://localhost:54323) to interract with the supabase interface.
36+
37+
Then create a `.env.development` file following the structure of the [.env.example](./.env.example) and update the `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY` with the keys you got.
38+
39+
### `yarn db:stop`
40+
41+
Stop the local database.
42+
43+
All the data you have added to the database will be deleted.
44+
45+
If you want to persist your newly added data, run
46+
47+
```bash
48+
yarn db:stop --backup
49+
```
50+
51+
### `yarn test:e2e`
52+
53+
Run all the end-to-end tests.
54+
55+
Requires to start the database before running the tests.
56+
57+
### `yarn test:e2e:headless`
58+
59+
Test the application without the UI.
60+
61+
Requires to start the database before running the tests.

components/AuthDialog.tsx

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import { Modal, Grid, Stack, Text, Flex } from "@mantine/core";
2+
import { Auth, ThemeSupa } from "@supabase/auth-ui-react";
3+
import { useSupabaseClient } from "@supabase/auth-helpers-react";
4+
import { useRouter } from "next/router";
5+
import Image from 'next/image'
6+
import theme from "../config/theme";
7+
8+
interface IAuthDialogProps {
9+
opened: boolean;
10+
onClose: () => void;
11+
}
12+
type ValuePropProps = {
13+
number: number
14+
title: string
15+
description: string
16+
}
17+
18+
const ValueProp = ({ number, title, description }: ValuePropProps) => {
19+
return (
20+
<Flex>
21+
<div style={{
22+
border: 'solid 2px #C1C2C5',
23+
borderRadius: "100px",
24+
width: '30px',
25+
height: '30px',
26+
display: 'flex',
27+
alignItems: 'center',
28+
justifyContent: 'center'
29+
}}>
30+
<Text
31+
color={theme.colors.yellow[9]}
32+
>{number}</Text>
33+
</div>
34+
<div style={{ marginLeft: '10px' }}>
35+
<Text
36+
color={theme.colors.dark[3]}
37+
>{title}</Text>
38+
<Text
39+
fz={theme.fontSizes.xs}
40+
color={theme.colors.dark[1]}
41+
>{description}</Text>
42+
</div>
43+
</Flex >
44+
)
45+
}
46+
const SalesContent = () => {
47+
return (
48+
<Stack>
49+
<Image
50+
src="/upsell-image-small.png"
51+
width={500}
52+
height={300}
53+
alt="this is the alt text"
54+
placeholder="blur"
55+
blurDataURL="/upsell-image-blur.jpg"
56+
/>
57+
<Text
58+
align="center"
59+
fz="xl"
60+
weight={300}
61+
color="#343A40"
62+
>Your Menu is Almost Ready to Use</Text>
63+
<Stack>
64+
<ValueProp number={1} title="Save Your Work" description="Keep your menu up to date" />
65+
<ValueProp number={2} title="Unlimited downloads" description="Get unlimited high-res and watermark-free downloads" />
66+
<ValueProp number={3} title="Endless Designs" description="Unlock access to the most beautiful catalog of menus online" />
67+
</Stack>
68+
</Stack>
69+
)
70+
}
71+
72+
const AuthDialog = ({ opened, onClose }: IAuthDialogProps) => {
73+
const supabase = useSupabaseClient();
74+
const router = useRouter();
75+
const origin = typeof window !== 'undefined' && window.location.origin ? window.location.origin : '';
76+
77+
return (
78+
<Modal
79+
opened={opened}
80+
onClose={onClose}
81+
size="xl"
82+
radius="md"
83+
withCloseButton={false}
84+
padding={8}
85+
centered={true}
86+
>
87+
<Grid>
88+
<Grid.Col
89+
span={6}
90+
bg={theme.colors.gray[1]}
91+
sx={{ borderRadius: '8px 0 0 8px' }}
92+
p="xl"
93+
>
94+
<SalesContent />
95+
</Grid.Col>
96+
<Grid.Col
97+
span={6}
98+
bg={"#fff"}
99+
p="xl"
100+
sx={{ borderRadius: '0 8px 8px 0' }}
101+
>
102+
<Auth
103+
redirectTo={`${origin}${router.asPath}`}
104+
supabaseClient={supabase}
105+
appearance={{
106+
theme: ThemeSupa,
107+
variables: {
108+
default: {
109+
colors: {
110+
brand: 'orange',
111+
brandAccent: 'darkOrange',
112+
},
113+
},
114+
},
115+
}}
116+
providers={["google", "facebook"]}
117+
magicLink
118+
view="sign_up"
119+
localization={{
120+
variables: {
121+
sign_up: {
122+
social_provider_text: 'Sign up with',
123+
},
124+
},
125+
}}
126+
127+
/>
128+
<Text fz="6pt" ta="center" color={theme.colors.dark[0]} lh="12px">By providing us with your information you are consenting to the collection and use
129+
of vour information in accordance with our <a href="https://www.flapjack.co/terms-of-use">Terms of Service</a> and <a href="https://www.flapjack.co/privacy-policy">Privacy Policy</a>.</Text>
130+
</Grid.Col>
131+
</Grid>
132+
</Modal>
133+
);
134+
};
135+
136+
export default AuthDialog;

0 commit comments

Comments
 (0)