Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9bded32
communities page added, button components made, SearchBar component s…
vernfongchao Oct 24, 2022
306e13c
sidemenu popup for add link started
vernfongchao Oct 25, 2022
8a9cd6f
sidemenu popup for report link started
vernfongchao Oct 25, 2022
16d5d6c
community buttons styled
vernfongchao Oct 25, 2022
1927e96
refractored sidemenu and buttons
vernfongchao Oct 25, 2022
7096c55
button components for Submit Link and Cancel added
vernfongchao Oct 25, 2022
e118616
refractored button component logic, started Table Row component
vernfongchao Oct 25, 2022
cdba265
Table Row commponent done, and implemented to communities
vernfongchao Oct 25, 2022
1297d57
SearchBar component added and functionality working
vernfongchao Oct 25, 2022
4b189a8
Refractored ButtonWithIcons to just buttons with children and moved I…
vernfongchao Oct 26, 2022
b01de35
Sections ass to communities, Logic for sorting added to sections
vernfongchao Oct 26, 2022
5b93cec
removed LinkMenu to make component reusable as sidebar, logic of Link…
vernfongchao Oct 26, 2022
82a8fb1
ESLint formating for side menu
vernfongchao Oct 26, 2022
34f2331
linted components associated with communities and community pages
vernfongchao Oct 26, 2022
7dcea97
Linted Table and organized imports on communities
vernfongchao Oct 26, 2022
56383d1
removed unused code in communities
vernfongchao Oct 27, 2022
7d94e4d
changed margin bottoms from outter div container to each field contai…
vernfongchao Oct 27, 2022
f1cba88
added spacing from community and community Search per Figma design
vernfongchao Oct 28, 2022
99a238b
changed Font to Montserrat on all of community page
vernfongchao Oct 28, 2022
e173208
changed button border to outline per Figma design
vernfongchao Oct 28, 2022
00706d6
remmoved SideMenu component, no longer needed, Report/Addlink Page to…
vernfongchao Oct 28, 2022
57c0b0a
added menu on hover over export button
vernfongchao Oct 28, 2022
6897522
added functionality when clicking outside closes the menu
vernfongchao Oct 28, 2022
53d8a21
added searchbar focus when clicking on search icon
vernfongchao Oct 28, 2022
75856a2
fixed issue with inputs value carrying over when when props has updated
vernfongchao Oct 28, 2022
93f5fee
added tab rules for accessibility on side menu to come after report b…
vernfongchao Oct 28, 2022
969103d
report broken link form search bar open menu when clicked, when click…
vernfongchao Oct 28, 2022
c431ef4
added close menu when clicked outside, added openmenu when searching …
vernfongchao Oct 28, 2022
d17f177
added underline to link when not hovered
vernfongchao Oct 28, 2022
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
2 changes: 2 additions & 0 deletions client/src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Privacy from '@/pages/Privacy/Privacy';
import License from '@/pages/License/License';
import UserProfile from '@/pages/Userprofile/UserProfile';
import Contact from '@/pages/Contact/Contact';
import Community from '@/pages/Community/Community';
import NotFound from '@/pages/NotFound/NotFound';
import './App.css';

Expand Down Expand Up @@ -64,6 +65,7 @@ function App() {
<Route path="/privacy" element={<Privacy />} />
<Route path="/license" element={<License />} />
<Route path="/contact" element={<Contact />} />
<Route path="/community" element={<Community />} />
<Route path="/data" element={<Data />} />
<Route path="/go" element={<RedirectWithHash param="to" />} />
<Route path="*" element={<NotFound />} />
Expand Down
53 changes: 53 additions & 0 deletions client/src/components/Button/Button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import { Button } from '@mui/material';

import { styled } from '@mui/material/styles';

export const GreenButton = (props) => {
const Green = styled(Button)({
backgroundColor: '#147d16',
borderRadius: '.3vw',
color: 'white',
height: '32px',
});

return (
<Green type={props.type} sx={props?.sx} onClick={props.onClick}>
{props.children}
</Green>
);
};

export const WhiteButton = (props) => {
const White = styled(Button)({
backgroundColor: 'white',
outline: '1px #147d16 solid',
borderRadius: '.3vw',
color: '#00000050',
height: '32px',
fontSize: '12px',
});

return (
<White type={props.type} onClick={props.onClick} sx={props?.sx}>
{props.children}
</White>
);
};

export const GrayButton = (props) => {
const Gray = styled(Button)({
backgroundColor: 'white',
borderRadius: '.3vw',
outline: '1px solid #00000050',
color: '#00000050',
height: '32px',
fontSize: '12px',
});

return (
<Gray type={props.type} onClick={props.onClick} sx={props?.sx}>
{props.children}
</Gray>
);
};
1 change: 1 addition & 0 deletions client/src/components/Button/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Button';
6 changes: 6 additions & 0 deletions client/src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ const Header = () => {
</Link>
</MenuItem>

<MenuItem onClick={handleClose}>
<Link to="/community" className="header-link">
<HeaderButton menuItem="Community" />
</Link>
</MenuItem>

<MenuItem onClick={handleClose}>
<Link to="/data" className="header-link">
<HeaderButton menuItem="Data" />
Expand Down
11 changes: 11 additions & 0 deletions client/src/components/Icons/Link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

import { Link, LinkOff } from '@mui/icons-material';

export const LinkIcon = (props) => (
<Link sx={{ verticalAlign: 'top' }} {...props} />
);

export const LinkOffIcon = (props) => (
<LinkOff sx={{ verticalAlign: 'top' }} {...props} />
);
6 changes: 6 additions & 0 deletions client/src/components/Icons/Search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
import SearchIcon from '@mui/icons-material/Search';

export const Search = (props) => (
<SearchIcon sx={{ verticalAlign: 'top' }} {...props} />
);
15 changes: 15 additions & 0 deletions client/src/components/Icons/Sort.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

import { Remove, ExpandLess, ExpandMore } from '@mui/icons-material';

export const Neutral = (props) => (
<Remove sx={{ verticalAlign: 'top' }} {...props} />
);

export const SortUp = (props) => (
<ExpandLess sx={{ verticalAlign: 'top' }} {...props} />
);

export const SortDown = (props) => (
<ExpandMore sx={{ verticalAlign: 'top' }} {...props} />
);
6 changes: 6 additions & 0 deletions client/src/components/Icons/Upload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
import { UploadFile } from '@mui/icons-material';

export const UploadFileIcon = (props) => (
<UploadFile sx={{ verticalAlign: 'top' }} {...props} />
);
4 changes: 4 additions & 0 deletions client/src/components/Icons/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export * from './Adopt';
export * from './Drop';
export * from './Like';
export * from './Link'
export * from './Upload'
export * from './Search'
export * from './Sort'
31 changes: 31 additions & 0 deletions client/src/components/SearchBar/SearchBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';

import { Search } from '@/components/Icons';

import './SearchBar.scss';
export const SearchBar = (props) => {
return (
<div className="searchbar" style={{ ...props.style.div }}>
<label htmlFor="searchbar">
<Search
sx={{
color: '#00000050',
fontSize: '24px',
marginLeft: '10px',
marginRight: '10px',
fontFamily: 'Montserrat',
}}
/>
</label>

<input
id="searchbar"
style={{ ...props.style.input }}
value={props.search}
onChange={props.onChange}
placeholder={props.placeholder}
className="searchbar__input"
/>
</div>
);
};
17 changes: 17 additions & 0 deletions client/src/components/SearchBar/SearchBar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.searchbar{
display: flex;
align-items: center;
border: 1px solid #00000050;
&__input{
border: none;
width: 100%;
height: 100%;
}
&__input:focus{
outline: none;

}
&__input::-webkit-input-placeholder{
color: '#00000050',
}
}
13 changes: 2 additions & 11 deletions client/src/components/Section/Section.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import React from 'react';
import { Box } from '@mui/material';

export default function Section({ children, title }) {
export default function Section({ children, sx }) {
return (
<Box
sx={{
mt: 2,
mb: 4,
'&:last-child': {
mb: 2,
},
}}
>
<h3>{title}</h3>
<Box sx={{ fontFamily: 'Montserrat', fontWeight: 'bold', ...sx }}>
{children}
</Box>
);
Expand Down
97 changes: 97 additions & 0 deletions client/src/components/Table/TableRow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import React, { useState } from 'react';

import { Table, TableBody, TableRow, TableCell } from '@mui/material';

import { styled } from '@mui/material/styles';

export default function CommunityTableRow({ row }) {
const [hover, setHover] = useState(false);

const StyledCell = styled(TableCell)({
borderBottom: '1px #00000050 solid',
color: '#000000',
fontSize: '14px',
fontFamily: 'Montserrat',
padding: '0px',
});

const ShortCell = styled(TableCell)(
hover
? {
fontWeight: 'bold',
width: '16.67%',
borderBottom: '1px #00000050 solid',
color: '#000000',
fontSize: '14px',
fontFamily: 'Montserrat',
padding: '0px',
}
: {
width: '16.67%',
borderBottom: '1px #00000050 solid',
color: '#000000',
fontSize: '14px',
fontFamily: 'Montserrat',
padding: '0px',
},
);

const LongCell = styled(TableCell)(
hover
? {
fontWeight: 'bold',
width: '25%',
borderBottom: '1px #00000050 solid',
color: '#000000',
fontSize: '14px',
fontFamily: 'Montserrat',
padding: '0px',
}
: {
width: '25%',
borderBottom: '1px #00000050 solid',
color: '#000000',
fontSize: '14px',
fontFamily: 'Montserrat',
padding: '0px',
},
);

return (
<>
<Table>
<TableBody
sx={
hover
? { backgroundColor: '#f3f1f1', height: '40px' }
: { height: '40px' }
}
>
<TableRow
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
>
<ShortCell>{row.country}</ShortCell>
<LongCell>{row.city}</LongCell>
<ShortCell>{row.territory}</ShortCell>
<ShortCell>{row.service}</ShortCell>
<LongCell>
<a
style={
hover
? { color: '#3FAB45', textDecoration: 'underline' }
: { color: '#000000', textDecoration: 'underline' }
}
href={row.link}
target="_blank"
rel="noopener noreferrer"
>
{row.organization}
</a>
</LongCell>
</TableRow>
</TableBody>
</Table>
</>
);
}
Loading