Skip to content

Commit 98650af

Browse files
authored
committing most up to date working frontend (#546)
1 parent 6ee51b2 commit 98650af

Some content is hidden

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

47 files changed

+1299
-746
lines changed

frontend/.eslintrc.json

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
"plugin:import/typescript",
1515
"plugin:react/jsx-runtime"
1616
],
17+
"ignorePatterns": [
18+
"babel-plugin-macros.config.js",
19+
"tailwind.config.js",
20+
"prettier.config.js",
21+
"postcss.config.js",
22+
"vite.config.ts"
23+
],
1724
"parser": "@typescript-eslint/parser",
1825
"parserOptions": {
1926
"ecmaVersion": 12,
@@ -32,42 +39,43 @@
3239
"@typescript-eslint/no-shadow": "off",
3340
"no-unused-vars": "off",
3441
"@typescript-eslint/no-unused-vars": [
35-
1,
42+
"warn",
3643
{
3744
"varsIgnorePattern": "^_",
3845
"argsIgnorePattern": "^_"
3946
}
4047
],
4148
"@typescript-eslint/naming-convention": [
42-
"error",
43-
{
44-
"selector": "default",
45-
"format": ["camelCase"],
46-
"leadingUnderscore": "allow",
47-
"trailingUnderscore": "allow"
48-
},
49+
"error",
50+
{
51+
"selector": "default",
52+
"format": ["camelCase"],
53+
"leadingUnderscore": "allow",
54+
"trailingUnderscore": "allow"
55+
},
4956

50-
{
51-
"selector": "variable",
52-
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
53-
"leadingUnderscore": "allow",
54-
"trailingUnderscore": "allow"
55-
},
57+
{
58+
"selector": "variable",
59+
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
60+
"leadingUnderscore": "allow",
61+
"trailingUnderscore": "allow"
62+
},
5663

57-
{
58-
"selector": "function",
59-
"format": ["camelCase", "PascalCase"]
60-
},
64+
{
65+
"selector": "function",
66+
"format": ["camelCase", "PascalCase"]
67+
},
6168

62-
{
63-
"selector": "typeLike",
64-
"format": ["PascalCase"]
65-
},
69+
{
70+
"selector": "typeLike",
71+
"format": ["PascalCase"],
72+
"leadingUnderscore": "allow"
73+
},
6674

67-
{
68-
"selector": "objectLiteralProperty",
69-
"format": null
70-
}
75+
{
76+
"selector": "objectLiteralProperty",
77+
"format": null
78+
}
7179
],
7280
"import/prefer-default-export": "off",
7381
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
@@ -103,7 +111,7 @@
103111
"custom": "ignore"
104112
}
105113
],
106-
"react/no-unknown-property": [2, { "ignore": ["tw", "css"] }],
114+
"react/no-unknown-property": ["error", { "ignore": ["tw", "css"] }],
107115
"react/require-default-props": "off",
108116
"@typescript-eslint/consistent-type-imports": "error",
109117
"no-void": "off",

frontend/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

frontend/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,12 @@
7979
"eslint-import-resolver-typescript": "3.5.2",
8080
"eslint-plugin-import": "2.27.5",
8181
"eslint-plugin-jsx-a11y": "6.7.1",
82-
"eslint-plugin-prettier": "4.2.1",
82+
"eslint-plugin-prettier": "5.0.0",
8383
"eslint-plugin-react": "7.32.2",
8484
"eslint-plugin-react-hooks": "4.6.0",
8585
"husky": "8.0.2",
86-
"prettier": "2.8.0",
86+
"prettier": "3.3.2",
87+
"prettier-plugin-tailwindcss": "0.6.4",
8788
"tailwindcss": "3.3.2",
8889
"tailwindcss-gradient": "1.0.1",
8990
"twin.macro": "3.3.1",

frontend/prettier.config.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* @type {import("prettier").Config}
3+
*/
14
module.exports = {
2-
plugins: [],
5+
trailingComma: "es5",
6+
tabWidth: 2,
7+
semi: true,
8+
singleQuote: false,
9+
printWidth: 80,
10+
useTabs: false,
11+
quoteProps: "as-needed",
12+
jsxSingleQuote: false,
13+
bracketSpacing: true,
14+
bracketSameLine: false,
15+
arrowParens: "always",
16+
17+
plugins: ["prettier-plugin-tailwindcss"],
18+
tailwindAttributes: ["className", "class", "tw"],
19+
tailwindFunctions: ["tw"],
320
};

frontend/public/site.webmanifest

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
1+
{
2+
"name": "",
3+
"short_name": "",
4+
"icons": [
5+
{
6+
"src": "/android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "/android-chrome-512x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#ffffff",
17+
"background_color": "#ffffff",
18+
"display": "standalone"
19+
}

frontend/src/api/api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ export class FetchError extends Error {
55

66
public statusText: string;
77

8-
constructor(public resp: Response, public data?: unknown) {
8+
constructor(
9+
public resp: Response,
10+
public data?: unknown
11+
) {
912
super(resp.statusText);
1013

1114
this.name = "FetchError";
12.1 KB
Loading
Lines changed: 1 addition & 0 deletions
Loading

frontend/src/components/Button.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
import tw, { styled } from "twin.macro";
22

33
const Button = styled.button({
4-
...tw`
5-
px-3 py-1.5 flex items-center gap-1 rounded shadow transition outline-none
6-
disabled:(opacity-50 cursor-not-allowed) focus:ring
7-
`,
4+
...tw`flex items-center gap-1 rounded px-3 py-1.5 shadow outline-none transition focus:ring disabled:cursor-not-allowed disabled:opacity-50`,
85

96
variants: {
107
color: {
118
primary: tw`bg-brand-500 text-white ring-brand-500/40 hover:bg-brand-600 active:bg-brand-700`,
129
danger: tw`bg-red-600 text-white ring-red-600/40 hover:bg-red-700 active:bg-red-800`,
13-
white: tw`
14-
bg-white border border-brand-300 text-gray-900 ring-brand-300/40
15-
hover:(bg-brand-50 text-brand-950 border-brand-400)
16-
active:bg-brand-75
17-
`,
10+
white: tw`border border-brand-300 bg-white text-gray-900 ring-brand-300/40 hover:border-brand-400 hover:bg-brand-50 hover:text-brand-950 active:bg-brand-75`,
1811
},
1912
},
2013

frontend/src/components/CampaignCard/CampaignStatus.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import tw, { styled } from "twin.macro";
22

33
const CampaignStatus = styled.button({
4-
...tw`ml-auto flex items-center gap-1 px-2 py-1.5 text-white rounded-[0.2rem] shadow transition hover:shadow-md`,
4+
...tw`ml-auto flex items-center gap-1 rounded-[0.2rem] px-2 py-1.5 text-white shadow transition hover:shadow-md`,
55

66
variants: {
77
status: {
8-
pending: tw`text-black bg-[hsl(220, 60%, 90%)] shadow-[hsl(220, 60%, 90%)]!`,
8+
pending: tw`bg-[hsl(220, 60%, 90%)] shadow-[hsl(220, 60%, 90%)]! text-black`,
99
open: tw`bg-[hsl(220, 93%, 60%)] shadow-[hsla(220, 93%, 60%, 50%)]!`,
1010
closed: tw`bg-gray-100 text-black`,
11-
offered: tw`bg-green-200 text-green-900 shadow-green-200! hover:bg-green-300`,
12-
rejected: tw`bg-red-200 text-red-900 shadow-red-200!`,
11+
offered: tw`shadow-green-200! bg-green-200 text-green-900 hover:bg-green-300`,
12+
rejected: tw`shadow-red-200! bg-red-200 text-red-900`,
1313
},
1414
},
1515

0 commit comments

Comments
 (0)