Skip to content

Commit 9364d51

Browse files
authored
fix(ui): inconsistent pill sizes across admin panel (#12788)
### What? Fixes inconsistent `pill` sizes across the Admin Panel. ### How? Pills without a specified size default to **medium**. In the folders [PR](#10030), additional padding was to the medium size. As a result, any pills without an explicit size now appear larger than intended. This PR fixes that by updating any pills that should be small to explicitly set `size="small"`. Fixes #12752
1 parent b556fe3 commit 9364d51

File tree

12 files changed

+17
-10
lines changed

12 files changed

+17
-10
lines changed

packages/next/src/views/Version/SelectComparison/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const SelectComparison: React.FC<Props> = (props) => {
143143
const formattedLabel = locale?.label?.[i18n?.language] || locale?.label
144144

145145
if (formattedLabel) {
146-
publishedLocalePill = <Pill>{formattedLabel}</Pill>
146+
publishedLocalePill = <Pill size="small">{formattedLabel}</Pill>
147147
}
148148
}
149149

packages/next/src/views/Versions/cells/AutosaveCell/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ export const AutosaveCell: React.FC<AutosaveCellProps> = ({
7171
const formattedLabel = locale?.label?.[i18n?.language] || locale?.label
7272

7373
if (formattedLabel) {
74-
publishedLocalePill = <Pill>{formattedLabel}</Pill>
74+
publishedLocalePill = <Pill size="small">{formattedLabel}</Pill>
7575
}
7676
}
7777

7878
return (
7979
<div className={`${baseClass}__items`}>
80-
{rowData?.autosave && <Pill>{t('version:autosave')}</Pill>}
80+
{rowData?.autosave && <Pill size="small">{t('version:autosave')}</Pill>}
8181
{status && renderPill(rowData, latestVersion, currentLabel, previousLabel, pillStyle)}
8282
{publishedLocalePill}
8383
</div>

packages/plugin-search/src/Search/ui/ReindexButton/ReindexButtonLabel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const ReindexButtonLabel = () => {
55
i18n: { t },
66
} = useTranslation()
77
return (
8-
<Pill className="pill--has-action" icon={<ChevronIcon />} pillStyle="light">
8+
<Pill className="pill--has-action" icon={<ChevronIcon />} pillStyle="light" size="small">
99
{t('general:reindex')}
1010
</Pill>
1111
)

packages/ui/src/elements/BulkUpload/FileSidebar/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export function FileSidebar() {
9292
<Pill
9393
className={`${baseClass}__header__addFile`}
9494
onClick={() => openModal(addMoreFilesDrawerSlug)}
95+
size="small"
9596
>
9697
{t('upload:addFile')}
9798
</Pill>

packages/ui/src/elements/ListHeader/DrawerTitleActions/ListDrawerCreateNewDocButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function ListDrawerCreateNewDocButton({
2525
className={`${baseClass}__create-new-button`}
2626
key="create-new-button-toggler"
2727
>
28-
<Pill>{t('general:createNew')}</Pill>
28+
<Pill size="small">{t('general:createNew')}</Pill>
2929
</DocumentDrawerToggler>
3030
)
3131
}

packages/ui/src/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const buildUpcomingColumns = ({
4141
const type = doc.input?.type
4242

4343
return (
44-
<Pill key={doc.id} pillStyle={type === 'publish' ? 'success' : 'warning'}>
44+
<Pill key={doc.id} pillStyle={type === 'publish' ? 'success' : 'warning'} size="small">
4545
{type === 'publish' && t('version:publish')}
4646
{type === 'unpublish' && t('version:unpublish')}
4747
</Pill>

packages/ui/src/elements/QueryPresets/cells/ColumnsCell/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const QueryPresetsColumnsCell: React.FC<DefaultCellComponentProps> = ({ c
2121
}
2222

2323
return (
24-
<Pill key={i} pillStyle={isColumnActive ? 'always-white' : 'light'}>
24+
<Pill key={i} pillStyle={isColumnActive ? 'always-white' : 'light'} size="small">
2525
{toWords(column)}
2626
</Pill>
2727
)

packages/ui/src/elements/QueryPresets/fields/ColumnsField/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ export const QueryPresetsColumnField: JSONFieldClientComponent = ({
2323
const isColumnActive = !column.startsWith('-')
2424

2525
return (
26-
<Pill key={i} pillStyle={isColumnActive ? 'always-white' : 'light-gray'}>
26+
<Pill
27+
key={i}
28+
pillStyle={isColumnActive ? 'always-white' : 'light-gray'}
29+
size="small"
30+
>
2731
{toWords(column)}
2832
</Pill>
2933
)

packages/ui/src/elements/QueryPresets/fields/WhereField/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const transformWhereToNaturalLanguage = (
4444
}
4545

4646
return (
47-
<Pill pillStyle="always-white">
47+
<Pill pillStyle="always-white" size="small">
4848
<b>{toWords(key)}</b> {operator} <b>{toWords(value)}</b>
4949
</Pill>
5050
)

packages/ui/src/elements/RelationshipTable/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ export const RelationshipTable: React.FC<RelationshipTableComponentProps> = (pro
300300
icon={<ChevronIcon direction={openColumnSelector ? 'up' : 'down'} />}
301301
onClick={() => setOpenColumnSelector(!openColumnSelector)}
302302
pillStyle="light"
303+
size="small"
303304
>
304305
{t('general:columns')}
305306
</Pill>

0 commit comments

Comments
 (0)