Try to switch grouped notifications to CSS grids

This commit is contained in:
Claire 2024-08-28 20:44:38 +02:00
parent 04f0468016
commit 23a4243fa8
3 changed files with 42 additions and 50 deletions

View file

@ -113,20 +113,16 @@ export const NotificationAdminReport: React.FC<{
<Icon id='flag' icon={FlagIcon} /> <Icon id='flag' icon={FlagIcon} />
</div> </div>
<div className='notification-group__main'>
<div className='notification-group__main__header'>
<div className='notification-group__main__header__label'> <div className='notification-group__main__header__label'>
{message} {message}
<RelativeTimestamp timestamp={report.created_at} /> <RelativeTimestamp timestamp={report.created_at} />
</div> </div>
</div>
{report.comment.length > 0 && ( {report.comment.length > 0 && (
<div className='notification-group__embedded-status__content'> <div className='notification-group__embedded-status__content'>
{report.comment} {report.comment}
</div> </div>
)} )}
</div>
</a> </a>
); );
}; };

View file

@ -87,8 +87,6 @@ export const NotificationGroupWithStatus: React.FC<{
<Icon icon={icon} id={iconId} /> <Icon icon={icon} id={iconId} />
</div> </div>
<div className='notification-group__main'>
<div className='notification-group__main__header'>
<div className='notification-group__main__header__wrapper'> <div className='notification-group__main__header__wrapper'>
<AvatarGroup accountIds={accountIds} /> <AvatarGroup accountIds={accountIds} />
@ -101,7 +99,6 @@ export const NotificationGroupWithStatus: React.FC<{
{label} {label}
{timestamp && <RelativeTimestamp timestamp={timestamp} />} {timestamp && <RelativeTimestamp timestamp={timestamp} />}
</div> </div>
</div>
{statusId && ( {statusId && (
<div className='notification-group__main__status'> <div className='notification-group__main__status'>
@ -115,7 +112,6 @@ export const NotificationGroupWithStatus: React.FC<{
</div> </div>
)} )}
</div> </div>
</div>
</HotKeys> </HotKeys>
); );
}; };

View file

@ -10466,11 +10466,17 @@ noscript {
} }
.notification-group { .notification-group {
display: flex; display: grid;
align-items: flex-start; align-items: flex-start;
gap: 8px; gap: 8px;
padding: 16px 24px; padding: 16px 24px;
grid-template-columns: 40px 1fr;
grid-template-areas:
'icon header-wrapper'
'. header-label'
'. content';
border-bottom: 1px solid var(--background-border-color); border-bottom: 1px solid var(--background-border-color);
container-type: inline-size;
&__icon { &__icon {
width: 40px; width: 40px;
@ -10479,6 +10485,7 @@ noscript {
justify-content: center; justify-content: center;
flex: 0 0 auto; flex: 0 0 auto;
color: $dark-text-color; color: $dark-text-color;
grid-area: icon;
.icon { .icon {
width: 28px; width: 28px;
@ -10522,13 +10529,6 @@ noscript {
} }
&__main { &__main {
display: flex;
flex-direction: column;
gap: 8px;
flex: 1 1 auto;
overflow: hidden;
container-type: inline-size;
@container (width < 350px) { @container (width < 350px) {
&__header time { &__header time {
display: none; display: none;
@ -10536,13 +10536,10 @@ noscript {
} }
&__header { &__header {
display: flex;
flex-direction: column;
gap: 8px;
&__wrapper { &__wrapper {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
grid-area: header-wrapper;
} }
&__label { &__label {
@ -10551,6 +10548,7 @@ noscript {
font-size: 15px; font-size: 15px;
line-height: 22px; line-height: 22px;
color: $darker-text-color; color: $darker-text-color;
grid-area: header-label;
a { a {
color: inherit; color: inherit;
@ -10572,6 +10570,8 @@ noscript {
border: 1px solid var(--background-border-color); border: 1px solid var(--background-border-color);
border-radius: 8px; border-radius: 8px;
padding: 8px; padding: 8px;
grid-area: content;
overflow: hidden;
} }
&__additional-content { &__additional-content {