Skip to content

Commit

Permalink
fix(ui): fix review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Vu Van Duc authored and Vu Van Duc committed Jul 15, 2024
1 parent 5277431 commit 501f052
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/ui/pages/Notifications/Notifications.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
--border-radius: 0.5rem;
color: var(--ion-color-primary);
width: calc(100vw - 2.5rem);
margin: 0.75rem auto 0;
margin: 0.75rem auto 2.25rem;
display: block;

&::part(native) {
Expand Down
56 changes: 16 additions & 40 deletions src/ui/pages/Notifications/Notifications.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
import { IonChip, IonList, useIonViewWillEnter } from "@ionic/react";
import { useEffect, useMemo, useRef, useState } from "react";
import {
IonButton,
IonChip,
IonIcon,
IonList,
useIonViewWillEnter,
} from "@ionic/react";
import { settingsOutline } from "ionicons/icons";
import { useHistory } from "react-router-dom";
import { TabLayout } from "../../components/layout/TabLayout";
import { useAppDispatch, useAppSelector } from "../../../store/hooks";
import { Agent } from "../../../core/agent/agent";
import {
getStateCache,
setCurrentRoute,
} from "../../../store/reducers/stateCache";
import { TabsRoutePath } from "../../../routes/paths";
import "./Notifications.scss";
KeriaNotification,
NotificationRoute,
} from "../../../core/agent/agent.types";
import { i18n } from "../../../i18n";
import { timeDifference } from "../../utils/formatters";
import { getNextRoute } from "../../../routes/nextRoute";
import { DataProps } from "../../../routes/nextRoute/nextRoute.types";
import { TabsRoutePath } from "../../../routes/paths";
import { useAppDispatch, useAppSelector } from "../../../store/hooks";
import {
getNotificationsCache,
setReadedNotification,
} from "../../../store/reducers/notificationsCache";
import { NotificationItem } from "./NotificationItem";
import {
KeriaNotification,
NotificationRoute,
} from "../../../core/agent/agent.types";
import { DataProps } from "../../../routes/nextRoute/nextRoute.types";
import { getNextRoute } from "../../../routes/nextRoute";
getStateCache,
setCurrentRoute,
} from "../../../store/reducers/stateCache";
import { updateReduxState } from "../../../store/utils";
import { TabLayout } from "../../components/layout/TabLayout";
import { timeDifference } from "../../utils/formatters";
import { FilterChipProps, NotificationFilter } from "./Notification.types";
import { NotificationItem } from "./NotificationItem";
import "./Notifications.scss";
import { EarlierNotification } from "./components";
import { EarlierNotificationRef } from "./components/EarlierNotification.types";
import { NotificationOptionsModal } from "./components/NotificationOptionsModal";
import { Agent } from "../../../core/agent/agent";

const Chip = ({ filter, label, isActive, onClick }: FilterChipProps) => (
<span>
Expand Down Expand Up @@ -98,22 +91,6 @@ const Notifications = () => {
dispatch(setCurrentRoute({ path: TabsRoutePath.NOTIFICATIONS }));
});

const AdditionalButtons = () => {
return (
<IonButton
shape="round"
className="notifications-settings-button"
data-testid="notifications-settings-button"
>
<IonIcon
slot="icon-only"
icon={settingsOutline}
color="primary"
/>
</IonButton>
);
};

const maskAsReaded = async (notification: KeriaNotification) => {
if (notification.read) return;

Expand Down Expand Up @@ -182,7 +159,6 @@ const Notifications = () => {
pageId={pageId}
header={true}
title={`${i18n.t("notifications.tab.header")}`}
additionalButtons={<AdditionalButtons />}
>
<div className="notifications-tab-chips">
{filterOptions.map((option) => (
Expand Down

0 comments on commit 501f052

Please sign in to comment.