fix(failed-publish): keep bracket actions on one line

Replace mobile-only line breaks with CSS so retry/delete actions wrap
as a block without splitting bracket labels across lines.
This commit is contained in:
Tommaso Casaburi
2026-06-09 16:51:35 +07:00
parent a3ff6b2e33
commit 9de2e6a851
2 changed files with 21 additions and 19 deletions
+15 -19
View File
@@ -1,5 +1,4 @@
import styles from '../views/post/post.module.css';
import useIsMobile from '../hooks/use-is-mobile';
interface FailedPublishNoticeProps {
isDeleting: boolean;
@@ -9,33 +8,30 @@ interface FailedPublishNoticeProps {
}
const FailedPublishNotice = ({ isDeleting, isRetrying = false, onDelete, onRetry }: FailedPublishNoticeProps) => {
const isMobile = useIsMobile();
const isBusy = isDeleting || isRetrying;
return (
<span className={styles.failedPublishNotice}>
This post failed to publish, it's not visible to other users.{' '}
{isMobile && (
<>
<br />
<br />
</>
)}
{onRetry && (
This post failed to publish, it's not visible to other users.
<span className={styles.failedPublishActions}>
{onRetry && (
<>
<span className={styles.failedDeletePostAction}>
<span className={styles.failedDeletePostBracket}>[</span>
<button type='button' className={styles.failedDeletePostButton} disabled={isBusy} onClick={onRetry}>
Retry Publish
</button>
<span className={styles.failedDeletePostBracket}>]</span>
</span>{' '}
</>
)}
<span className={styles.failedDeletePostAction}>
<span className={styles.failedDeletePostBracket}>[</span>
<button type='button' className={styles.failedDeletePostButton} disabled={isBusy} onClick={onRetry}>
Retry Publish
<button type='button' className={styles.failedDeletePostButton} disabled={isBusy} onClick={onDelete}>
Delete Post
</button>
<span className={styles.failedDeletePostBracket}>]</span>
</span>
)}{' '}
<span className={styles.failedDeletePostAction}>
<span className={styles.failedDeletePostBracket}>[</span>
<button type='button' className={styles.failedDeletePostButton} disabled={isBusy} onClick={onDelete}>
Delete Post
</button>
<span className={styles.failedDeletePostBracket}>]</span>
</span>
</span>
);
+6
View File
@@ -671,8 +671,14 @@
font-weight: 700;
}
.failedPublishActions {
display: block;
margin-top: 5px;
}
.failedDeletePostAction {
font-weight: 400;
white-space: nowrap;
}
.failedDeletePostBracket {