Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add confess form #5

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a5226a8
Front end: Initial setup with Vite
AttyC Jul 27, 2023
6712139
Add Router components to frontend
AttyC Jul 29, 2023
eb4b618
Add NotFound for nonsense url path
AttyC Jul 29, 2023
4b0db77
Create Layout component with Header
AttyC Jul 30, 2023
bab92ea
Add Footer component to Layout
AttyC Jul 30, 2023
bebc9f6
Add Nav to Header
AttyC Jul 30, 2023
acc50b0
Add Layout to main
AttyC Jul 30, 2023
d9353dc
Rename Misdemeanours component to plural thoughout
AttyC Jul 30, 2023
0b09f60
Add Author to Footer
AttyC Jul 30, 2023
ee7f5ab
Add basic layout CSS to root and main
AttyC Jul 30, 2023
ac94e7d
Remove h1 from App.tsx
AttyC Jul 30, 2023
eb3aefa
Add semantic HTML tags to header and footer
AttyC Jul 30, 2023
baa7e31
Install Tailwind CSS for styling
AttyC Jul 30, 2023
02fe5e2
Implement sticky footer with CSS
AttyC Jul 30, 2023
a439d1e
Change title of app to reflect content
AttyC Jul 30, 2023
2b0cb48
Update Tailwind configuration
AttyC Jul 30, 2023
de116b4
Refactor Nav into separate components
AttyC Jul 30, 2023
ba0ea28
Style Header layout and Logo
AttyC Jul 30, 2023
0812943
feat: Implement fetch function to getMisdemeanours
AttyC Jul 30, 2023
f4a6097
Add padding to NavLink
AttyC Jul 30, 2023
874deb1
Add theme colours via CSS variables
AttyC Jul 30, 2023
afefa92
Broken! Can't get types to work and map.
AttyC Aug 1, 2023
528be87
Get Misdemeanours working with props and types
AttyC Aug 1, 2023
309f172
Pushed useContext exmaple (not working)
AttyC Aug 2, 2023
79e6437
Refactor App and routes to use context
AttyC Aug 10, 2023
57aeaf9
Add context with hardcoded number of misdemeanours
AttyC Aug 10, 2023
fdf1e2f
Attempt useParams but not working, amount is hardcoded, for now
AttyC Aug 10, 2023
da2287f
Add ul and table layout to misdemeanours
AttyC Aug 10, 2023
1b871ba
Enabled dynamic url param!
AttyC Aug 10, 2023
52535f5
Add loading state
AttyC Aug 10, 2023
0a20b57
Add Filter to display specific misdemeanours
AttyC Aug 10, 2023
9e55f05
Add Loading state, refactor RenderCrimes
AttyC Aug 11, 2023
ef4a353
Add get random image for each Misdemeanour
AttyC Aug 11, 2023
31592c4
Change Misdemeanours to table layout
AttyC Aug 11, 2023
929fdd4
Merge pull request #1 from AttyC/add-picsum-images
AttyC Aug 11, 2023
ded84b2
Add Confess form with field validation
AttyC Aug 13, 2023
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
18 changes: 18 additions & 0 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
27 changes: 27 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
13 changes: 13 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fakelandia Vite + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading