Skip to content

Commit

Permalink
Merge pull request #213 from uselagoon/expand-warnings-logs
Browse files Browse the repository at this point in the history
Expands warning sections by default
  • Loading branch information
DaveDarsa authored Mar 1, 2024
2 parents b038440 + 126c6f0 commit 8fdb3d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/LogViewer/LogAccordion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { StyledLogAccordion, StyledWarningIcon } from '../StyledLogViewer';

const LogAccordion = forwardRef(
({ children, onToggle, header, className = '', defaultValue = false, metadata = ['', false] }, ref) => {
const hasWarning = metadata[1] === true;
if (hasWarning) defaultValue = true;

const logsTopRef = useRef(null);
const logsEndRef = useRef(null);
const [visibility, setVisibility] = useState(defaultValue);
Expand All @@ -27,8 +30,6 @@ const LogAccordion = forwardRef(
}
}, [ref, visibility, scrollHidden]);

const hasWarning = metadata[1] === true;

return (
<StyledLogAccordion className={className}>
<div
Expand Down

0 comments on commit 8fdb3d1

Please sign in to comment.