Skip to content

Commit

Permalink
fix(react-components): pois: disable row stripes and open comments an…
Browse files Browse the repository at this point in the history
…d bump 0.70.1 (#4902)

* fix(react-components): pois: disable row stripes and open comments

* chore: bump to 0.70.1

* chore: lint fix
  • Loading branch information
haakonflatval-cognite authored Nov 27, 2024
1 parent c3e1d9c commit f130c6a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion react-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cognite/reveal-react-components",
"version": "0.70.0",
"version": "0.70.1",
"exports": {
".": {
"import": "./dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { Dropdown } from '@cognite/cogs-lab';
import { PoiSharePanel } from './PoiSharePanel';
import styled from 'styled-components';
import { useMemo, type ReactNode } from 'react';
import { useMemo, useState, type ReactNode } from 'react';
import { type PointOfInterest } from '../../../architecture';
import { type CommentProperties } from '../../../architecture/concrete/pointsOfInterest/models';
import { createButton } from '../CommandButtons';
Expand Down Expand Up @@ -69,13 +69,22 @@ export const CommentSection = (): ReactNode => {

const poi = useSelectedPoi();

const [open, setOpen] = useState<boolean>(true);

const comments = useCommentsForPoiQuery(poi);
if (poi === undefined) {
return null;
}

return (
<Accordion type="ghost" title={t({ key: 'COMMENTS' })} gap={8}>
<Accordion
type="ghost"
title={t({ key: 'COMMENTS' })}
gap={8}
expanded={open}
onChange={(expanded: boolean) => {
setOpen(expanded);
}}>
<Flex direction="column" gap={8}>
{comments.data?.map((comment) => (
<SingleCommentDisplay key={`${comment.ownerId}/${comment.content}`} comment={comment} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const PoiList = ({
selectedRows={[JSON.stringify(selectedPoi?.id)]}
pagination={false}
disableColumnResize
disableRowStripes
/>
<Flex direction="row" gap={16} justifyContent="center" alignContent="center">
{hasMoreData && <Button onClick={handleShowMoreCallback}>{t({ key: 'SHOW_MORE' })}</Button>}
Expand Down

0 comments on commit f130c6a

Please sign in to comment.