From 551e086de035ad5520075964218e6a07f7b00179 Mon Sep 17 00:00:00 2001 From: "D. Ror" Date: Thu, 11 Apr 2024 13:05:04 -0400 Subject: [PATCH] [WordCard] Prevent vern and button/icon overlap (#2963) --- src/components/WordCard/index.tsx | 65 +++++++++++++++++-------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/src/components/WordCard/index.tsx b/src/components/WordCard/index.tsx index 99d39e3f5b..b23dfd3daf 100644 --- a/src/components/WordCard/index.tsx +++ b/src/components/WordCard/index.tsx @@ -3,6 +3,7 @@ import { Badge, Card, CardContent, + CardHeader, IconButton, Typography, } from "@mui/material"; @@ -42,39 +43,45 @@ export default function WordCard(props: WordCardProps): ReactElement { } }, [editedBy, provenance]); + /* Vernacular */ + const title = ( + + {word.vernacular} + + ); + + /* Icons/buttons beside vernacular */ + const action = ( + <> + {/* Condensed audio, note, flag */} + {!full && ( + <> + + {!!note.text && } + {flag.active && } + + )} + {/* Button for expand/condense */} + t.palette.grey[900] }} /> + ) : ( + t.palette.grey[600] }} /> + ) + } + onClick={() => setFull(!full)} + /> + + ); + return ( t.palette.grey[300], minWidth: "200px" }} > - - {/* Vernacular */} - - {word.vernacular} - - -
- {/* Condensed audio, note, flag */} - {!full && ( - <> - - {!!note.text && } - {flag.active && } - - )} - {/* Button for expand/condense */} - t.palette.grey[900] }} /> - ) : ( - t.palette.grey[600] }} /> - ) - } - onClick={() => setFull(!full)} - /> -
- + + {/* Expanded audio, note, flag */} {full && ( <>