Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Update announcement notification style and hover behavior retry #3736

Merged
merged 3 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
.readMore {
all: unset;
color: var(--secondary);
font-size: var(--font-m);
font-weight: var(--font-medium);
margin-left: var(--unit-1);
}

.readMore:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import {
AnnouncementNotification as AnnouncementNotificationType
} from '@audius/common'
import { MarkdownViewer } from '@audius/stems'
import cn from 'classnames'
import { useDispatch } from 'react-redux'

import { make, useRecord } from 'common/store/analytics/actions'
import { openNotificationModal } from 'store/application/ui/notifications/notificationsUISlice'

import styles from './AnnouncementNotification.module.css'
import { NotificationBody } from './components/NotificationBody'
import notificationBodyStyles from './components/NotificationBody.module.css'
import { NotificationFooter } from './components/NotificationFooter'
import { NotificationHeader } from './components/NotificationHeader'
import { NotificationTile } from './components/NotificationTile'
Expand Down Expand Up @@ -49,7 +51,8 @@ export const AnnouncementNotification = (
return (
<NotificationTile
notification={notification}
onClick={handleClick}
onClick={longDescription ? handleClick : undefined}
disabled={!longDescription}
disableClosePanel
>
<NotificationHeader icon={<IconAnnouncement />}>
Expand All @@ -58,10 +61,13 @@ export const AnnouncementNotification = (
</NotificationTitle>
</NotificationHeader>
<NotificationBody className={styles.body}>
<MarkdownViewer markdown={shortDescription} />
<MarkdownViewer
markdown={shortDescription}
className={cn(styles.description, notificationBodyStyles.root)}
/>
{longDescription ? (
<button
className={styles.readMore}
className={cn(notificationBodyStyles.root, styles.readMore)}
onClick={handleOpenNotificationModal}
>
{messages.readMore}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
transition: all 0.12s ease-in-out;
}

.root:hover {
.active:hover {
box-shadow: 0px 0px 1px -2px rgba(133, 129, 153, 0.1),
0px 1px 0px -2px #e3e3e3, 1px 2px 5px rgba(133, 129, 153, 0.25);
transform: scale3d(1.015, 1.015, 1.015);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type NotificationTileProps = {
notification: Notification
children: ReactNode
onClick?: ReactEventHandler
// When `true` disable :active transforms
// When `true` disable :active and :hover transforms
disabled?: boolean
// When `true` do not close notification panel onClick
disableClosePanel?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ const {
const messages = {
documentTitle: 'Notifications',
description: 'View your notifications on Audius',
title: 'NOTIFICATIONS',
empty: 'There’s Nothing Here Yet!',
readMore: 'Read More'
title: 'NOTIFICATIONS'
}

// The threshold of distance from the bottom of the scroll container in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ const getScrollParent = () => {
}

const messages = {
title: 'Notifications',
empty: 'There’s Nothing Here Yet!',
readMore: 'Read More'
title: 'Notifications'
}

type NotificationPanelProps = {
Expand Down