-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from Congress-Dev/bill-page-and-tags
Code Formatting and Relative Imports
- Loading branch information
Showing
71 changed files
with
3,096 additions
and
2,692 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,5 @@ | ||
node_modules | ||
build | ||
dist | ||
public | ||
.docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,8 @@ | ||
{ | ||
"semi": true, | ||
"singleQuote": false, | ||
"trailingComma": "all", | ||
"bracketSpacing": true, | ||
"jsxBracketSameLine": false, | ||
"tabWidth": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 1,21 @@ | ||
# Congress.Dev Frontend | ||
|
||
This is a standard react app. It is intended to be served via docker, so you should follow the instructions to run the entire app from the top level readme. | ||
|
||
## Running | ||
|
||
```bash | ||
yarn start | ||
``` | ||
``` | ||
|
||
## Windows Development w/ VSCode | ||
|
||
- Install Node.js for Windows (reboot after installing) | ||
- Run Powershell as Administrator | ||
- Execute `Set-ExecutionPolicy Unrestricted` | ||
- Run `yarn install` | ||
- Install Prettier extension for VSCode | ||
- Under Preferences > Settings set `Default Formatter` to Prettier | ||
- To format code: | ||
- Open command pallete in VSCode with `Ctrl Shift P` and run `Format Document` | ||
- OR: Run `yarn format` to format code for all files before creating pull request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 1,39 @@ | ||
const webpack = require("webpack"); | ||
const path = require("path"); | ||
|
||
module.exports = function override(config, env) { | ||
const fallback = config.resolve.fallback || {}; | ||
Object.assign(fallback, { | ||
crypto: require.resolve("crypto-browserify"), // require.resolve("crypto-browserify") can be polyfilled here if needed | ||
stream: require.resolve("stream-browserify"), // require.resolve("stream-browserify") can be polyfilled here if needed | ||
assert: false, // require.resolve("assert") can be polyfilled here if needed | ||
http: false, // require.resolve("stream-http") can be polyfilled here if needed | ||
https: false, // require.resolve("https-browserify") can be polyfilled here if needed | ||
os: false, // require.resolve("os-browserify") can be polyfilled here if needed | ||
url: false, // require.resolve("url") can be polyfilled here if needed | ||
zlib: false, // require.resolve("browserify-zlib") can be polyfilled here if needed | ||
}); | ||
config.resolve.fallback = fallback; | ||
config.plugins = (config.plugins || []).concat([ | ||
new webpack.ProvidePlugin({ | ||
process: "process/browser", | ||
Buffer: ["buffer", "Buffer"], | ||
}), | ||
]); | ||
config.ignoreWarnings = [/Failed to parse source map/]; | ||
config.module.rules.push({ | ||
test: /\.(js|mjs|jsx)$/, | ||
enforce: "pre", | ||
loader: require.resolve("source-map-loader"), | ||
resolve: { | ||
fullySpecified: false, | ||
}, | ||
}); | ||
return config; | ||
const fallback = config.resolve.fallback || {}; | ||
Object.assign(fallback, { | ||
crypto: require.resolve("crypto-browserify"), // require.resolve("crypto-browserify") can be polyfilled here if needed | ||
stream: require.resolve("stream-browserify"), // require.resolve("stream-browserify") can be polyfilled here if needed | ||
assert: false, // require.resolve("assert") can be polyfilled here if needed | ||
http: false, // require.resolve("stream-http") can be polyfilled here if needed | ||
https: false, // require.resolve("https-browserify") can be polyfilled here if needed | ||
os: false, // require.resolve("os-browserify") can be polyfilled here if needed | ||
url: false, // require.resolve("url") can be polyfilled here if needed | ||
zlib: false, // require.resolve("browserify-zlib") can be polyfilled here if needed | ||
}); | ||
config.resolve.alias = { | ||
common: path.resolve(__dirname, "src/common"), | ||
components: path.resolve(__dirname, "src/components"), | ||
pages: path.resolve(__dirname, "src/pages"), | ||
styles: path.resolve(__dirname, "src/styles"), | ||
}; | ||
config.resolve.fallback = fallback; | ||
config.plugins = (config.plugins || []).concat([ | ||
new webpack.ProvidePlugin({ | ||
process: "process/browser", | ||
Buffer: ["buffer", "Buffer"], | ||
}), | ||
]); | ||
config.ignoreWarnings = [/Failed to parse source map/]; | ||
config.module.rules.push({ | ||
test: /\.(js|mjs|jsx)$/, | ||
enforce: "pre", | ||
loader: require.resolve("source-map-loader"), | ||
resolve: { | ||
fullySpecified: false, | ||
}, | ||
}); | ||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 1,52 @@ | ||
{ | ||
"name": "frontend", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@blueprintjs/core": "^3.23.1", | ||
"@testing-library/jest-dom": "^5.17.0", | ||
"@testing-library/react": "^13.4.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"buffer": "^6.0.3", | ||
"crypto": "^1.0.1", | ||
"crypto-browserify": "^3.12.0", | ||
"diff": "^4.0.2", | ||
"env-cmd": "^10.1.0", | ||
"process": "^0.11.10", | ||
"query-string": "^6.11.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-router-dom": "^5.1.2", | ||
"react-scripts": "5.0.1", | ||
"react-spinners": "^0.8.0", | ||
"sass": "^1.69.5", | ||
"stream-browserify": "^3.0.0", | ||
"web-vitals": "^2.1.4", | ||
"xmldoc": "^1.1.2" | ||
}, | ||
"scripts": { | ||
"start": "WATCHPACK_POLLING=true react-app-rewired start", | ||
"build": "react-app-rewired build", | ||
"test": "react-app-rewired test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"react-app-rewired": "^2.2.1" | ||
} | ||
} | ||
"name": "frontend", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@blueprintjs/core": "^5.0.0", | ||
"@testing-library/jest-dom": "^5.17.0", | ||
"@testing-library/react": "^13.4.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"buffer": "^6.0.3", | ||
"crypto": "^1.0.1", | ||
"crypto-browserify": "^3.12.0", | ||
"diff": "^4.0.2", | ||
"env-cmd": "^10.1.0", | ||
"process": "^0.11.10", | ||
"query-string": "^6.11.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-router-dom": "^5.1.2", | ||
"react-scripts": "5.0.1", | ||
"sass": "^1.69.5", | ||
"stream-browserify": "^3.0.0", | ||
"web-vitals": "^2.1.4", | ||
"xmldoc": "^1.1.2" | ||
}, | ||
"scripts": { | ||
"start": "WATCHPACK_POLLING=true react-app-rewired start", | ||
"build": "react-app-rewired build", | ||
"test": "react-app-rewired test", | ||
"eject": "react-scripts eject", | ||
"format": "prettier --write ." | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"react-app-rewired": "^2.2.1", | ||
"prettier": "^3.4.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 1,56 @@ | ||
import React from "react"; | ||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; | ||
import { Route, BrowserRouter as Router, Switch } from "react-router-dom"; | ||
|
||
import NavBar from "./components/navbar"; | ||
// Pages | ||
import FrontPage from "./pages/frontpage"; | ||
import AboutUs from "./pages/aboutus"; | ||
import ContactUs from "./pages/contactus"; | ||
import BillViewer from "./pages/billviewer"; | ||
import USCodeRevisionList from "./pages/uscodemain"; | ||
import USCodeViewer from "./pages/uscodeviewer"; | ||
import BillSearch from "./pages/billsearch"; | ||
import MemberViewer from "./pages/members"; | ||
import { AppBar } from "components"; | ||
import { | ||
AboutUs, | ||
BillSearch, | ||
BillViewer, | ||
Home, | ||
MemberViewer, | ||
USCodeRevisionList, | ||
USCodeViewer, | ||
} from "pages"; | ||
|
||
import "./styles/common.scss"; | ||
import "./App.css"; | ||
import "styles/common.scss"; | ||
|
||
function App() { | ||
return ( | ||
<Router> | ||
<NavBar /> | ||
<Switch> | ||
<Route | ||
exact | ||
path="/bill/:congress/:chamber/:billNumber/:billVersion?/diffs/:uscTitle/:uscSection" | ||
component={BillViewer} | ||
/> | ||
<Route | ||
exact | ||
path="/bill/:congress/:chamber/:billNumber/:billVersion?/diffs/:uscTitle/:uscSection#:hasher" | ||
component={BillViewer} | ||
/> | ||
<Route | ||
exact | ||
path="/bill/:congress/:chamber/:billNumber/:billVersion?" | ||
component={BillViewer} | ||
/> | ||
return ( | ||
<Router> | ||
<AppBar /> | ||
<Switch> | ||
<Route | ||
exact | ||
path="/bill/:congress/:chamber/:billNumber/:billVersion?/diffs/:uscTitle/:uscSection" | ||
component={BillViewer} | ||
/> | ||
<Route | ||
exact | ||
path="/bill/:congress/:chamber/:billNumber/:billVersion?/diffs/:uscTitle/:uscSection#:hasher" | ||
component={BillViewer} | ||
/> | ||
<Route | ||
exact | ||
path="/bill/:congress/:chamber/:billNumber/:billVersion?" | ||
component={BillViewer} | ||
/> | ||
|
||
<Route exact path="/bills" component={BillSearch} /> | ||
<Route exact path="/about" component={AboutUs} /> | ||
<Route exact path="/contact" component={ContactUs} /> | ||
<Route exact path="/uscode" component={USCodeRevisionList} /> | ||
<Route exact path="/member/:bioguideId" component={MemberViewer} /> | ||
<Route | ||
path="/uscode/:uscReleaseId/:uscTitle?/:uscSection?" | ||
component={USCodeViewer} | ||
/> | ||
<Route path={["/", "/home"]} component={FrontPage} /> | ||
</Switch> | ||
</Router> | ||
); | ||
<Route exact path="/bills" component={BillSearch} /> | ||
<Route exact path="/about" component={AboutUs} /> | ||
<Route exact path="/uscode" component={USCodeRevisionList} /> | ||
<Route | ||
exact | ||
path="/member/:bioguideId" | ||
component={MemberViewer} | ||
/> | ||
<Route | ||
path="/uscode/:uscReleaseId/:uscTitle?/:uscSection?" | ||
component={USCodeViewer} | ||
/> | ||
<Route path={["/", "/home"]} component={Home} /> | ||
</Switch> | ||
</Router> | ||
); | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.