Skip to content

Commit

Permalink
Merge pull request #7070 from TheThingsNetwork/fix/various-console-re…
Browse files Browse the repository at this point in the history
…design

Apply various redesign fixes
  • Loading branch information
ryaplots authored May 16, 2024
2 parents c86c8f1 + 9844b75 commit 6fa8244
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 39 deletions.
1 change: 1 addition & 0 deletions pkg/webui/components/dropdown/portal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const Portal = ({ children, visible, positionReference }) => {
minWidth: '100%',
minHeight: '100%',
}}
ref={positionReference.current}
>
{/* Simulate button to allow for the dropdown positioning logic to work correctly */}
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
padding-bottom: 1px

.fly-out-list
--dropdown-offset: calc(.75rem - 2px)
--dropdown-offset: calc(.75rem - 3px)
top: - $cs.xs
color: var(--c-text-neutral-heavy)
2 changes: 1 addition & 1 deletion pkg/webui/components/sidebar/side-menu/item/item.styl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
color: inherit

.fly-out-list
--dropdown-offset: $cs.xs
--dropdown-offset: calc(.75rem - 2px)
top: - $cs.xs
z-index: $zi.dropdown
3 changes: 2 additions & 1 deletion pkg/webui/components/sidebar/switcher/switcher.styl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
font-weight: 300

.fly-out-list
--dropdown-offset: calc(1rem - 2px)
position: relative
--dropdown-offset: calc(.75rem - (-1px))
top: - $cs.xs
color: var(--c-text-neutral-heavy)
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ DocsPanelLink.propTypes = {
const DocumentationDashboardPanel = () => (
<Panel
title={sharedMessages.documentation}
path={docBaseUrl}
icon={IconBook}
buttonTitle={sharedMessages.documentation}
shortCutLinkPath={docBaseUrl}
shortCutLinkTitle={sharedMessages.showMore}
shortCutLinkTarget="_blank"
divider
target="_blank"
className="h-full"
>
<DocsPanelLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ const NotificationsDashboardPanel = () => {
return (
<Panel
title={sharedMessages.notifications}
path="/notifications"
icon={IconInbox}
buttonTitle={sharedMessages.viewAll}
shortCutLinkPath="/notifications"
shortCutLinkTitle={sharedMessages.viewAll}
messageDecorators={totalUnseenNotifications > 0 ? <MessageDecorator /> : undefined}
className={style.notificationPanel}
>
{notifications && notifications.length === 0 ? (
<div className="flex-grow j-center">
<div className="d-flex direction-column flex-grow j-center">
<Message content={m.noNotifications} className="d-block text-center fs-l fw-bold" />
<Message
content={m.noNotificationsDescription}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
.notification-panel
height: 100%
min-height: 26rem
display: flex
flex-direction: column

&-title, &-preview
overflow: hidden
text-overflow: ellipsis
Expand Down
2 changes: 1 addition & 1 deletion pkg/webui/console/containers/shortcut-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const m = defineMessages({
})

const ShortcutPanel = () => (
<Panel title={m.shortcuts} path="/edit-shortcuts" icon={IconBolt} divider className="h-full">
<Panel title={m.shortcuts} icon={IconBolt} divider className="h-full">
<div className="grid gap-cs-xs">
<ShortcutItem
icon={IconApplication}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import React from 'react'
import classnames from 'classnames'

import Icon, { IconPlus } from '@ttn-lw/components/icon'
import Icon from '@ttn-lw/components/icon'
import Link from '@ttn-lw/components/link'

import Message from '@ttn-lw/lib/components/message'
Expand All @@ -27,9 +27,6 @@ import style from './shortcut-item.styl'
const ShortcutItem = ({ icon, title, link, className }) => (
<Link to={link} className={classnames(style.shortcut, className)}>
<div className="pos-relative w-full h-full">
<div className={style.addIconWrapper}>
<Icon icon={IconPlus} className={style.addIcon} size={42} />
</div>
<div className={style.shortcutTitleWrapper}>
<Icon icon={icon} className={style.icon} size={28} />
<Message content={title} className={style.title} component="span" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,24 @@
font-weight: $fwv2.semibold
transition: $ad.s background ease-in-out

&-title-wrapper,
.add-icon-wrapper
position: absolute
&-title-wrapper
width: 100%
height: 100%
display: flex
justify-content: center
align-items: center
flex-direction: column
gap: $cs.m
top: 0
opacity: 1
transition: $ad.s opacity ease-in-out

&-title-wrapper
text-wrap: wrap
text-align: center
opacity: 1

.add-icon-wrapper
opacity: 0
gap: $cs.m
transition: $ad.s opacity ease-in-out

span.icon
font-size: 2rem

span.add-icon
font-size: 2.5rem

&:hover
cursor: pointer
background: var(--c-bg-brand-normal-hover)

.shortcut-title-wrapper
opacity: 0

.add-icon-wrapper
opacity: 1

span.icon
font-size: 2rem

span.add-icon
font-size: 2.5rem

0 comments on commit 6fa8244

Please sign in to comment.