@@ -27,6 +27,7 @@ import * as backend from "backend";
2727import { getCurrentUser , getUserId } from "backend/localStorage" ;
2828import NewEntry from "components/DataEntry/DataEntryTable/NewEntry" ;
2929import RecentEntry from "components/DataEntry/DataEntryTable/RecentEntry" ;
30+ import { RecentEntryCold } from "components/DataEntry/DataEntryTable/RecentEntryCold" ;
3031import {
3132 filterWordsWithSenses ,
3233 focusInput ,
@@ -35,7 +36,6 @@ import { uploadFileFromPronunciation } from "components/Pronunciations/utilities
3536import { useAppSelector } from "rootRedux/hooks" ;
3637import { type StoreState } from "rootRedux/types" ;
3738import { type Hash } from "types/hash" ;
38- import theme from "types/theme" ;
3939import {
4040 FileWithSpeakerId ,
4141 newGloss ,
@@ -214,6 +214,7 @@ const defaultNewEntryState = (): NewEntryState => ({
214214interface EntryTableState extends NewEntryState {
215215 defunctUpdates : Hash < string > ;
216216 defunctWordIds : Hash < DefunctStatus > ;
217+ recentWordEditingIndex : number | undefined ;
217218 recentWords : WordAccess [ ] ;
218219 senseSwitches : SenseSwitch [ ] ;
219220}
@@ -222,6 +223,7 @@ const defaultEntryTableState = (): EntryTableState => ({
222223 ...defaultNewEntryState ( ) ,
223224 defunctUpdates : { } ,
224225 defunctWordIds : { } ,
226+ recentWordEditingIndex : undefined ,
225227 recentWords : [ ] ,
226228 senseSwitches : [ ] ,
227229} ) ;
@@ -1016,7 +1018,7 @@ export default function DataEntryTable(
10161018
10171019 return (
10181020 < form onSubmit = { ( e ?: FormEvent < HTMLFormElement > ) => e ?. preventDefault ( ) } >
1019- < Grid2 container rowSpacing = { theme . spacing ( 2 ) } >
1021+ < Grid2 container rowSpacing = { 1 } >
10201022 < Grid2 size = { 4 } >
10211023 < Typography align = "center" variant = "h5" >
10221024 { t ( "addWords.vernacular" ) }
@@ -1033,25 +1035,44 @@ export default function DataEntryTable(
10331035 < Grid2
10341036 key = { `${ wordAccess . word . id } _${ wordAccess . senseGuid } ` }
10351037 size = { 12 }
1038+ sx = { { borderBottom : "1px solid #eee" } }
10361039 >
1037- < RecentEntry
1038- rowIndex = { index }
1039- entry = { wordAccess . word }
1040- senseGuid = { wordAccess . senseGuid }
1041- updateGloss = { updateRecentGloss }
1042- updateNote = { updateRecentNote }
1043- updateVern = { updateRecentVern }
1044- removeEntry = { undoRecentEntry }
1045- addAudioToWord = { addAudioFileToWord }
1046- delAudioFromWord = { deleteAudioFromWord }
1047- repAudioInWord = { replaceAudioInWord }
1048- focusNewEntry = { handleFocusNewEntry }
1049- analysisLang = { analysisLang }
1050- vernacularLang = { vernacularLang }
1051- disabled = { Object . keys ( state . defunctWordIds ) . includes (
1052- wordAccess . word . id
1053- ) }
1054- />
1040+ { index === state . recentWordEditingIndex ? (
1041+ < RecentEntry
1042+ rowIndex = { index }
1043+ entry = { wordAccess . word }
1044+ senseGuid = { wordAccess . senseGuid }
1045+ updateGloss = { updateRecentGloss }
1046+ updateNote = { updateRecentNote }
1047+ updateVern = { updateRecentVern }
1048+ removeEntry = { undoRecentEntry }
1049+ addAudioToWord = { addAudioFileToWord }
1050+ delAudioFromWord = { deleteAudioFromWord }
1051+ repAudioInWord = { replaceAudioInWord }
1052+ focusNewEntry = { handleFocusNewEntry }
1053+ analysisLang = { analysisLang }
1054+ vernacularLang = { vernacularLang }
1055+ disabled = { Object . keys ( state . defunctWordIds ) . includes (
1056+ wordAccess . word . id
1057+ ) }
1058+ />
1059+ ) : (
1060+ < div
1061+ onClick = { ( ) =>
1062+ setState ( ( prev ) => ( {
1063+ ...prev ,
1064+ recentWordEditingIndex : index ,
1065+ } ) )
1066+ }
1067+ >
1068+ < RecentEntryCold
1069+ analysisLang = { analysisLang }
1070+ entry = { wordAccess . word }
1071+ rowIndex = { index }
1072+ senseGuid = { wordAccess . senseGuid }
1073+ />
1074+ </ div >
1075+ ) }
10551076 </ Grid2 >
10561077 ) ) }
10571078
0 commit comments