Skip to content

Commit 9fbb7ce

Browse files
committed
Clapy generated code 2
1 parent 91b99d6 commit 9fbb7ce

File tree

14 files changed

+290
-60
lines changed

14 files changed

+290
-60
lines changed

package.json

Lines changed: 28 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,33 @@
11
{
2-
"name": "clapy-root",
3-
"version": "0.0.1",
4-
"description": "",
5-
"author": "",
6-
"private": true,
7-
"license": "UNLICENSED",
8-
"type": "module",
9-
"engines": {
10-
"node": ">=14"
11-
},
12-
"packageManager": "[email protected]",
13-
"workspaces": [
14-
"backend-clapy",
15-
"figma-plugin-clapy"
2+
"name": "clapy-react",
3+
"version": "1.0.0",
4+
"description": "A React app template for Clapy",
5+
"keywords": [
6+
"Clapy",
7+
"React",
8+
"TypeScript"
169
],
17-
"scripts": {
18-
"________________ development ________________": "",
19-
"dev": "npm-run-all --parallel plugin-dev dup console",
20-
"preview": "cd ../local-gen-clapy && yarn && npm run start",
21-
"console": "yarn hasura console",
22-
"upgr": "yarn upgrade-interactive",
23-
"dup": "docker compose stop dev && docker compose up -d --remove-orphans db hasura",
24-
"dup2": "docker compose stop backend && docker compose up -d dev",
25-
"upold": "UID=\"$(id -u)\" GID=\"$(id -g)\" docker-compose stop dev && UID=\"$(id -u)\" GID=\"$(id -g)\" docker-compose up -d db hasura backend",
26-
"stop": "docker compose stop",
27-
"fixtime": "sudo ntpdate -sb time.nist.gov",
28-
"start:local-gen-clapy": "cd ../local-gen-clapy && yarn start",
29-
"log": "docker compose logs -f --tail 100 backend",
30-
"analytics": "cd backend-clapy && yarn analytics",
31-
"gentypes": "graphql-code-generator -r dotenv/config",
32-
"________________ deployment ________________": "",
33-
"migrate:dev": "npm run hasura -- deploy --endpoint http://localhost:8089/",
34-
"migrate:staging": "npm run hasura:server -- deploy --endpoint updateme",
35-
"migrate:prod": "npm run hasura:server -- deploy --endpoint https://hasura-loitgf2s5q-ew.a.run.app/",
36-
"________________ implementation details ________________": "",
37-
"postinstall": "mkdir -p ../local-gen-clapy",
38-
"upwait": "yarn dup && sleep 5",
39-
"install:backend": "cd backend-clapy && yarn",
40-
"install:plugin": "cd figma-plugin-clapy && yarn",
41-
"plugin-dev": "cd figma-plugin-clapy && yarn dev",
42-
"plugin-test": "cd figma-plugin-clapy && yarn start",
43-
"hasura:squash": "yarn hasura migrate squash --database-name \"Clapy DB\"",
44-
"hasura": "$(yarn bin hasura) --project db/hasura --envfile ../../.env --skip-update-check",
45-
"hasura:server": "$(yarn bin hasura) --project db/hasura --skip-update-check",
46-
"pinggit": "ssh -T [email protected]",
47-
"kill": "sudo kill -9 `sudo lsof -t -i:9001`; sudo kill -9 `sudo lsof -t -i:9000`; sudo kill -9 `sudo lsof -t -i:3000`; sudo kill -9 `sudo lsof -t -i:9230`; echo Done",
48-
"free": "sudo ./scripts/cleanram.sh"
10+
"main": "src/index.tsx",
11+
"dependencies": {
12+
"react": "18.2.0",
13+
"react-dom": "18.2.0"
4914
},
5015
"devDependencies": {
51-
"@graphql-codegen/cli": "^2.11.6",
52-
"@graphql-codegen/schema-ast": "^2.5.1",
53-
"@graphql-codegen/typescript": "^2.7.3",
54-
"@types/eslint": "^8.4.6",
55-
"@types/prettier": "^2.7.0",
56-
"dotenv": "^16.0.1",
57-
"eslint": "^8.22.0",
58-
"graphql": "^16.6.0",
59-
"hasura-cli": "^2.9.0",
60-
"npm-run-all": "^4.1.5",
61-
"prettier": "^2.7.1",
62-
"tslib": "^2.4.0",
63-
"typescript": "^4.7.4"
64-
}
16+
"@types/react": "18.0.17",
17+
"@types/react-dom": "18.0.6",
18+
"react-scripts": "5.0.1",
19+
"typescript": "4.7.4"
20+
},
21+
"scripts": {
22+
"start": "react-scripts start",
23+
"build": "react-scripts build",
24+
"test": "react-scripts test --env=jsdom",
25+
"eject": "react-scripts eject"
26+
},
27+
"browserslist": [
28+
">0.2%",
29+
"not dead",
30+
"not ie <= 11",
31+
"not op_mini all"
32+
]
6533
}

public/index.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<meta name="theme-color" content="#000000">
8+
<!--
9+
manifest.json provides metadata used when your web app is added to the
10+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
11+
-->
12+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
13+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
14+
<!--
15+
Notice the use of %PUBLIC_URL% in the tags above.
16+
It will be replaced with the URL of the `public` folder during the build.
17+
Only files inside the `public` folder can be referenced from the HTML.
18+
19+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
20+
work correctly both with client-side routing and a non-root public URL.
21+
Learn how to configure a non-root public URL by running `npm run build`.
22+
-->
23+
<title>React App</title>
24+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@600&display=swap">
25+
</head>
26+
27+
<body>
28+
<noscript>
29+
You need to enable JavaScript to run this app.
30+
</noscript>
31+
<div id="root"></div>
32+
<!--
33+
This HTML file is a template.
34+
If you open it directly in the browser, you will see an empty page.
35+
36+
You can add webfonts, meta tags, or analytics to this file.
37+
The build step will place the bundled scripts into the <body> tag.
38+
39+
To begin the development, run `npm start` or `yarn start`.
40+
To create a production bundle, use `npm run build` or `yarn build`.
41+
-->
42+
</body>
43+
44+
</html>

public/manifest.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}

public/robots.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

src/App.module.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.root {
2+
height: 100%;
3+
font-family: sans-serif;
4+
background-color: #f5f5f5;
5+
flex-basis: 100%;
6+
overflow-y: auto;
7+
align-items: center;
8+
justify-content: center;
9+
flex-direction: column;
10+
}

src/App.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { memo } from 'react';
2+
import type { FC } from 'react';
3+
4+
import resets from './_resets.module.css';
5+
import classes from './App.module.css';
6+
import { Heading } from './components/Heading/Heading';
7+
import './variables.css';
8+
9+
interface Props {
10+
className?: string;
11+
}
12+
export const App: FC<Props> = memo(function App(props = {}) {
13+
return (
14+
<div className={`${resets.clapyResets} ${classes.root}`}>
15+
<Heading />
16+
</div>
17+
);
18+
});

src/_resets.module.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.clapyResets,
2+
.clapyResets * {
3+
box-sizing: border-box;
4+
margin: 0;
5+
padding: 0;
6+
background: none;
7+
border: none;
8+
flex-shrink: 0;
9+
text-decoration: none;
10+
min-width: 0;
11+
overflow-wrap: anywhere;
12+
}
13+
14+
.clapyResets,
15+
.clapyResets :not(span, a, ul, ol, li, p) {
16+
display: flex;
17+
}
18+
19+
.clapyResets ul,
20+
.clapyResets ol {
21+
text-indent: 0;
22+
padding-inline-start: 1.5em;
23+
}
24+
25+
.clapyResets p:empty::before {
26+
content: '';
27+
display: inline-block;
28+
}
29+
30+
.clapyResets img {
31+
object-fit: contain;
32+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.root {
2+
height: min-content;
3+
align-self: stretch;
4+
flex-direction: column;
5+
}
6+
.textBlock {
7+
color: #00359e;
8+
font-size: 60px;
9+
line-height: 72px;
10+
font-weight: 600;
11+
font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
12+
'Liberation Sans', sans-serif;
13+
letter-spacing: -0.02em;
14+
}
15+
.textBlock2 {
16+
color: #00359e;
17+
font-size: 60px;
18+
line-height: 72px;
19+
font-weight: 600;
20+
font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
21+
'Liberation Sans', sans-serif;
22+
letter-spacing: -0.02em;
23+
}

src/components/Heading/Heading.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { memo } from 'react';
2+
import type { FC } from 'react';
3+
4+
import resets from '../../_resets.module.css';
5+
import classes from './Heading.module.css';
6+
7+
interface Props {
8+
className?: string;
9+
}
10+
/* @figmaId I2:55432;1307:4910 */
11+
export const Heading: FC<Props> = memo(function Heading(props = {}) {
12+
return (
13+
<div className={`${resets.clapyResets} ${classes.root}`}>
14+
<div className={classes.textBlock}>Super simplified</div>
15+
<div className={classes.textBlock2}>customer service</div>
16+
</div>
17+
);
18+
});

src/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { StrictMode } from 'react';
2+
import { createRoot } from 'react-dom/client';
3+
4+
import { App } from './App';
5+
import './resets.css';
6+
7+
createRoot(document.getElementById('root')!).render(
8+
<StrictMode>
9+
<App />
10+
</StrictMode>,
11+
);

0 commit comments

Comments
 (0)