Skip to content

Commit

Permalink
finshed
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffcheema committed Jun 10, 2023
1 parent 0ac210e commit c237725
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/components/FacilitiesPageViewMore/ViewMore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { useBackend } from '../../contexts/BackendContext';
import { screenWidthExceeds } from '../../util/utils';
import CreateToast from '../Toasts/CreateToast';
import './ViewMore.css';
import UploadAvatar from '../UploadAvatar/UploadAvatar';

// export const theme = extendTheme({
// colors: {
Expand All @@ -46,6 +47,7 @@ const ViewMore = () => {
// const [inputValue, setInputValue] = useState('');
const { backend } = useBackend();
const { state } = useLocation();
console.log(state);
const { isOpen, onOpen, onClose } = useDisclosure();
const cancelDisclosure = useDisclosure({ id: 'cancel-modal' });
const toast = useToast();
Expand Down Expand Up @@ -372,7 +374,7 @@ const ViewMore = () => {
<Box className="facilityModalContent" p={5}>
<div className="userInfoButtons">
<div className="placeholder">
<Avatar height="100px" width="100px" />
<Avatar name={state.name} src={state.image} height="100px" width="100px" />
</div>
<div className="modalHeader">
<h1 className={`enterName ${!isLargerThan768 && 'mobileLower'}`}>
Expand Down
25 changes: 13 additions & 12 deletions src/pages/Facilities/Facilities.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@ const Facilities = () => {
const [resultsPerPage, setResultsPerPage] = useState(10);
const [page, setPage] = useState(0);

const navigateViewMore = (username, address, desc, id) => {
const navigateViewMore = props => {
Navigate('/view-more', {
state: {
name: username,
addressLine: address,
description: desc,
id,
...props,
},
});
};
Expand Down Expand Up @@ -159,6 +156,7 @@ const Facilities = () => {
phoneNumber,
email,
image,
...props
}) => (
<Tr key={name} py={2}>
<Td style={{ display: 'flex', alignItems: 'center' }}>
Expand All @@ -181,16 +179,18 @@ const Facilities = () => {
colorScheme="teal"
p={3}
onClick={() =>
navigateViewMore(
navigateViewMore({
name,
addressLine,
address: addressLine,
description,
id,
facility_contacts,
title,
phoneNumber,
email,
)
image,
...props,
})
}
>
View More
Expand Down Expand Up @@ -329,16 +329,17 @@ const Facilities = () => {
colorScheme="teal"
p={3}
onClick={() =>
navigateViewMore(
navigateViewMore({
name,
addressLine,
address_line: addressLine,
description,
id,
facility_contacts,
title,
phoneNumber,
email,
)
facility_contacts,
image,
})
}
>
View More
Expand Down

0 comments on commit c237725

Please sign in to comment.