Skip to content

Commit

Permalink
refactor: make PhotoGallery React component
Browse files Browse the repository at this point in the history
  • Loading branch information
starsep committed Jan 25, 2024
1 parent d774a82 commit b9d3640
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/sidebar/defibrillatorDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ import DetailTextRow from "./detailTextRow";
import { OpeningHoursField } from "./openingHours";
import { CheckDateField } from "./verificationDate";

function photoGallery(data: DefibrillatorData, closeSidebar: () => void) {
const PhotoGallery: FC<DefibrillatorDetailsProps> = ({
data,
closeSidebar,
}) => {
if (data === null) return null;
const { t } = useTranslation();
const {
authState: { auth },
Expand Down Expand Up @@ -112,7 +116,7 @@ function photoGallery(data: DefibrillatorData, closeSidebar: () => void) {
<hr style={{ marginTop: "0.5rem", marginBottom: "1rem" }} />
</div>
);
}
};

const DefibrillatorDetails: FC<DefibrillatorDetailsProps> = (props) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -158,7 +162,7 @@ const DefibrillatorDetails: FC<DefibrillatorDetailsProps> = (props) => {
<CloseSidebarButton closeSidebarFunction={closeSidebar} />
</Card.Header>
<Card.Content pl={3} pr={3} mb={1} pt={2} className="content pb-0">
{photoGallery(data, closeSidebar)}
<PhotoGallery data={data} closeSidebar={closeSidebar} />
<Columns vCentered className="is-mobile">
<Columns.Column textAlign="center" size={2}>
<Icon
Expand Down

0 comments on commit b9d3640

Please sign in to comment.