Skip to content

Commit

Permalink
fix cards in flight when not anonymous
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkrick committed Dec 19, 2024
1 parent a9b40e0 commit fcf77ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions packages/client/components/RetroReflectPhase/PhaseItemEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const PhaseItemEditor = (props: Props) => {
JSON.stringify({type: 'doc', content: [{type: 'paragraph'}]}),
{
atmosphere,
placeholder: 'My reflection… (press enter to add)',
teamId,
readOnly: !!readOnly,
onEnter: handleSubmit
Expand Down Expand Up @@ -187,7 +188,7 @@ const PhaseItemEditor = (props: Props) => {
if (!editor) return null
return (
<>
<ReflectionCardRoot data-cy={dataCy} ref={phaseEditorRef}>
<ReflectionCardRoot data-cy={dataCy} ref={phaseEditorRef} className='max-h-28 overflow-auto'>
<TipTapEditor
className={cn(
'flex min-h-0 items-center px-4 pt-3 leading-4',
Expand All @@ -208,13 +209,19 @@ const PhaseItemEditor = (props: Props) => {
{cardsInFlightRef.current.map((card) => {
return (
<CardInFlightStyles
className='max-h-28 overflow-auto'
key={card.key}
transform={card.transform}
isStart={card.isStart}
onTransitionEnd={removeCardInFlight(card.key)}
>
<div className={cn('flex min-h-0 items-center px-4 text-sm leading-5')}>
<div dangerouslySetInnerHTML={{__html: card.html}}></div>
<div
className={cn(
'flex min-h-0 items-center px-4 pt-3 text-sm leading-4',
disableAnonymity ? 'pb-0' : 'pb-3'
)}
>
<div className='ProseMirror' dangerouslySetInnerHTML={{__html: card.html}}></div>
</div>
{disableAnonymity && (
<ReflectionCardAuthor>
Expand Down
2 changes: 1 addition & 1 deletion packages/client/hooks/useTipTapReflectionEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export const useTipTapReflectionEditor = (
) => {
const {atmosphere, teamId, readOnly, placeholder, onEnter} = options
const [linkState, setLinkState] = useState<LinkMenuState>(null)
const placeholderRef = useRef(placeholder)
const [contentJSON] = useState(() => JSON.parse(content))
const placeholderRef = useRef(placeholder)
placeholderRef.current = placeholder
const editor = useEditor(
{
Expand Down

0 comments on commit fcf77ee

Please sign in to comment.