-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 13.9 KB
/
.eslintcache
1
[{"C:\\Projects\\CodeForNebraska\\homaha\\src\\index.js":"1","C:\\Projects\\CodeForNebraska\\homaha\\src\\apolloClient.js":"2","C:\\Projects\\CodeForNebraska\\homaha\\src\\reportWebVitals.js":"3","C:\\Projects\\CodeForNebraska\\homaha\\src\\App.js":"4","C:\\Projects\\CodeForNebraska\\homaha\\src\\components\\Shelter.js":"5"},{"size":938,"mtime":1612232854472,"results":"6","hashOfConfig":"7"},{"size":346,"mtime":1617752141298,"results":"8","hashOfConfig":"7"},{"size":375,"mtime":1610593390088,"results":"9","hashOfConfig":"7"},{"size":11028,"mtime":1617757335766,"results":"10","hashOfConfig":"7"},{"size":3786,"mtime":1619573629689,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},"zewvy9",{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},{"filePath":"19","messages":"20","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"21","usedDeprecatedRules":"14"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Projects\\CodeForNebraska\\homaha\\src\\index.js",[],["24","25"],"C:\\Projects\\CodeForNebraska\\homaha\\src\\apolloClient.js",[],"C:\\Projects\\CodeForNebraska\\homaha\\src\\reportWebVitals.js",[],"C:\\Projects\\CodeForNebraska\\homaha\\src\\App.js",["26"],"import React, {useState, useRef, useEffect} from 'react';\r\nimport {any, values} from 'ramda';\r\nimport {\r\n Typography,\r\n makeStyles,\r\n Popper,\r\n AppBar,\r\n Toolbar,\r\n IconButton,\r\n Grow,\r\n Paper,\r\n ClickAwayListener,\r\n MenuList,\r\n MenuItem,\r\n FormControlLabel,\r\n Checkbox,\r\n Button\r\n} from \"@material-ui/core\";\r\nimport {gql, useQuery} from \"@apollo/client\";\r\nimport {Info, Menu} from '@material-ui/icons';\r\nimport * as geolib from 'geolib';\r\n\r\nimport Shelter from \"./components/Shelter\";\r\n\r\n\r\nconst useStyles = makeStyles(() => ({\r\n root: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flexDirection: 'column',\r\n alignItems: 'center'\r\n },\r\n appHeader: {\r\n marginBottom: 65\r\n },\r\n cardGroup: {\r\n display: 'flex',\r\n //flexDirection: 'column',\r\n justifyContent: 'center',\r\n flexWrap: 'wrap'\r\n },\r\n warningText: {\r\n fontSize: \"calc(10px + 1vmin)\",\r\n width: '80%',\r\n textAlign: 'center',\r\n margin: '0 auto',\r\n marginBottom: 10\r\n },\r\n appBar: {\r\n flexGrow: 1,\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n },\r\n centerFilterButton: {\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n margin: '15px 0'\r\n },\r\n footer: {\r\n backgroundColor: 'black',\r\n height: '100px',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center'\r\n },\r\n codeForNebraskaLink: {\r\n textDecoration: \"none\",\r\n color: 'white',\r\n \"&:hover\": {\r\n color: 'aqua'\r\n }\r\n }\r\n}))\r\n\r\nconst GET_SHELTERS = gql`\r\n {\r\n shelter {\r\n id\r\n name\r\n createdAt\r\n phone\r\n location\r\n availableCapacity\r\n totalCapacity\r\n allowsIntoxication\r\n allowsNarcotics\r\n allowsSingleMale\r\n allowsFamilyMale\r\n allowsFamilyFemale\r\n allowsSingleFemale\r\n allowsChildren\r\n latitude\r\n longitude\r\n }\r\n }\r\n`;\r\n\r\nfunction App() {\r\n const classes = useStyles();\r\n const {data} = useQuery(GET_SHELTERS);\r\n const [open, setOpen] = useState(false);\r\n const [check, setCheck] = useState({\r\n isIntoxicated: false,\r\n isNarcotics: false,\r\n isSingleMale: false,\r\n isSingleFemale: false,\r\n isFamilyMale: false,\r\n isFamilyFemale: false,\r\n isChildren: false\r\n })\r\n const [userLocation, setUserLocation] = useState({});\r\n const anchorRef = useRef(null);\r\n const shelters = (data && data.shelter) || [];\r\n const filteredShelters = shelters?.filter(shelter => {\r\n if (!any(value => value === true)(values(check))) {\r\n return true;\r\n }\r\n return (shelter.allowsIntoxication || shelter.allowsIntoxication === check.isIntoxicated) &&\r\n (shelter.allowsNarcotics || shelter.allowsNarcotics === check.isNarcotics) &&\r\n (shelter.allowsSingleMale || shelter.allowsSingleMale === check.isSingleMale) &&\r\n (shelter.allowsSingleFemale || shelter.allowsSingleFemale === check.isSingleFemale) &&\r\n (shelter.allowsFamilyMale || shelter.allowsFamilyMale === check.isFamilyMale) &&\r\n (shelter.allowsFamilyFemale || shelter.allowsFamilyFemale === check.isFamilyFemale) &&\r\n (shelter.allowsChildren || shelter.allowsChildren === check.isChildren)\r\n })\r\n\r\n const handleToggle = () => {\r\n setOpen((prevOpen) => !prevOpen);\r\n };\r\n\r\n const handleClose = (event) => {\r\n if (anchorRef.current && anchorRef.current.contains(event.target)) {\r\n return;\r\n }\r\n\r\n setOpen(false);\r\n };\r\n\r\n function handleListKeyDown(event) {\r\n if (event.key === 'Tab') {\r\n event.preventDefault();\r\n setOpen(false);\r\n }\r\n }\r\n\r\n const prevOpen = useRef(open);\r\n useEffect(() => {\r\n if (prevOpen.current === true && open === false) {\r\n anchorRef.current.focus();\r\n }\r\n\r\n prevOpen.current = open;\r\n }, [open]);\r\n\r\n const handleChange = (name) => (event) => {\r\n setCheck({...check, [name]: event.target.checked});\r\n };\r\n const DomesticViolenceMessage = (props) => {\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const handleClick = (event) => {\r\n setAnchorEl(anchorEl ? null : event.currentTarget)\r\n }\r\n const handleClickAway = () => {\r\n setAnchorEl(null)\r\n }\r\n return (\r\n <ClickAwayListener onClickAway={handleClickAway}>\r\n <div className={classes.warningText}>\r\n <Typography variant={'h6'} color={'secondary'} onClick={handleClick}>\r\n Domestic Violence <Info />\r\n </Typography>\r\n <Popper open={!!anchorEl} anchorEl={anchorEl} style={{padding: '0px 20px'}}>\r\n <Paper>\r\n <div style={{padding: '10px 10px'}}>Individuals involved in Domestic Violence Situations may have further\r\n resources available that are not\r\n listed below. Please contact your emergency services number for assistance\r\n </div>\r\n </Paper>\r\n </Popper>\r\n </div>\r\n </ClickAwayListener>\r\n )\r\n }\r\n\r\n const DraftOnly = () => {\r\n return (\r\n <div style={{textAlign: 'center'}}>DRAFT ONLY - Not Ready for Public Use</div>\r\n )\r\n }\r\n\r\n useEffect(() => {\r\n navigator.geolocation.getCurrentPosition((position) =>{\r\n setUserLocation({latitude: position.coords.latitude, longitude: position.coords.longitude});\r\n })\r\n },[])\r\n\r\n let measureDistance = ((userLocation, shelterLocation) => {\r\n return geolib.getDistance(userLocation, shelterLocation, 1);\r\n })\r\n\r\n return (\r\n <div>\r\n <header className={classes.appHeader}>\r\n <AppBar className={classes.appBar} color=\"default\">\r\n <IconButton onClick={handleToggle}>\r\n <Menu\r\n ref={anchorRef}\r\n aria-controls={open ? 'menu-list-grow' : undefined}\r\n aria-haspopup=\"true\"\r\n />\r\n </IconButton>\r\n <Toolbar>\r\n <Typography variant={'h5'}>Metro Shelter Project</Typography>\r\n </Toolbar>\r\n </AppBar>\r\n </header>\r\n <DraftOnly/>\r\n <DomesticViolenceMessage/>\r\n <div className={classes.centerFilterButton}>\r\n <Button\r\n variant={'outlined'}\r\n onClick={handleToggle}\r\n >\r\n Filter\r\n </Button>\r\n </div>\r\n\r\n <div className={classes.cardGroup}>\r\n {filteredShelters && filteredShelters.map(shelter => {\r\n return (<Shelter\r\n shelter={shelter}\r\n key={shelter.id}\r\n distance={Math.round(measureDistance(userLocation, {latitude:shelter.latitude, longitude: shelter.longitude}) * 0.0062137) / 10}\r\n />)\r\n })}\r\n </div>\r\n\r\n <Popper open={open} anchorEl={anchorRef.current} role={undefined} transition disablePortal>\r\n {({TransitionProps, placement}) => (\r\n <Grow\r\n {...TransitionProps}\r\n style={{transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'}}\r\n >\r\n <Paper style={{paddingTop: 20}}>\r\n <ClickAwayListener onClickAway={handleClose}>\r\n <MenuList autoFocusItem={open} id=\"menu-list-grow\" onKeyDown={handleListKeyDown}>\r\n <MenuItem key={\"menu1\"}>\r\n <FormControlLabel\r\n control={\r\n <Checkbox\r\n checked={check.isIntoxicated}\r\n onChange={handleChange('isIntoxicated')}\r\n name=\"Menu1\"\r\n color=\"primary\"\r\n />\r\n }\r\n label=\"Intoxicated\"\r\n />\r\n </MenuItem>\r\n <MenuItem key={\"menu2\"}>\r\n <FormControlLabel\r\n control={\r\n <Checkbox\r\n checked={check.isNarcotics}\r\n onChange={handleChange('isNarcotics')}\r\n name=\"Menu2\"\r\n color=\"primary\"\r\n />\r\n }\r\n label=\"Narcotics\"\r\n />\r\n </MenuItem>\r\n <hr/>\r\n <MenuItem key={\"menu3\"}>\r\n <FormControlLabel\r\n control={\r\n <Checkbox\r\n checked={check.isSingleMale}\r\n onChange={handleChange('isSingleMale')}\r\n name=\"Menu3\"\r\n color=\"primary\"\r\n />\r\n }\r\n label=\"Single Male\"\r\n />\r\n </MenuItem>\r\n <MenuItem key={\"menu4\"}>\r\n <FormControlLabel\r\n control={\r\n <Checkbox\r\n checked={check.isFamilyMale}\r\n onChange={handleChange('isFamilyMale')}\r\n name=\"Menu4\"\r\n color=\"primary\"\r\n />\r\n }\r\n label=\"Family Male\"\r\n />\r\n </MenuItem>\r\n <MenuItem key={\"menu5\"}>\r\n <FormControlLabel\r\n control={\r\n <Checkbox\r\n checked={check.isSingleFemale}\r\n onChange={handleChange('isSingleFemale')}\r\n color=\"primary\"\r\n />\r\n }\r\n label=\"Single Female\"\r\n />\r\n </MenuItem>\r\n <MenuItem key={\"menu7\"}>\r\n <FormControlLabel\r\n control={\r\n <Checkbox\r\n checked={check.isFamilyFemale}\r\n onChange={handleChange('isFamilyFemale')}\r\n color=\"primary\"\r\n />\r\n }\r\n label=\"Family Female\"\r\n />\r\n </MenuItem>\r\n <MenuItem key={\"menu6\"}>\r\n <FormControlLabel\r\n control={\r\n <Checkbox\r\n checked={check.isChildren}\r\n onChange={handleChange('isChildren')}\r\n name=\"Menu6\"\r\n color=\"primary\"\r\n />\r\n }\r\n label=\"Allow Children\"\r\n />\r\n </MenuItem>\r\n </MenuList>\r\n </ClickAwayListener>\r\n </Paper>\r\n </Grow>\r\n )}\r\n </Popper>\r\n <footer className={classes.footer}>\r\n <a href={'https://www.codefornebraska.org'} target={'_blank'} className={classes.codeForNebraskaLink} >CodeForNebraska.org</a>\r\n </footer>\r\n </div>\r\n );\r\n}\r\n\r\nexport default App;\r\n","C:\\Projects\\CodeForNebraska\\homaha\\src\\components\\Shelter.js",["27"],{"ruleId":"28","replacedBy":"29"},{"ruleId":"30","replacedBy":"31"},{"ruleId":"32","severity":1,"message":"33","line":345,"column":9,"nodeType":"34","endLine":345,"endColumn":112},{"ruleId":"35","severity":1,"message":"36","line":126,"column":9,"nodeType":"34","endLine":126,"endColumn":55},"no-native-reassign",["37"],"no-negated-in-lhs",["38"],"react/jsx-no-target-blank","Using target=\"_blank\" without rel=\"noreferrer\" is a security risk: see https://html.spec.whatwg.org/multipage/links.html#link-type-noopener","JSXOpeningElement","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","no-global-assign","no-unsafe-negation"]