Skip to content

Commit 6e2757e

Browse files
committed
Fixes empty divs when content is blank
1 parent cf66cf9 commit 6e2757e

File tree

8 files changed

+6
-1
lines changed

8 files changed

+6
-1
lines changed

special-pages/pages/special-error/app/components/AdvancedInfo.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export function VisitSiteLink({ elemRef }) {
3434

3535
export function AdvancedInfoHeading() {
3636
const heading = useAdvancedInfoHeading();
37+
if (!heading) return null;
3738

3839
return (
3940
<header className={styles.heading}>
@@ -46,6 +47,7 @@ export function AdvancedInfoHeading() {
4647

4748
export function AdvancedInfoContent() {
4849
const content = useAdvancedInfoContent();
50+
if (!content.length) return null;
4951

5052
return (
5153
<div className={styles.content}>

special-pages/pages/special-error/app/components/Warning.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ export function LeaveSiteButton() {
5353
}
5454

5555
export function WarningHeading() {
56-
const { kind } = useErrorData();
5756
const heading = useWarningHeading();
57+
if (!heading) return null;
58+
59+
const { kind } = useErrorData();
5860
const platformName = usePlatformName();
5961
const isMobile = useIsMobile();
6062

@@ -84,6 +86,7 @@ export function WarningHeading() {
8486

8587
export function WarningContent() {
8688
const content = useWarningContent();
89+
if (!content.length) return null;
8790

8891
return (
8992
<div className={styles.content}>

0 commit comments

Comments
 (0)