Delete //website/habitgarden
This is change #2 in a series of other larger changes...
This commit is contained in:
		
							parent
							
								
									381c344563
								
							
						
					
					
						commit
						90035da32e
					
				
					 15 changed files with 0 additions and 5904 deletions
				
			
		|  | @ -1,2 +0,0 @@ | |||
| source_up | ||||
| use_nix | ||||
							
								
								
									
										3
									
								
								website/habitgarden/.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								website/habitgarden/.gitignore
									
										
									
									
										vendored
									
									
								
							|  | @ -1,3 +0,0 @@ | |||
| /.cache | ||||
| /dist | ||||
| /node_modules | ||||
|  | @ -1,26 +0,0 @@ | |||
| # Habit Garden | ||||
| 
 | ||||
| I am digitizing my habits journal. | ||||
| 
 | ||||
| ## Stack | ||||
| 
 | ||||
| - React: Maps application state to UI | ||||
| - React-Router: Stateful routing for SPAs | ||||
| - Redux: Application state management | ||||
| - TypeScript: Type-safety | ||||
| - TailwindCSS: Styling library using utility classes | ||||
| - Prettier: Source code formatting | ||||
| - Jest: Test runner | ||||
| 
 | ||||
| ## Developing | ||||
| 
 | ||||
| ```shell | ||||
| $ nix-shell | ||||
| $ yarn run dev | ||||
| ``` | ||||
| 
 | ||||
| ## Building | ||||
| 
 | ||||
| ```shell | ||||
| $ nix-build | ||||
| ``` | ||||
|  | @ -1,19 +0,0 @@ | |||
| { pkgs, ... }: | ||||
| 
 | ||||
| pkgs.stdenv.mkDerivation { | ||||
|   name = "typescript"; | ||||
|   srcs = builtins.path { path = ./.; name = "habitgarden"; }; | ||||
|   buildInputs = with pkgs; [ | ||||
|     nodejs | ||||
|     # Exposes lscpu for parcel.js | ||||
|     utillinux | ||||
|   ]; | ||||
|   # parcel.js needs number of CPUs | ||||
|   PARCEL_WORKERS = "1"; | ||||
|   buildPhase = '' | ||||
|     npx parcel build src/index.html --public-url ./ | ||||
|   ''; | ||||
|   installPhase = '' | ||||
|     mv dist $out | ||||
|   ''; | ||||
| } | ||||
|  | @ -1,27 +0,0 @@ | |||
| { | ||||
|   "name": "tailwindcss", | ||||
|   "version": "1.0.0", | ||||
|   "main": "index.js", | ||||
|   "license": "MIT", | ||||
|   "scripts": { | ||||
|     "dev": "parcel src/index.html & npx tsc --watch --noEmit", | ||||
|     "prettier": "prettier --ignore-path .gitignore --write \"**/*.{js,ts,jsx,tsx,html,css.json}\"" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@types/node": "^13.9.3", | ||||
|     "parcel-bundler": "^1.12.4", | ||||
|     "prettier": "^2.0.2", | ||||
|     "tailwindcss": "^1.2.0", | ||||
|     "typescript": "^3.8.3" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@reduxjs/toolkit": "^1.2.5", | ||||
|     "@types/react-dom": "^16.9.5", | ||||
|     "@types/react-redux": "^7.1.7", | ||||
|     "@types/react-router-dom": "^5.1.3", | ||||
|     "react": "^16.13.1", | ||||
|     "react-dom": "^16.13.1", | ||||
|     "react-redux": "^7.2.0", | ||||
|     "react-router-dom": "^5.1.2" | ||||
|   } | ||||
| } | ||||
|  | @ -1,7 +0,0 @@ | |||
| const tailwindcss = require('tailwindcss') | ||||
| 
 | ||||
| module.exports = { | ||||
|   plugins: [ | ||||
|     tailwindcss('./tailwind.config.js') | ||||
|   ] | ||||
| } | ||||
|  | @ -1,9 +0,0 @@ | |||
| let | ||||
|   briefcase = import <briefcase> {}; | ||||
|   pkgs = briefcase.third_party.pkgs; | ||||
| in pkgs.mkShell { | ||||
|   buildInputs = with pkgs; [ | ||||
|     nodejs | ||||
|     yarn | ||||
|   ]; | ||||
| } | ||||
|  | @ -1,57 +0,0 @@ | |||
| import React, { useEffect } from "react"; | ||||
| import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; | ||||
| import { useDispatch } from "react-redux"; | ||||
| import { actions, useTypedSelector } from "./store"; | ||||
| import { Link } from "react-router-dom"; | ||||
| 
 | ||||
| const CircleRow = (props: { count: number }) => ( | ||||
|   <tr> | ||||
|     {Array.from(Array(props.count)).map((_, i) => ( | ||||
|       <td key={i} className="text-center px-3 py-2"> | ||||
|         <input type="radio" /> | ||||
|       </td> | ||||
|     ))} | ||||
|   </tr> | ||||
| ); | ||||
| 
 | ||||
| const CircleGrid = (props: { label: string; columns: string[] }) => ( | ||||
|   <div> | ||||
|     <h1 className="text-center text-2xl py-4">{props.label}</h1> | ||||
|     <table className="mx-auto"> | ||||
|       <thead> | ||||
|         <tr> | ||||
|           {props.columns.map((x) => ( | ||||
|             <th key={x}>{x}</th> | ||||
|           ))} | ||||
|         </tr> | ||||
|       </thead> | ||||
|       <tbody> | ||||
|         {Array.from(Array(props.columns.length)).map((_, i) => ( | ||||
|           <CircleRow key={i} count={props.columns.length} /> | ||||
|         ))} | ||||
|       </tbody> | ||||
|     </table> | ||||
|   </div> | ||||
| ); | ||||
| 
 | ||||
| const App: React.FC = () => { | ||||
|   const dispatch = useDispatch(); | ||||
|   const { isLoading } = useTypedSelector((state) => ({ | ||||
|     isLoading: state.isLoading, | ||||
|   })); | ||||
| 
 | ||||
|   return ( | ||||
|     <Router> | ||||
|       <Switch> | ||||
|         <Route exact path="/"> | ||||
|           <CircleGrid label="Meditation" columns={["M", "T", "W", "Th", "F"]} /> | ||||
|           <CircleGrid label="Reading" columns={["M", "T", "W", "Th", "F"]} /> | ||||
|           <CircleGrid label="Challenge" columns={["M", "T", "W", "Th", "F"]} /> | ||||
|           <CircleGrid label="Jiu Jitsu" columns={["S", "M", "T"]} /> | ||||
|         </Route> | ||||
|       </Switch> | ||||
|     </Router> | ||||
|   ); | ||||
| }; | ||||
| 
 | ||||
| export default App; | ||||
|  | @ -1,3 +0,0 @@ | |||
| @tailwind base; | ||||
| @tailwind components; | ||||
| @tailwind utilities; | ||||
|  | @ -1,11 +0,0 @@ | |||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
|   <head> | ||||
|     <meta charset="UTF-8" /> | ||||
|     <link rel="stylesheet" href="./index.css" /> | ||||
|   </head> | ||||
|   <body> | ||||
|     <div id="mount"></div> | ||||
|     <script src="./index.tsx"></script> | ||||
|   </body> | ||||
| </html> | ||||
|  | @ -1,12 +0,0 @@ | |||
| import React from "react"; | ||||
| import ReactDOM from "react-dom"; | ||||
| import App from "./App"; | ||||
| import { Provider } from "react-redux"; | ||||
| import store from "./store"; | ||||
| 
 | ||||
| ReactDOM.render( | ||||
|   <Provider store={store}> | ||||
|     <App /> | ||||
|   </Provider>, | ||||
|   document.getElementById("mount") | ||||
| ); | ||||
|  | @ -1,26 +0,0 @@ | |||
| import { createSlice, configureStore, PayloadAction } from "@reduxjs/toolkit"; | ||||
| import { useSelector, TypedUseSelectorHook } from "react-redux"; | ||||
| 
 | ||||
| export interface State { | ||||
|   isLoading: boolean; | ||||
| } | ||||
| 
 | ||||
| const initialState: State = { | ||||
|   isLoading: true, | ||||
| }; | ||||
| 
 | ||||
| export const { actions, reducer } = createSlice({ | ||||
|   name: "application", | ||||
|   initialState, | ||||
|   reducers: { | ||||
|     toggleIsLoading: state => ({ ...state, isLoading: !state.isLoading }), | ||||
|   } | ||||
| }); | ||||
| 
 | ||||
| /** | ||||
|  * Defining and consuming this allows us to avoid annotating State in all of our | ||||
|  * selectors. | ||||
|  */ | ||||
| export const useTypedSelector: TypedUseSelectorHook<State> = useSelector; | ||||
| 
 | ||||
| export default configureStore({ reducer }); | ||||
|  | @ -1,7 +0,0 @@ | |||
| module.exports = { | ||||
|   theme: { | ||||
|     extend: {}, | ||||
|   }, | ||||
|   variants: {}, | ||||
|   plugins: [], | ||||
| } | ||||
|  | @ -1,25 +0,0 @@ | |||
| { | ||||
|   "compilerOptions": { | ||||
|     "target": "es5", | ||||
|     "lib": [ | ||||
|       "dom", | ||||
|       "dom.iterable", | ||||
|       "esnext" | ||||
|     ], | ||||
|     "allowJs": true, | ||||
|     "skipLibCheck": true, | ||||
|     "esModuleInterop": true, | ||||
|     "allowSyntheticDefaultImports": true, | ||||
|     "strict": true, | ||||
|     "forceConsistentCasingInFileNames": true, | ||||
|     "module": "esnext", | ||||
|     "moduleResolution": "node", | ||||
|     "resolveJsonModule": true, | ||||
|     "isolatedModules": true, | ||||
|     "noEmit": true, | ||||
|     "jsx": "react" | ||||
|   }, | ||||
|   "include": [ | ||||
|     "src/**/*" | ||||
|   ] | ||||
| } | ||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue