Skip to content

Commit 3b1f772

Browse files
authored
Forms: update meta section to use table instead of divs (#45656)
1 parent 6ee5fb0 commit 3b1f772

File tree

3 files changed

+47
-67
lines changed

3 files changed

+47
-67
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Forms: use table to render response meta

projects/packages/forms/src/dashboard/components/response-view/body.tsx

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -449,41 +449,37 @@ const ResponseViewBody = ( {
449449
</div>
450450

451451
<div className="jp-forms__inbox-response-meta">
452-
<div className="jp-forms__inbox-response-meta-label">
453-
<span className="jp-forms__inbox-response-meta-key">
454-
{ __( 'Date:', 'jetpack-forms' ) }&nbsp;
455-
</span>
456-
<span className="jp-forms__inbox-response-meta-value">
457-
{ sprintf(
458-
/* Translators: %1$s is the date, %2$s is the time. */
459-
__( '%1$s at %2$s', 'jetpack-forms' ),
460-
dateI18n( getDateSettings().formats.date, response.date ),
461-
dateI18n( getDateSettings().formats.time, response.date )
462-
) }
463-
</span>
464-
</div>
465-
<div className="jp-forms__inbox-response-meta-label">
466-
<span className="jp-forms__inbox-response-meta-key">
467-
{ __( 'Source:', 'jetpack-forms' ) }&nbsp;
468-
</span>
469-
<span className="jp-forms__inbox-response-meta-value">
470-
<ExternalLink href={ response.entry_permalink }>
471-
{ decodeEntities( response.entry_title ) || getPath( response ) }
472-
</ExternalLink>
473-
</span>
474-
</div>
475-
<div className="jp-forms__inbox-response-meta-label">
476-
<span className="jp-forms__inbox-response-meta-key ">
477-
{ __( 'IP address:', 'jetpack-forms' ) }&nbsp;
478-
</span>
479-
<span className="jp-forms__inbox-response-meta-value">
480-
<Tooltip text={ __( 'Lookup IP address', 'jetpack-forms' ) }>
481-
<ExternalLink href={ getRedirectUrl( 'ip-lookup', { path: response.ip } ) }>
482-
{ response.ip }
452+
<table>
453+
<tr>
454+
<th>{ __( 'Date:', 'jetpack-forms' ) }</th>
455+
<td>
456+
{ sprintf(
457+
/* Translators: %1$s is the date, %2$s is the time. */
458+
__( '%1$s at %2$s', 'jetpack-forms' ),
459+
dateI18n( getDateSettings().formats.date, response.date ),
460+
dateI18n( getDateSettings().formats.time, response.date )
461+
) }
462+
</td>
463+
</tr>
464+
<tr>
465+
<th>{ __( 'Source:', 'jetpack-forms' ) }</th>
466+
<td>
467+
<ExternalLink href={ response.entry_permalink }>
468+
{ decodeEntities( response.entry_title ) || getPath( response ) }
483469
</ExternalLink>
484-
</Tooltip>
485-
</span>
486-
</div>
470+
</td>
471+
</tr>
472+
<tr>
473+
<th>{ __( 'IP address:', 'jetpack-forms' ) }&nbsp;</th>
474+
<td>
475+
<Tooltip text={ __( 'Lookup IP address', 'jetpack-forms' ) }>
476+
<ExternalLink href={ getRedirectUrl( 'ip-lookup', { path: response.ip } ) }>
477+
{ response.ip }
478+
</ExternalLink>
479+
</Tooltip>
480+
</td>
481+
</tr>
482+
</table>
487483
</div>
488484

489485
<div className="jp-forms__inbox-response-data">
@@ -498,7 +494,6 @@ const ResponseViewBody = ( {
498494
</div>
499495
) ) }
500496
</div>
501-
502497
{ isPreviewModalOpen && previewFile && onModalStateChange && (
503498
<Modal
504499
title={ decodeEntities( ( previewFile as { name: string } ).name ) }
@@ -512,7 +507,6 @@ const ResponseViewBody = ( {
512507
/>
513508
</Modal>
514509
) }
515-
516510
<ConfirmDialog
517511
isOpen={ isConfirmDialogOpen }
518512
onConfirm={ onConfirmMarkAsSpam }

projects/packages/forms/src/dashboard/inbox/style.scss

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -126,41 +126,23 @@
126126

127127
.jp-forms__inbox-response-meta {
128128
color: var(--jp-gray-80);
129-
display: table;
130-
flex-direction: column;
131129
font-size: 12px;
132-
font-weight: 400;
133-
line-height: 20px;
134-
row-gap: 4px;
135-
padding: 12px 32px 24px;
136-
}
137-
138-
.jp-forms__inbox-response-meta-label {
139-
display: table-row;
140-
}
141-
142-
.jp-forms__inbox-response-meta-key,
143-
.jp-forms__inbox-response-meta-value {
144-
display: table-cell;
145-
white-space: nowrap;
146-
}
147-
148-
.jp-forms__inbox-response-meta-key {
149-
padding-right: 8px;
150-
}
130+
padding: 12px 30px 24px;
151131

152-
.jp-forms__inbox-response-meta-value {
153-
overflow: hidden;
154-
text-overflow: ellipsis;
155-
width: 80%;
156-
max-width: 0;
132+
table {
133+
text-align: left;
134+
width: fit-content;
157135

158-
.is-link {
159-
text-decoration: none;
160-
color: inherit;
136+
td,
137+
th {
138+
padding: 0;
139+
}
161140

162-
&:hover {
163-
text-decoration: underline;
141+
th {
142+
font-weight: 400;
143+
padding-right: variables.$grid-unit-10;
144+
vertical-align: top;
145+
white-space: nowrap;
164146
}
165147
}
166148
}

0 commit comments

Comments
 (0)