-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from BacPacNet/userProfile-connection
User profile connection
- Loading branch information
Showing
18 changed files
with
551 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import { Skeleton } from '../ui/Skeleton' | ||
const UserListItemSkeleton = () => { | ||
return ( | ||
<div className=" rounded-lg "> | ||
<div className="my-2 ml-2 flex gap-8 items-center "> | ||
<Skeleton className=" bg-slate-400 p-2 h-14 w-14 rounded-full" /> | ||
<div> | ||
<Skeleton className="bg-slate-300 h-4 w-40" /> | ||
<Skeleton className="mt-1 bg-slate-300 h-3 w-20" /> | ||
<Skeleton className="mt-1 bg-slate-300 h-3 w-16" /> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default UserListItemSkeleton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react' | ||
import { useUpdateIsSeenCommunityGroupNotification } from '@/services/notification' | ||
import dayjs from 'dayjs' | ||
import relativeTime from 'dayjs/plugin/relativeTime' | ||
|
||
dayjs.extend(relativeTime) | ||
|
||
type Props = { | ||
id: string | ||
senderName: string | ||
message: string | ||
createdAt: string | ||
} | ||
|
||
const UserFollowNotification = ({ id, senderName, message, createdAt }: Props) => { | ||
const { mutate: updateIsSeen } = useUpdateIsSeenCommunityGroupNotification() | ||
|
||
const handleIsSeenGroup = (id: string) => { | ||
const dataToPush = { | ||
id: id, | ||
} | ||
updateIsSeen(dataToPush) | ||
} | ||
return ( | ||
<div key={id} className="bg-slate-50 p-2 border-b border-slate-300"> | ||
<p className="text-xs"> | ||
<span className="text-sm font-bold">{senderName}</span> {message} | ||
</p> | ||
<div className="flex gap-2 justify-between items-end"> | ||
<p className="text-xs">{dayjs(new Date(createdAt).toString()).fromNow()}</p> | ||
<button onClick={() => handleIsSeenGroup(id)} className="bg-slate-200 py-2 px-3 font-bold"> | ||
Seen | ||
</button> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default UserFollowNotification |
Oops, something went wrong.