mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-21 11:20:17 -04:00
fix some warnings
This commit is contained in:
parent
efa076e6d5
commit
51a11f95af
|
@ -1,13 +1,12 @@
|
||||||
import { useState, useEffect } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { getGroups, getNotifications } from './api';
|
import { getGroups } from './api';
|
||||||
import { IGroup } from './Group';
|
import { IGroup } from './Group';
|
||||||
import { INotification } from './Notifications';
|
|
||||||
import GroupCreatorLink from './GroupCreatorLink';
|
import GroupCreatorLink from './GroupCreatorLink';
|
||||||
import GroupJoinerLink from './GroupJoinerLink';
|
import GroupJoinerLink from './GroupJoinerLink';
|
||||||
import GroupList from './GroupList';
|
import GroupList from './GroupList';
|
||||||
import Notifications from './Notifications';
|
import Notifications, { INotification } from './Notifications';
|
||||||
|
|
||||||
const dummyNotificationData: INotification[] = ([] = [
|
const dummyNotificationData: INotification[] = [
|
||||||
{
|
{
|
||||||
user: {
|
user: {
|
||||||
id: 0,
|
id: 0,
|
||||||
|
@ -32,10 +31,11 @@ const dummyNotificationData: INotification[] = ([] = [
|
||||||
isRequest: false,
|
isRequest: false,
|
||||||
sentTime: new Date(),
|
sentTime: new Date(),
|
||||||
},
|
},
|
||||||
]);
|
];
|
||||||
|
|
||||||
export default function Groups() {
|
export default function Groups() {
|
||||||
const [groups, setGroups] = useState<IGroup[]>([]);
|
const [groups, setGroups] = useState<IGroup[]>([]);
|
||||||
|
// eslint-disable-next-line
|
||||||
const [notifications, setNotifications] = useState(dummyNotificationData);
|
const [notifications, setNotifications] = useState(dummyNotificationData);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getGroups().then(setGroups);
|
getGroups().then(setGroups);
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default function Notification({
|
||||||
|
|
||||||
const rejectInv = useCallback(() => {
|
const rejectInv = useCallback(() => {
|
||||||
denyInvite(notification.user.id);
|
denyInvite(notification.user.id);
|
||||||
}, []);
|
}, [notification.user.id]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="notification">
|
<div className="notification">
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { userInfo } from 'node:os';
|
|
||||||
import Notification from './Notification';
|
import Notification from './Notification';
|
||||||
|
|
||||||
export type INotification = {
|
export type INotification = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user