fix: component ids adhere to html guidelines now

This commit is contained in:
Mose Müller
2023-10-30 14:05:39 +01:00
parent 7e5861ec22
commit b149c1b411
12 changed files with 55 additions and 34 deletions

View File

@ -2,6 +2,7 @@ import React, { useEffect, useRef, useState } from 'react';
import { Card, Collapse, Image } from 'react-bootstrap';
import { DocStringComponent } from './DocStringComponent';
import { ChevronDown, ChevronRight } from 'react-bootstrap-icons';
import { getIdFromFullAccessPath } from '../utils/stringUtils';
interface ImageComponentProps {
name: string;
@ -18,6 +19,7 @@ export const ImageComponent = React.memo((props: ImageComponentProps) => {
const renderCount = useRef(0);
const [open, setOpen] = useState(true);
const id = getIdFromFullAccessPath(parentPath.concat('.' + name));
useEffect(() => {
renderCount.current++;
@ -28,7 +30,7 @@ export const ImageComponent = React.memo((props: ImageComponentProps) => {
}, [props.value]);
return (
<div className={'imageComponent'} id={parentPath.concat('.' + name)}>
<div className={'imageComponent'} id={id}>
<Card>
<Card.Header
onClick={() => setOpen(!open)}