Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kami2016 committed Jun 29, 2024
1 parent 2e58801 commit fc07ced
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 52 deletions.
36 changes: 18 additions & 18 deletions dist/assets/index.31ebd19d.js → dist/assets/index.5c83a33d.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Buero Vatter</title>


<script type="module" crossorigin src="/bv2024_frontend/assets/index.31ebd19d.js"></script>
<script type="module" crossorigin src="/bv2024_frontend/assets/index.5c83a33d.js"></script>
<link rel="stylesheet" href="/bv2024_frontend/assets/index.c18003bd.css">
</head>
<body>
Expand Down
9 changes: 5 additions & 4 deletions src/pages/Home/ServicePicComp.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Spinner from "../Others/Spinner";
import styles from "./servicepiccomp.module.css";
import { useNavigate } from "react-router-dom";
import forschung_pic from "../../assets/imgs/category/forschung.png";
import { useQuery } from "@tanstack/react-query";
import fetchData from "../../utils/fetchData";
import Spinner from "../Others/Spinner";
import styles from "./servicepiccomp.module.css";
import forschung_pic from "../../assets/imgs/category/forschung.png";

const ServicePicComp = ({ imgid, picName }) => {
const navigate = useNavigate();
const media = useQuery(["media_pic", `media`, imgid], fetchData);
const media = useQuery(["service_pic", `media`, imgid], fetchData);
if (media.isLoading) {
return <Spinner></Spinner>;
}
Expand Down
12 changes: 8 additions & 4 deletions src/pages/Staffs/StaffDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ import fetchData from "../../utils/fetchData";
import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col";
import Spinner from "../Others/Spinner";
import { useFetchMedia } from "../../utils/useFetchMedia";
import unknownstaff_pic from "../../assets/imgs/staffs/unknown.png";

const StaffDetail = () => {
const location = useLocation();
const state = location.state;
const navigate = useNavigate();
const media = useFetchMedia(state.acf.imgid);
const media = useQuery(["service_pic", `media`, state.acf.imgid], fetchData);
const staffdetails = useQuery(
["staffdetails", `mitarbeitende/${state.id}`, ""],
fetchData,
);

if (media.isLoading) {
return <Spinner></Spinner>;
}
if (media.isError) {
navigate("/NotMatch404");
}
if (staffdetails.isLoading) {
return <Spinner></Spinner>;
}
Expand All @@ -35,7 +39,7 @@ const StaffDetail = () => {
<Col lg={4} md={5}>
<StaffDetailCompLeft
staff={staffdetails.data}
img={media ?? unknownstaff_pic}
img={media.data.source_url ?? unknownstaff_pic}
></StaffDetailCompLeft>
</Col>
<Col lg={8} md={7} xs={12}>
Expand Down
17 changes: 13 additions & 4 deletions src/pages/Staffs/StaffPicComp.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import { useFetchMedia } from "../../utils/useFetchMedia";
import { useNavigate } from "react-router-dom";
import { useQuery } from "@tanstack/react-query";
import fetchData from "../../utils/fetchData";
import Spinner from "../Others/Spinner";
import unknownstaff_pic from "../../assets/imgs/staffs/unknown.png";
import styles from "./staffpiccomp.module.css";
const StaffPicComp = ({ imgid, staffName, position }) => {
const media = useFetchMedia(imgid);

const navigate = useNavigate();
const media = useQuery(["staff_pic", `media`, imgid], fetchData);
if (media.isLoading) {
return <Spinner></Spinner>;
}
if (media.isError) {
navigate("/NotMatch404");
}
return (
<div className={`${styles.staff_pic_container}`}>
<div className={`${styles.staff_pic}`}>
<img
className={`${styles.pic}`}
src={media ?? unknownstaff_pic}
src={media.data.source_url ?? unknownstaff_pic}
alt={staffName}
></img>
<div className={`${styles.staff_pic_caption_1}`}>
Expand Down
17 changes: 13 additions & 4 deletions src/pages/Topics/TopicTabComp.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { useFetchMedia } from "../../utils/useFetchMedia";
import { useNavigate } from "react-router-dom";
import { useQuery } from "@tanstack/react-query";
import fetchData from "../../utils/fetchData";
import Spinner from "../Others/Spinner";
import styles from "./topictabcomp.module.css";
import health_pic from "../../assets/imgs/topics/gesundheit.png";
const TopicTabComp = ({ imgid, picName }) => {
const media = useFetchMedia(imgid);

const navigate = useNavigate();
const media = useQuery(["topic_pic", `media`, imgid], fetchData);
if (media.isLoading) {
return <Spinner></Spinner>;
}
if (media.isError) {
navigate("/NotMatch404");
}
return (
<div className={`${styles.topic_pic_Container}`}>
<div className={`${styles.topic_pic}`}>
<img src={media ?? health_pic} alt={picName} />
<img src={media.data.source_url ?? health_pic} alt={picName} />
<div className={`${styles.topic_pic_caption}`}>
<div className={`${styles.topic_pic_text}`}>{picName}</div>
</div>
Expand Down
17 changes: 0 additions & 17 deletions src/utils/useFetchMedia.jsx

This file was deleted.

0 comments on commit fc07ced

Please sign in to comment.