Skip to content

Commit

Permalink
Merge pull request #124 from GainForest/polly
Browse files Browse the repository at this point in the history
add polly chat card
  • Loading branch information
zlefler authored Aug 12, 2024
2 parents 7dc30cb + 46413e5 commit 26a5c8f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
12 changes: 12 additions & 0 deletions web/src/components/Overlays/Info/AiAssistant.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { InfoBox } from './InfoBox'
export const AiAssistant = ({ mediaSize }) => {
return (
<InfoBox mediaSize={mediaSize}>
<iframe
title={'Polly chatbot'}
style={{ height: '100%', width: '100%' }}
src="https://polly.gainforest.earth/"
/>
</InfoBox>
)
}
15 changes: 7 additions & 8 deletions web/src/components/Overlays/InfoOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { setInfoOverlay } from 'src/reducers/overlaysReducer'
import { ExitButton } from '../Map/components/ExitButton'
import { MaximizeButton } from '../Map/components/MaximizeButton'

import { AiAssistant } from './Info/AiAssistant'
import { BiodiversityCard } from './Info/BiodiversityCard/BiodiversityCard'
import { ChatCard } from './Info/ChatCard'
import { CommunityCard } from './Info/CommunityCard'
Expand Down Expand Up @@ -65,18 +66,18 @@ export const InfoOverlay = ({
mediaSize={mediaSize}
description={'Project Info'}
buttonIcon={'star'}
position={2}
position={1}
active={infoOverlay.startsWith('info')}
onClick={() => dispatch(setInfoOverlay('info'))}
/>
{/* <InfoOverlayButton
<InfoOverlayButton
mediaSize={mediaSize}
description={'AI Assistant'}
buttonIcon={'chat'}
position={2}
active={infoOverlay.startsWith(5})
onClick={() => dispatch(setInfoOverlay('5'))}
/> */}
active={infoOverlay.startsWith('chat')}
onClick={() => dispatch(setInfoOverlay('chat'))}
/>
<InfoOverlayButton
mediaSize={mediaSize}
description={'Biodiversity'}
Expand Down Expand Up @@ -161,9 +162,7 @@ export const InfoOverlay = ({
activeProjectData={activeProjectData}
/>
)}
{infoOverlay.startsWith('chat') && (
<ChatCard mediaSize={mediaSize} activeProjectData={activeProjectData} />
)}
{infoOverlay.startsWith('chat') && <AiAssistant mediaSize={mediaSize} />}
{infoOverlay.startsWith('logbook') && (
<LogbookCard
activeProjectData={activeProjectData}
Expand Down

0 comments on commit 26a5c8f

Please sign in to comment.