Skip to content

Commit

Permalink
console,account: Fix various responsiveness issues in the overview
Browse files Browse the repository at this point in the history
  • Loading branch information
kschiffer committed Jun 11, 2024
1 parent 13c7164 commit 4805445
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 42 deletions.
3 changes: 1 addition & 2 deletions pkg/webui/components/panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Panel = ({
shortCutLinkTarget,
shortCutLinkDisabled,
}) => (
<div className={classnames(styles.panel, className)}>
<div className={classnames(styles.panel, className, { [styles.divider]: divider })}>
{title && (
<div className={styles.panelHeader}>
<div className="d-flex gap-cs-xs al-center">
Expand All @@ -84,7 +84,6 @@ const Panel = ({
)}
</div>
)}
{divider && <hr className={styles.panelDivider} />}
{children}
</div>
)
Expand Down
22 changes: 10 additions & 12 deletions pkg/webui/components/panel/panel.styl
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@

&-header
display: flex
flex-wrap: wrap
justify-content: space-between
align-items: center
margin-bottom: $cs.m
align-items: flex-start
gap: $cs.m
min-height: 2.5rem // Fix the header height to have a uniform look between panels.
margin-bottom: $cs.m
flex-shrink: 0

&-title
font-weight: $fwv2.bold
Expand All @@ -51,11 +54,11 @@
text-underline-offset: .4rem
text-decoration-color: var(--c-text-brand-normal)

&-divider
border-bottom: 1px solid var(--c-border-neutral-light)
margin-top: $cs.l
margin-bottom: $cs.l
height: 0px
&.divider
.panel-header
padding-bottom: $cs.m
border-bottom: 1px solid var(--c-border-neutral-light)
margin-bottom: $cs.l

.panel-header-icon
font-size: $fs.xl
Expand All @@ -65,8 +68,3 @@
border-radius: $br.l
color: var(--c-bg-brand-normal)
font-variation-settings: 'FILL' 1

@container panel (max-width: 485px)
.panel-header
flex-direction: column
align-items: flex-start
4 changes: 4 additions & 0 deletions pkg/webui/components/table/table/table.styl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
.section

&-header
position: sticky
background: var(--c-bg-neutral-min)
z-index: $zi.slight
top: 0
display: table-header-group

&-body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,7 @@ DocsPanelLink.propTypes = {
}

const DocumentationDashboardPanel = () => (
<Panel
title={sharedMessages.documentation}
icon={IconBook}
shortCutLinkPath={docBaseUrl}
shortCutLinkTitle={sharedMessages.showMore}
shortCutLinkTarget="_blank"
divider
className="h-full"
>
<Panel title={sharedMessages.documentation} icon={IconBook} divider className="h-full">
<DocsPanelLink
path={`${docBaseUrl}/getting-started/`}
title={m.gettingStarted}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { defineMessages } from 'react-intl'
import { IconInbox } from '@ttn-lw/components/icon'
import Panel from '@ttn-lw/components/panel'
import Status from '@ttn-lw/components/status'
import ScrollFader from '@ttn-lw/components/scroll-fader'

import FetchTable from '@ttn-lw/containers/fetch-table'

Expand Down Expand Up @@ -123,15 +124,17 @@ const NotificationsDashboardPanel = () => {
/>
</div>
) : (
<FetchTable
entity="notifications"
headers={headers}
pageSize={5}
baseDataSelector={baseDataSelectors}
getItemsAction={getItems}
getItemPathPrefix={item => `/notifications/inbox/${item.id}`}
paginated={false}
/>
<ScrollFader className={style.scrollFader} faderHeight="4rem" topFaderOffset="3rem" light>
<FetchTable
entity="notifications"
headers={headers}
pageSize={5}
baseDataSelector={baseDataSelectors}
getItemsAction={getItems}
getItemPathPrefix={item => `/notifications/inbox/${item.id}`}
paginated={false}
/>
</ScrollFader>
)}
</Panel>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

.notification-panel
height: 100%
min-height: 26rem
height: 31rem
display: flex
flex-direction: column

Expand Down Expand Up @@ -42,3 +42,9 @@

.name-header
padding-left: $cs.m + $cs.s

.scroll-fader
overflow-y: auto
width: 100%
table-layout: fixed
scrollbar-width: none
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import TopDevicesList from './top-devices'
import styles from './top-entities-panel.styl'

const m = defineMessages({
title: 'Your top entities',
title: 'Top entities',
})

const TopEntitiesDashboardPanel = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const EntitiesList = ({
EntitiesItemComponent: EntitiesItemProp,
entity,
}) => {
const listRef = useRef()
const itemsTotalCount = useSelector(state => itemsCountSelector(state, entity))
const EntitiesItemComponent = EntitiesItemProp ?? EntitiesItem

Expand Down Expand Up @@ -82,13 +81,7 @@ const EntitiesList = ({
)}
</div>
) : (
<ScrollFader
className={styles.scrollFader}
ref={listRef}
faderHeight="4rem"
topFaderOffset="3rem"
light
>
<ScrollFader className={styles.scrollFader} faderHeight="4rem" topFaderOffset="3rem" light>
<Table>
<Table.Head className={styles.topEntitiesPanelOuterTableHeader}>{columns}</Table.Head>
<Table.Body emptyMessage={m.empty}>{rows}</Table.Body>
Expand Down

0 comments on commit 4805445

Please sign in to comment.