Skip to content

Commit

Permalink
fix(Upload): unnecessary spacing when not providing title and text (
Browse files Browse the repository at this point in the history
  • Loading branch information
langz authored Oct 31, 2024
1 parent 476b60a commit 59845d0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions packages/dnb-eufemia/src/components/upload/UploadInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Tr from '../table/TableTr'
import Th from '../table/TableTh'
import Td from '../table/TableTd'
import { UploadAcceptedFileTypeObject, UploadProps } from './types'
import Flex from '../../components/Flex'

const prettifyAcceptedFileFormats = (acceptedFileTypes) =>
acceptedFileTypes.sort().join(', ').toUpperCase()
Expand Down Expand Up @@ -57,19 +58,18 @@ const UploadInfo = () => {
displayFilesAmountLimitItem

return (
<>
{title && <Lead space="0">{title}</Lead>}
<Flex.Stack gap="small">
{(title || text) && (
<Flex.Stack gap="xx-small">
{title && <Lead space="0">{title}</Lead>}

{text && (
<P top="xx-small" className="dnb-upload__text">
{text}
</P>
{text && <P className="dnb-upload__text">{text}</P>}
</Flex.Stack>
)}

{children}

{displayDl && (
<Dl top="small" bottom={0} layout="horizontal">
<Dl bottom={0} layout="horizontal">
{displayAcceptedFileFormatsListItem && (
<Dl.Item>
<Dt>{fileTypeDescription}</Dt>
Expand Down Expand Up @@ -97,10 +97,11 @@ const UploadInfo = () => {
)}
</Dl>
)}

{displayAcceptedFileFormatsTable && (
<UploadInfoAcceptedFileTypesTable />
)}
</>
</Flex.Stack>
)
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ button .dnb-form-status__text {
.dnb-upload__accepted-file-types-table.dnb-table thead th {
font-weight: var(--font-weight-medium);
font-size: var(--font-size-basis);
padding-top: var(--spacing-small);
padding-top: 0;
}
.dnb-upload__accepted-file-types-table.dnb-table thead th:first-child {
padding-left: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
& thead th {
font-weight: var(--font-weight-medium);
font-size: var(--font-size-basis);
padding-top: var(--spacing-small);
padding-top: 0;
&:first-child {
padding-left: 0;
}
Expand Down

0 comments on commit 59845d0

Please sign in to comment.