Skip to content

Commit

Permalink
Remove pills from replies in list + Fix ordering of replies in detail…
Browse files Browse the repository at this point in the history
…s view
  • Loading branch information
Max Frederiksen authored and Max Frederiksen committed Nov 11, 2024
1 parent d96675b commit 1d18128
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/beta/components/log/LogDetails/LogDetailsWithReplies.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ const LogDetailsWithReplies = ({ log }) => {
log,
...replies.filter(it => it.id !== log.id)
].toSorted(sortByCreatedDate(dateDescending));

const parentLog = sortedLogs.pop();
sortedLogs.unshift(parentLog);
return (
<Stack divider={<Divider flexItem />} sx={{
overflow: "auto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const SearchResultSingleItem = ({ log, selected, onClick, isReply, expand
return (
<Stack
px={4}
py={2}
py={1.5}
sx={{
position: "relative",
borderBottom: "1px solid #bdbdbd",
Expand All @@ -32,7 +32,7 @@ export const SearchResultSingleItem = ({ log, selected, onClick, isReply, expand
backgroundColor: "grey.300"
}),
...(isReply && {
paddingLeft: "70px"
paddingLeft: "75px"
}),
"&:last-child": {
borderBottom: "none",
Expand All @@ -43,7 +43,7 @@ export const SearchResultSingleItem = ({ log, selected, onClick, isReply, expand
onKeyDown={handleKeyDown}
data-id={log.id}
>
{isReply && <TurnRightIcon sx={{ position: "absolute", top: "35%", left: "50px", transform: "rotate(-90deg) translate(-50%, -50%)", color: "#6f6f6f" }} fontSize="small" />}
{isReply && <TurnRightIcon sx={{ position: "absolute", top: "35%", left: "55px", transform: "rotate(-90deg) translate(-50%, -50%)", color: "#6f6f6f" }} fontSize="small" />}
<Stack flexDirection="row" gap={1} paddingBottom={0.5}>
<FormattedDate
date={log.createdDate}
Expand All @@ -69,10 +69,12 @@ export const SearchResultSingleItem = ({ log, selected, onClick, isReply, expand
<Typography variant="caption">
{log.description.length > 100 ? log.description.substring(0, 100) + "..." : log.description}
</Typography>
<Stack mt={1} flexDirection="row" gap={0.5} flexWrap="wrap" gridColumn="span 2" sx={{ "& > div": { cursor: "pointer" } }}>
{log?.logbooks?.map(it => <LogbookChip sx={{ fontSize: ".7rem" }} key={it.name} value={it.name} />)}
{log?.tags?.map(it => <TagChip sx={{ fontSize: ".7rem" }} key={it.name} value={it.name} />)}
</Stack>
{!isReply && (
<Stack mt={1} flexDirection="row" gap={0.5} flexWrap="wrap" gridColumn="span 2" sx={{ "& > div": { cursor: "pointer" } }}>
{log?.logbooks?.map(it => <LogbookChip sx={{ fontSize: ".7rem" }} key={it.name} value={it.name} />)}
{log?.tags?.map(it => <TagChip sx={{ fontSize: ".7rem" }} key={it.name} value={it.name} />)}
</Stack>
)}
{expandIcon}
</Stack>
);
Expand Down

0 comments on commit 1d18128

Please sign in to comment.