Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Jun 13, 2023
1 parent 6c88cbc commit ef996bc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
15 changes: 14 additions & 1 deletion res/css/views/settings/_Notifications2.pcss
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
.mx_Notifications2 {
.mx_Notifications2_banner {
margin-bottom: 32px;
}

.mx_SettingsSection_subSections {
color: #17191c;
gap: 32px;
display: flex;
flex-direction: column;
}

.mx_SettingsSubsection_description {
margin-bottom: 20px;
}

.mx_SettingsFlag {
margin-bottom: -2px;
margin-top: -2px;
}

.mx_Notifications2_banner {
background: #f4f8ff;
line-height: 2.25rem;
Expand Down Expand Up @@ -40,7 +53,7 @@
font-size: 1.2rem;

.mx_NotificationBadge {
vertical-align: bottom;
vertical-align: baseline;
display: inline-flex;
margin: 0 2px;
}
Expand Down
26 changes: 15 additions & 11 deletions src/components/views/settings/Notifications2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export default function Notifications2(): JSX.Element {
[cli, pushers, refreshPushers, refreshThreepids],
);

const notificationTargets = pushers.filter((it) => it.kind !== "email");

return (
<div className="mx_Notifications2">
{hasPendingChanges && (
Expand Down Expand Up @@ -425,17 +427,19 @@ export default function Notifications2(): JSX.Element {
))}
</SettingsIndent>
</SettingsSubsection>
<SettingsSubsection heading={_t("Notification targets")}>
<ul>
{pushers
.filter((it) => it.kind !== "email")
.map((pusher) => (
<li key={pusher.pushkey}>
{pusher.device_display_name || `${pusher.app_id} on ${pusher.profile_tag}`}
</li>
))}
</ul>
</SettingsSubsection>
{notificationTargets.length > 0 && (
<SettingsSubsection heading={_t("Notification targets")}>
<ul>
{pushers
.filter((it) => it.kind !== "email")
.map((pusher) => (
<li key={pusher.pushkey}>
{pusher.device_display_name || `${pusher.app_id} on ${pusher.profile_tag}`}
</li>
))}
</ul>
</SettingsSubsection>
)}
<SettingsSubsection heading={_t("Quick Actions")}>
<AccessibleButton
kind="primary_outline"
Expand Down
2 changes: 2 additions & 0 deletions src/models/notificationsettings/NotificationSettingsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export type NotificationSettingsModel = {
};
};

// TODO: Use highest action for parsing

export function fromRules(
rules: Map<RuleId, StandardPushRule>,
content: IAnnotatedPushRule[],
Expand Down

0 comments on commit ef996bc

Please sign in to comment.