-
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.
- Loading branch information
1 parent
4aa1cf5
commit 2a331cf
Showing
10 changed files
with
235 additions
and
132 deletions.
There are no files selected for viewing
21 changes: 14 additions & 7 deletions
21
src/components/message/UserAvatar.tsx → src/components/message/Avatar.tsx
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 |
---|---|---|
@@ -1,27 +1,34 @@ | ||
const UserAvatar = ({ user = { name: 'Anh Quoc' }, online = null, profile = false }: any) => { | ||
interface IProps { | ||
imageUrl: string | ||
online?: boolean | ||
profile?: boolean | ||
} | ||
|
||
const Avatar = (props: IProps) => { | ||
const { imageUrl, online, profile } = props | ||
const onlineClass = online === true ? 'online' : online === false ? 'offline' : '' | ||
|
||
const sizeClass = profile ? 'w-40' : 'w-8' | ||
const sizeClass = profile ? 'w-50' : 'w-10' | ||
|
||
return ( | ||
<> | ||
{user?.avatar_url && ( | ||
{imageUrl && ( | ||
<div className={`chat-image avatar ${onlineClass}`}> | ||
<div className={`rounded-full ${sizeClass}`}> | ||
<img src={user.avatar_url} /> | ||
<img src={imageUrl} /> | ||
</div> | ||
</div> | ||
)} | ||
|
||
{!user?.avatar_url && ( | ||
{!imageUrl && ( | ||
<div className={`chat-image avatar placeholder ${onlineClass}`}> | ||
<div className={`bg-gray-400 text-gray-800 rounded-full ${sizeClass}`}> | ||
<span className='text-xl'>{user.name.substring(0, 1)}</span> | ||
<span className='text-xl'>{'N'.substring(0, 1)}</span> | ||
</div> | ||
</div> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
export default UserAvatar | ||
export default Avatar |
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,81 @@ | ||
const conversation_events = [ | ||
{ | ||
avatarImageUrl: | ||
'https://images.pexels.com/photos/2747449/pexels-photo-2747449.jpeg?cs=srgb&dl=pexels-wolfgang-1002140-2747449.jpg&fm=jpg', | ||
name: 'Music With UIT', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Giá của sự kiện này đang cập nhập và chúng tôi sẽ đề cập lại sau' | ||
}, | ||
{ | ||
avatarImageUrl: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ52LuXfuyFjceKAdGai9o6PTeoQr5yiQxUtA&s', | ||
name: 'Music With UEH', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Sự kiện này tổ chức tại thành phố Hồ Chí Minh' | ||
}, | ||
{ | ||
avatarImageUrl: 'https://prankl-consulting.com/wp-content/uploads/2023/06/AdobeStock_119471366-1-1088x726.jpeg', | ||
name: 'Music In Live', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Giá của sự kiện này đang cập nhập và chúng tôi sẽ đề cập lại sau' | ||
}, | ||
{ | ||
avatarImageUrl: | ||
'https://img.freepik.com/free-vector/sport-text-banner-poster-design_1308-132612.jpg?semt=ais_hybrid', | ||
name: 'Sport In UIT', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Tại sao tôi không thấy giá của sự kiện này' | ||
}, | ||
{ | ||
avatarImageUrl: | ||
'https://www.electricireland.com/images/folder/homepage-spotlights/benefits-0.jpg?sfvrsn=bc86ba0d_2', | ||
name: 'Sport In UEH', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Sự kiện này tổ chức tại thành phố Hồ Chí Minh' | ||
}, | ||
{ | ||
avatarImageUrl: 'https://www.uit.edu.vn/sites/vi/files/uploads/images/thumbs/202011/khpm2.jpg', | ||
name: 'Sport In Live', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Sự kiện có hơn 3000 người tham dự' | ||
}, | ||
{ | ||
avatarImageUrl: | ||
'https://thesentry.com.vn/wp-content/uploads/2024/01/workshop-la-gi-7-buoc-to-chuc-workshop-hieu-qua-1.jpg', | ||
name: 'Workshop with UIT', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Sự kiện này tổ chức tại thành phố Hồ Chí Minh' | ||
}, | ||
{ | ||
avatarImageUrl: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRlctaT_Xg2OpWZRHXfP5k5KZrxVch4BCEG8A&s', | ||
name: 'Workshop with UEH', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Sự kiện này tổ chức tại thành phố Hồ Chí Minh' | ||
}, | ||
{ | ||
avatarImageUrl: | ||
'https://vietnamteachingjobs.com/wp-content/uploads/2023/03/loi-ich-cua-work-shop-la-gi-1-750x375.jpg', | ||
name: 'Workshop Technology', | ||
creatorName: 'Tran Phuoc Anh Quoc', | ||
creatorAvatar: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Sự kiện này tổ chức tại thành phố Hồ Chí Minh' | ||
} | ||
] | ||
|
||
export default conversation_events |
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,17 @@ | ||
const conversation_users = [ | ||
{ | ||
avatarImageUrl: 'https://res.cloudinary.com/dadvtny30/image/upload/v1710062870/portfolio/frj9fscqteb90eumokqj.jpg', | ||
name: 'Tran Phuoc Anh Quoc', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Bạn có phải là người đã đặt vé của tôi sáng nay' | ||
}, | ||
{ | ||
avatarImageUrl: | ||
'https://res.cloudinary.com/dadvtny30/image/upload/v1729096963/portfolio/user/mzrgkwrrdp2rvbmvceff.jpg', | ||
name: 'Tran Vuong Duy', | ||
last_message_date: '2023-09-01T00:00:00.000Z', | ||
last_message: 'Bạn có phải là người đã đặt vé của tôi sáng nay' | ||
} | ||
] | ||
|
||
export default conversation_users |
Oops, something went wrong.