Skip to content

Commit 9f49efc

Browse files
committed
Introduce max height to modal and make inner content scrollable
1 parent 4b7991f commit 9f49efc

12 files changed

Lines changed: 26 additions & 27 deletions

assets/js/dashboard/components/sort-button.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,23 @@ export const SortButton = ({
1515
return (
1616
<button
1717
onClick={toggleSort}
18-
className={classNames('group', 'hover:underline', 'relative')}
18+
className={classNames('group', 'hover:text-gray-700 dark:hover:text-gray-200 transition-colors duration-100', 'relative')}
1919
>
2020
{children}
2121
<span
2222
title={next.hint}
2323
className={classNames(
2424
'absolute',
25-
'rounded inline-block h-4 w-4',
25+
'rounded inline-block size-4',
2626
'ml-1',
2727
{
2828
[SortDirection.asc]: 'rotate-180',
2929
[SortDirection.desc]: 'rotate-0'
3030
}[sortDirection ?? next.direction],
3131
!sortDirection && 'opacity-0',
3232
!sortDirection && 'group-hover:opacity-100',
33-
sortDirection &&
34-
'group-hover:bg-gray-100 dark:group-hover:bg-gray-900',
35-
'transition'
33+
'group-hover:bg-gray-100 dark:group-hover:bg-gray-900',
34+
'transition-all duration-100'
3635
)}
3736
>
3837

assets/js/dashboard/components/table.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const TableHeaderCell = ({
3838
return (
3939
<th
4040
className={classNames(
41-
'p-2 text-xs font-bold text-gray-500 dark:text-gray-400 tracking-wide',
41+
'p-2 text-xs font-semibold text-gray-500 dark:text-gray-400',
4242
className
4343
)}
4444
align={align}
@@ -82,7 +82,7 @@ export const ItemRow = <T extends Record<string, string | number | ReactNode>>({
8282
columns: ColumnConfiguraton<T>[]
8383
}) => {
8484
return (
85-
<tr className="text-sm dark:text-gray-200">
85+
<tr className="group text-sm dark:text-gray-200">
8686
{columns.map(({ key, width, align, renderValue, renderItem }) => (
8787
<TableCell
8888
key={`${(pageIndex ?? null) === null ? '' : `page_${pageIndex}_`}row_${rowIndex}_${String(key)}`}
@@ -131,13 +131,13 @@ export const Table = <T extends Record<string, string | number | ReactNode>>({
131131
}
132132

133133
return (
134-
<table className="w-max overflow-x-auto md:w-full table-striped table-fixed">
135-
<thead>
136-
<tr className="text-xs font-bold text-gray-500 dark:text-gray-400">
134+
<table className="w-full border-collapse table-striped table-fixed">
135+
<thead className="sticky top-0 bg-white dark:bg-gray-900 z-10">
136+
<tr className="text-xs font-semibold text-gray-500 dark:text-gray-400">
137137
{columns.map((column) => (
138138
<TableHeaderCell
139139
key={`header_${String(column.key)}`}
140-
className={classNames('p-2 tracking-wide', column.width)}
140+
className={classNames('p-2', column.width)}
141141
align={column.align}
142142
>
143143
{column.onSort ? (

assets/js/dashboard/components/tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const Items = ({
160160
<SearchInput
161161
searchRef={searchRef}
162162
placeholderUnfocused="Press / to search"
163-
className="ml-auto w-full py-1 text-sm"
163+
className="ml-auto w-full py-1"
164164
onSearch={handleSearchInput}
165165
/>
166166
</div>

assets/js/dashboard/nav-menu/segments/searchable-segments-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const SearchableSegmentsSection = ({
8484
<SearchInput
8585
searchRef={searchRef}
8686
placeholderUnfocused="Press / to search"
87-
className="ml-auto w-full py-1 text-sm"
87+
className="ml-auto w-full py-1"
8888
onSearch={handleSearchInput}
8989
/>
9090
)}

assets/js/dashboard/stats/modals/breakdown-table.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const BreakdownTable = <TListItem extends { name: string }>({
3838
const searchRef = useRef<HTMLInputElement>(null)
3939

4040
return (
41-
<div className="w-full h-full">
41+
<>
4242
<div className="flex justify-between items-center">
4343
<div className="flex items-center gap-x-2">
4444
<h1 className="text-lg font-bold dark:text-gray-100">{title}</h1>
@@ -54,8 +54,8 @@ export const BreakdownTable = <TListItem extends { name: string }>({
5454
/>
5555
)}
5656
</div>
57-
<div className="my-3 border-b border-gray-250 dark:border-gray-700"></div>
58-
<div style={{ minHeight: `${MIN_HEIGHT_PX}px` }}>
57+
<div className="my-4 border-b border-gray-250 dark:border-gray-700"></div>
58+
<div className="flex-1 overflow-y-auto pr-3 -mr-3" style={{ minHeight: `${MIN_HEIGHT_PX}px` }}>
5959
{displayError && status === 'error' && <ErrorMessage error={error} />}
6060
{isPending && <InitialLoadingSpinner />}
6161
{data && <Table<TListItem> data={data} columns={columns} />}
@@ -66,7 +66,7 @@ export const BreakdownTable = <TListItem extends { name: string }>({
6666
/>
6767
)}
6868
</div>
69-
</div>
69+
</>
7070
)
7171
}
7272

assets/js/dashboard/stats/modals/devices/browser-versions-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function BrowserVersionsModal() {
1414
const site = useSiteContext()
1515

1616
const reportInfo = {
17-
title: 'Browser Versions',
17+
title: 'Browser versions',
1818
dimension: 'browser_version',
1919
endpoint: url.apiPath(site, '/browser-versions'),
2020
dimensionLabel: 'Browser version',

assets/js/dashboard/stats/modals/devices/operating-system-versions-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function OperatingSystemVersionsModal() {
1414
const site = useSiteContext()
1515

1616
const reportInfo = {
17-
title: 'Operating System Versions',
17+
title: 'Operating system versions',
1818
dimension: 'os_version',
1919
endpoint: url.apiPath(site, '/operating-system-versions'),
2020
dimensionLabel: 'Operating system version',

assets/js/dashboard/stats/modals/devices/operating-systems-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function OperatingSystemsModal() {
1414
const site = useSiteContext()
1515

1616
const reportInfo = {
17-
title: 'Operating Systems',
17+
title: 'Operating systems',
1818
dimension: 'os',
1919
endpoint: url.apiPath(site, '/operating-systems'),
2020
dimensionLabel: 'Operating system',

assets/js/dashboard/stats/modals/devices/screen-sizes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function ScreenSizesModal() {
1313
const site = useSiteContext()
1414

1515
const reportInfo = {
16-
title: 'Screen Sizes',
16+
title: 'Screen sizes',
1717
dimension: 'screen',
1818
endpoint: url.apiPath(site, '/screen-sizes'),
1919
dimensionLabel: 'Screen size',

assets/js/dashboard/stats/modals/filter-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class FilterModal extends React.Component {
170170
render() {
171171
return (
172172
<Modal maxWidth="460px">
173-
<h1 className="text-xl font-bold dark:text-gray-100">
173+
<h1 className="text-lg font-bold dark:text-gray-100">
174174
Filter by {formatFilterGroup(this.props.modalType)}
175175
</h1>
176176

0 commit comments

Comments
 (0)