Python Discord Forms
diff --git a/public/logo-apple-touch.png b/public/logo-apple-touch.png
new file mode 100644
index 0000000..a833557
Binary files /dev/null and b/public/logo-apple-touch.png differ
--
cgit v1.2.3
From dc86560fd0a0c111bfde85189ab5a9421ceb1365 Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Tue, 26 Jan 2021 12:23:52 +0300
Subject: Cleans Up Some Warnings
Makes slight modifications to handle some minor warnings.
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
src/pages/LandingPage.tsx | 2 +-
src/setupTests.ts | 1 -
src/tests/components/FormListing.test.tsx | 16 ++++++++++++----
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/pages/LandingPage.tsx b/src/pages/LandingPage.tsx
index af968ad..06fef46 100644
--- a/src/pages/LandingPage.tsx
+++ b/src/pages/LandingPage.tsx
@@ -17,7 +17,7 @@ function LandingPage(): JSX.Element {
const fetchForms = async () => {
setForms(await getForms());
};
- fetchForms();
+ fetchForms().then();
}, []);
if (!forms) {
diff --git a/src/setupTests.ts b/src/setupTests.ts
index 5018a42..6a69409 100644
--- a/src/setupTests.ts
+++ b/src/setupTests.ts
@@ -1,2 +1 @@
-
import "@testing-library/jest-dom/extend-expect";
diff --git a/src/tests/components/FormListing.test.tsx b/src/tests/components/FormListing.test.tsx
index f071c33..f269dbf 100644
--- a/src/tests/components/FormListing.test.tsx
+++ b/src/tests/components/FormListing.test.tsx
@@ -56,13 +56,21 @@ test("renders form listing with specified description", () => {
test("renders form listing with background green colour for open", () => {
const { container } = render();
const elem = container.querySelector("a");
- const style = window.getComputedStyle(elem);
- expect(style.backgroundColor).toBe("rgb(67, 181, 129)");
+ expect(elem).not.toBeNull();
+
+ if (elem) {
+ const style = window.getComputedStyle(elem);
+ expect(style.backgroundColor).toBe("rgb(67, 181, 129)");
+ }
});
test("renders form listing with background dark colour for closed", () => {
const { container } = render();
const elem = container.querySelector("a");
- const style = window.getComputedStyle(elem);
- expect(style.backgroundColor).toBe("rgb(44, 47, 51)");
+ expect(elem).not.toBeNull();
+
+ if (elem) {
+ const style = window.getComputedStyle(elem);
+ expect(style.backgroundColor).toBe("rgb(44, 47, 51)");
+ }
});
--
cgit v1.2.3
From b0b6eebce016610848292b9ec4c2ccbd009bc8d9 Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Tue, 26 Jan 2021 12:27:15 +0300
Subject: Modifies Linting Rules
Adds a few rules to linting which are already followed, and help
maintain a cleaner style.
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
.eslintrc.json | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index 7785702..82497c2 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -39,7 +39,9 @@
"semi": [
"error",
"always"
- ]
+ ],
+ "no-trailing-spaces": "error",
+ "eol-last": "error"
},
"settings": {
"react": {
--
cgit v1.2.3
From 0945acd256b8d155225306b34dd774e418384577 Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Tue, 26 Jan 2021 12:29:22 +0300
Subject: Removes Tests From Precommit
Testing usually adds quite a few seconds to the commit time, and might
not be too helpful. Testing can be invoked manually, and is run in
actions.
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 852134f..3f23637 100644
--- a/package.json
+++ b/package.json
@@ -79,7 +79,7 @@
},
"husky": {
"hooks": {
- "pre-commit": "yarn lint --quiet && yarn test -o --silent"
+ "pre-commit": "yarn lint --quiet"
}
}
}
--
cgit v1.2.3
From a9877d88c06525316caaae1ba8b0d705d1966789 Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Tue, 26 Jan 2021 12:53:59 +0300
Subject: Updates Readme & Contributing Guide
Updates readme to include more details about the project, and to add
missing scripts. Creates contributing guide.
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
CONTRIBUTING.md | 4 ++++
README.md | 53 ++++++++++++++++++++++++++++++++---------------------
2 files changed, 36 insertions(+), 21 deletions(-)
create mode 100644 CONTRIBUTING.md
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..0e15eea
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,4 @@
+# Contributing to one of Our Projects
+
+The project is not currently accepting public contributions.
+Please contact `joe#6000` on Discord if you are interested in helping.
diff --git a/README.md b/README.md
index 64e343e..b19152f 100644
--- a/README.md
+++ b/README.md
@@ -1,43 +1,54 @@
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+# Python Discord Forms Frontend
+The frontend component of the [Python Discord Forms](https://github.com/python-discord/forms-backend/) project.
+Backend available at: [python-discord/forms-backend](https://github.com/python-discord/forms-backend/).
+
+Our frontend is written in React.js and TypeScript.
+It's a fairly simple application to get your head around,
+with the whole thing broken down into smallish TypeScript components.
+
+## Setup & Troubleshooting
+The project uses [yarn](https://yarnpkg.com/) for dependency and script management,
+and [webpack](https://webpack.js.org/) for building and development.
-## Available Scripts
+A full setup guide is available on [Notion](https://www.notion.so/pythondiscord/Forms-6312360495ff45f487da5b1924184a2d),
+along with a troubleshooting guide.
+## React & Dependency Info
+### Project Info
+This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+
+### Available Scripts
In the project directory, you can run:
-### `yarn start`
+`yarn start`
-Runs the app in the development mode.
+Runs the app in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
-The page will reload if you make edits.
+The page will reload if you make edits.
You will also see any lint errors in the console.
-### `yarn test`
+`yarn test`
-Launches the test runner in the interactive watch mode.
+Launches the test runner in the interactive watch mode.
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
-### `yarn build`
+`yarn lint`
+
+Runs eslint on the src directory of the project.
+Code style can be found under [.eslintrc.json](.eslintrc.json).
-Builds the app for production to the `build` folder.
+`yarn build`
+
+Builds the app for production to the `build` folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
-The build is minified and the filenames include the hashes.
+The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
-### `yarn eject`
-
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
-
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
-
-Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
-
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
-
-## Learn More
+### Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
--
cgit v1.2.3
From e46d86265c8181fdbaa3b003ded131b7dd9364f7 Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Tue, 26 Jan 2021 12:54:29 +0300
Subject: Updates License year
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
LICENSE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE b/LICENSE
index e410a19..5069d42 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020 Python Discord
+Copyright (c) 2020-2021 Python Discord
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
--
cgit v1.2.3
From 49acd71f62923fb5b6cb66a8ab825ab7c8141aeb Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Tue, 26 Jan 2021 23:46:48 +0300
Subject: Cleans Up Favicons
Reorganizes and adds a few icons and favicons for compatibility with
all browsers and devices.
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
public/apple-touch-icon-precomposed.png | Bin 0 -> 2217 bytes
public/apple-touch-icon.png | Bin 0 -> 2344 bytes
public/branding/browserconfig.xml | 9 +++++++++
public/branding/logo192.png | Bin 0 -> 2434 bytes
public/branding/logo256.png | Bin 0 -> 8770 bytes
public/branding/logo512.png | Bin 0 -> 18382 bytes
public/branding/mstile-144x144.png | Bin 0 -> 1503 bytes
public/branding/mstile-150x150.png | Bin 0 -> 1346 bytes
public/branding/mstile-310x150.png | Bin 0 -> 1370 bytes
public/branding/mstile-310x310.png | Bin 0 -> 2341 bytes
public/branding/mstile-70x70.png | Bin 0 -> 1099 bytes
public/branding/safari-pinned-tab.svg | 1 +
public/index.html | 8 ++++++--
public/logo-apple-touch.png | Bin 4751 -> 0 bytes
public/logo256.png | Bin 8770 -> 0 bytes
public/logo512.png | Bin 18382 -> 0 bytes
public/manifest.json | 10 +++++-----
17 files changed, 21 insertions(+), 7 deletions(-)
create mode 100644 public/apple-touch-icon-precomposed.png
create mode 100644 public/apple-touch-icon.png
create mode 100644 public/branding/browserconfig.xml
create mode 100644 public/branding/logo192.png
create mode 100644 public/branding/logo256.png
create mode 100644 public/branding/logo512.png
create mode 100644 public/branding/mstile-144x144.png
create mode 100644 public/branding/mstile-150x150.png
create mode 100644 public/branding/mstile-310x150.png
create mode 100644 public/branding/mstile-310x310.png
create mode 100644 public/branding/mstile-70x70.png
create mode 100644 public/branding/safari-pinned-tab.svg
delete mode 100644 public/logo-apple-touch.png
delete mode 100644 public/logo256.png
delete mode 100644 public/logo512.png
diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png
new file mode 100644
index 0000000..62c8d09
Binary files /dev/null and b/public/apple-touch-icon-precomposed.png differ
diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png
new file mode 100644
index 0000000..e9a26ef
Binary files /dev/null and b/public/apple-touch-icon.png differ
diff --git a/public/branding/browserconfig.xml b/public/branding/browserconfig.xml
new file mode 100644
index 0000000..0dd2cec
--- /dev/null
+++ b/public/branding/browserconfig.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+ #2d89ef
+
+
+
diff --git a/public/branding/logo192.png b/public/branding/logo192.png
new file mode 100644
index 0000000..eb6a99e
Binary files /dev/null and b/public/branding/logo192.png differ
diff --git a/public/branding/logo256.png b/public/branding/logo256.png
new file mode 100644
index 0000000..dcebb19
Binary files /dev/null and b/public/branding/logo256.png differ
diff --git a/public/branding/logo512.png b/public/branding/logo512.png
new file mode 100644
index 0000000..69bcf29
Binary files /dev/null and b/public/branding/logo512.png differ
diff --git a/public/branding/mstile-144x144.png b/public/branding/mstile-144x144.png
new file mode 100644
index 0000000..6917335
Binary files /dev/null and b/public/branding/mstile-144x144.png differ
diff --git a/public/branding/mstile-150x150.png b/public/branding/mstile-150x150.png
new file mode 100644
index 0000000..2a2a7e0
Binary files /dev/null and b/public/branding/mstile-150x150.png differ
diff --git a/public/branding/mstile-310x150.png b/public/branding/mstile-310x150.png
new file mode 100644
index 0000000..0a5c9c2
Binary files /dev/null and b/public/branding/mstile-310x150.png differ
diff --git a/public/branding/mstile-310x310.png b/public/branding/mstile-310x310.png
new file mode 100644
index 0000000..b4e3f38
Binary files /dev/null and b/public/branding/mstile-310x310.png differ
diff --git a/public/branding/mstile-70x70.png b/public/branding/mstile-70x70.png
new file mode 100644
index 0000000..4221b97
Binary files /dev/null and b/public/branding/mstile-70x70.png differ
diff --git a/public/branding/safari-pinned-tab.svg b/public/branding/safari-pinned-tab.svg
new file mode 100644
index 0000000..06505f5
--- /dev/null
+++ b/public/branding/safari-pinned-tab.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
index 7fa5dd5..4bf02d0 100644
--- a/public/index.html
+++ b/public/index.html
@@ -2,14 +2,18 @@
-
-
+
+
+
+
+
+
Python Discord Forms
diff --git a/public/logo-apple-touch.png b/public/logo-apple-touch.png
deleted file mode 100644
index a833557..0000000
Binary files a/public/logo-apple-touch.png and /dev/null differ
diff --git a/public/logo256.png b/public/logo256.png
deleted file mode 100644
index dcebb19..0000000
Binary files a/public/logo256.png and /dev/null differ
diff --git a/public/logo512.png b/public/logo512.png
deleted file mode 100644
index 69bcf29..0000000
Binary files a/public/logo512.png and /dev/null differ
diff --git a/public/manifest.json b/public/manifest.json
index f374168..5fa2fd1 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -3,17 +3,17 @@
"name": "Python Discord Forms",
"icons": [
{
- "src": "favicon.ico",
- "sizes": "48x48 32x32",
- "type": "image/x-icon"
+ "src": "branding/logo192.png",
+ "type": "image/png",
+ "sizes": "192x192"
},
{
- "src": "logo256.png",
+ "src": "branding/logo256.png",
"type": "image/png",
"sizes": "256x256"
},
{
- "src": "logo512.png",
+ "src": "branding/logo512.png",
"type": "image/png",
"sizes": "512x512"
}
--
cgit v1.2.3
From 1ba688bd9cda9a3e17f41ddaffaed7b0922cc6d5 Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Tue, 26 Jan 2021 23:50:55 +0300
Subject: Updates Short Name
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
public/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/manifest.json b/public/manifest.json
index 5fa2fd1..a36c2b7 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -1,5 +1,5 @@
{
- "short_name": "Python Discord Forms",
+ "short_name": "PyDis Forms",
"name": "Python Discord Forms",
"icons": [
{
--
cgit v1.2.3
From 3b75a22d603568991f323be8c5e5cb202d130158 Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Wed, 3 Feb 2021 01:19:41 +0300
Subject: Revert "Updates License year"
This reverts commit e46d8626
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
LICENSE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE b/LICENSE
index 5069d42..e410a19 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020-2021 Python Discord
+Copyright (c) 2020 Python Discord
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
--
cgit v1.2.3