Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const BasicPostCard: FC<PropsWithChildren<Props>> = ({
{children}
</Link>
<div className="mt-auto" />
<BasicPostControls post={post} withVoter={!minimalistic} />
<BasicPostControls post={post} minimalistic={minimalistic} />
{!minimalistic && isQuestionPost(post) && (
<CoherenceLinksProvider post={post}>
<KeyFactorsTileView post={post} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import PostVoter from "./post_voter";

type Props = {
post: Post;
withVoter?: boolean;
minimalistic?: boolean;
};

const BasicPostControls: FC<PropsWithChildren<Props>> = ({
post,
withVoter = true,
minimalistic = false,
}) => {
const resolutionData = extractPostResolution(post);
const defaultProject = post.projects.default_project;
Expand All @@ -29,12 +29,14 @@ const BasicPostControls: FC<PropsWithChildren<Props>> = ({
const projectNameLength = defaultProject?.name.length ?? 0;

const shouldUseCompactPostStatus =
projectNameLength >= 30 || (hasUnreadMessages && projectNameLength > 15);
projectNameLength >= 30 ||
(hasUnreadMessages && projectNameLength > 15) ||
minimalistic;

return (
<div className="mt-3 flex items-center justify-between rounded-ee rounded-es dark:border-blue-400-dark max-lg:flex-1">
<div className="flex items-center gap-1.5 md:gap-2">
{withVoter && <PostVoter post={post} />}
{!minimalistic && <PostVoter post={post} />}

{/* CommentStatus - compact on small screens, full on large screens */}
<CommentStatus
Expand Down Expand Up @@ -74,12 +76,14 @@ const BasicPostControls: FC<PropsWithChildren<Props>> = ({
/>
<ForecastersCounter
forecasters={post.nr_forecasters}
compact={false}
compact={minimalistic}
className="hidden md:flex"
/>
</div>
<div className="hidden overflow-hidden lg:inline-flex">
<PostDefaultProject defaultProject={defaultProject} />
{!minimalistic && (
<PostDefaultProject defaultProject={defaultProject} />
)}
</div>
</div>
);
Expand Down