Skip to content

Commit

Permalink
fix comment icon, conversations after creating new conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
taustad committed Sep 15, 2023
1 parent f788521 commit 3483a12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
13 changes: 2 additions & 11 deletions src/Components/JIP33Table/JIP33Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import useStyles from "@equinor/fusion-react-ag-grid-styles"
import { Icon } from "@equinor/eds-core-react"
import { comment, comment_chat } from "@equinor/eds-icons"
import styled from "styled-components"
import { Message } from "../../Models/Message"
import { ColorLegendEnum } from "./JIP33ColorLegendEnums"
import { ViewContext } from "../../Context/ViewContext"
import EquipmentListReview from "../../Components/EquipmentListView/EquipmentListReview"
import { Conversation } from "../../Models/Conversation"

const Wrapper = styled.div`
height: 100%;
Expand All @@ -24,8 +21,6 @@ const TableContainer = styled.div`
`
interface Props {
rowData: object[]
reviewComments?: Message[] | undefined
conversations?: Conversation[] | undefined
setReviewSideSheetOpen?: Dispatch<SetStateAction<boolean>> | undefined
setCurrentProperty?: Dispatch<SetStateAction<string>> | undefined
setWidth?: (width: number) => void
Expand All @@ -34,18 +29,14 @@ interface Props {

function JIP33Table({
rowData,
reviewComments,
conversations,
setReviewSideSheetOpen,
setCurrentProperty,
setWidth,
width,
}: Props) {
const { setActiveSheetTab } = useContext(ViewContext)
const styles = useStyles()

const { activeTagData } = useContext(ViewContext)
const { activeTagData, conversations, setActiveSheetTab } = useContext(ViewContext)
const [reviewOpen, setReviewOpen] = useState<boolean>(false)
const styles = useStyles()

const red = "white" // "#e6b8b7"
const lightBlue = "white" // "#b7dee8"
Expand Down
1 change: 0 additions & 1 deletion src/Components/JIP33WithSideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ const JIP33WithSideMenu: React.FC<Props> = ({
<StyledTabPanel>
<JIP33Table
rowData={rowDataList[activeTab]}
reviewComments={reviewComments}
setCurrentProperty={setCurrentProperty}
setReviewSideSheetOpen={setReviewSideSheetOpen}
setWidth={setWidth}
Expand Down
2 changes: 2 additions & 0 deletions src/Components/SideSheet/Comments/Components/CommentView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const CommentView: React.FC<CommentViewProps> = ({
const service = await GetConversationService()
const savedConversation = await service.createConversation(activeTagData?.review?.id ?? "", createCommentDto)
setActiveConversation(savedConversation)
const newConversations = [...conversations, savedConversation]
setConversations(newConversations)
} catch (error) {
console.error(`Error creating comment: ${error}`)
}
Expand Down

0 comments on commit 3483a12

Please sign in to comment.