chat 1.0.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-ACQNDPTB.js +356 -0
- package/dist/chunk-ACQNDPTB.js.map +1 -0
- package/dist/index.d.ts +1312 -0
- package/dist/index.js +1433 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-runtime-D7zHSnXe.d.ts +349 -0
- package/dist/jsx-runtime.d.ts +1 -0
- package/dist/jsx-runtime.js +17 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/package.json +61 -97
- package/lib/module/ChatContext/index.js +0 -2
- package/lib/module/ChatContext/index.js.map +0 -1
- package/lib/module/ChatContext/types.js +0 -2
- package/lib/module/ChatContext/types.js.map +0 -1
- package/lib/module/classes/Chat/index.js +0 -2
- package/lib/module/classes/Chat/index.js.map +0 -1
- package/lib/module/classes/Chat/types.js +0 -2
- package/lib/module/classes/Chat/types.js.map +0 -1
- package/lib/module/classes/Inbox/index.js +0 -2
- package/lib/module/classes/Inbox/index.js.map +0 -1
- package/lib/module/classes/Inbox/types.js +0 -2
- package/lib/module/classes/Inbox/types.js.map +0 -1
- package/lib/module/classes/Message/index.js +0 -2
- package/lib/module/classes/Message/index.js.map +0 -1
- package/lib/module/classes/Message/types.js +0 -2
- package/lib/module/classes/Message/types.js.map +0 -1
- package/lib/module/classes/Reaction/index.js +0 -2
- package/lib/module/classes/Reaction/index.js.map +0 -1
- package/lib/module/classes/Reaction/types.js +0 -2
- package/lib/module/classes/Reaction/types.js.map +0 -1
- package/lib/module/classes/Room/index.js +0 -2
- package/lib/module/classes/Room/index.js.map +0 -1
- package/lib/module/classes/Room/types.js +0 -2
- package/lib/module/classes/Room/types.js.map +0 -1
- package/lib/module/classes/index.js +0 -2
- package/lib/module/classes/index.js.map +0 -1
- package/lib/module/components/Avatar/index.js +0 -2
- package/lib/module/components/Avatar/index.js.map +0 -1
- package/lib/module/components/Chat/Bubble/index.js +0 -2
- package/lib/module/components/Chat/Bubble/index.js.map +0 -1
- package/lib/module/components/Chat/Composer/Input/index.js +0 -2
- package/lib/module/components/Chat/Composer/Input/index.js.map +0 -1
- package/lib/module/components/Chat/Composer/Send/index.js +0 -2
- package/lib/module/components/Chat/Composer/Send/index.js.map +0 -1
- package/lib/module/components/Chat/Composer/index.js +0 -2
- package/lib/module/components/Chat/Composer/index.js.map +0 -1
- package/lib/module/components/Chat/Media/Image/index.js +0 -2
- package/lib/module/components/Chat/Media/Image/index.js.map +0 -1
- package/lib/module/components/Chat/Media/index.js +0 -2
- package/lib/module/components/Chat/Media/index.js.map +0 -1
- package/lib/module/components/Chat/Message/Swiper/Action/index.js +0 -2
- package/lib/module/components/Chat/Message/Swiper/Action/index.js.map +0 -1
- package/lib/module/components/Chat/Message/Swiper/index.js +0 -2
- package/lib/module/components/Chat/Message/Swiper/index.js.map +0 -1
- package/lib/module/components/Chat/Message/Touchable/index.js +0 -2
- package/lib/module/components/Chat/Message/Touchable/index.js.map +0 -1
- package/lib/module/components/Chat/Message/index.js +0 -2
- package/lib/module/components/Chat/Message/index.js.map +0 -1
- package/lib/module/components/Chat/SystemMessage/index.js +0 -2
- package/lib/module/components/Chat/SystemMessage/index.js.map +0 -1
- package/lib/module/components/Chat/TypingFooter/index.js +0 -2
- package/lib/module/components/Chat/TypingFooter/index.js.map +0 -1
- package/lib/module/components/Chat/index.js +0 -2
- package/lib/module/components/Chat/index.js.map +0 -1
- package/lib/module/components/Chat/types.js +0 -2
- package/lib/module/components/Chat/types.js.map +0 -1
- package/lib/module/components/Chat-Old/Bubble/index.js +0 -2
- package/lib/module/components/Chat-Old/Bubble/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Composer/Input/index.js +0 -2
- package/lib/module/components/Chat-Old/Composer/Input/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Composer/Send/index.js +0 -2
- package/lib/module/components/Chat-Old/Composer/Send/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Composer/index.js +0 -2
- package/lib/module/components/Chat-Old/Composer/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Message/index.js +0 -2
- package/lib/module/components/Chat-Old/Message/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Swiper/Action/index.js +0 -2
- package/lib/module/components/Chat-Old/Swiper/Action/index.js.map +0 -1
- package/lib/module/components/Chat-Old/Swiper/index.js +0 -2
- package/lib/module/components/Chat-Old/Swiper/index.js.map +0 -1
- package/lib/module/components/Chat-Old/SystemMessage/index.js +0 -2
- package/lib/module/components/Chat-Old/SystemMessage/index.js.map +0 -1
- package/lib/module/components/Chat-Old/index.js +0 -2
- package/lib/module/components/Chat-Old/index.js.map +0 -1
- package/lib/module/components/Chat-Old/types.js +0 -2
- package/lib/module/components/Chat-Old/types.js.map +0 -1
- package/lib/module/components/ChatProvider/index.js +0 -2
- package/lib/module/components/ChatProvider/index.js.map +0 -1
- package/lib/module/components/ChatProvider/types.js +0 -2
- package/lib/module/components/ChatProvider/types.js.map +0 -1
- package/lib/module/components/Inbox/Item/Circle/index.js +0 -2
- package/lib/module/components/Inbox/Item/Circle/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Circle/types.js +0 -2
- package/lib/module/components/Inbox/Item/Circle/types.js.map +0 -1
- package/lib/module/components/Inbox/Item/Initials/index.js +0 -2
- package/lib/module/components/Inbox/Item/Initials/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/ItemDate/index.js +0 -2
- package/lib/module/components/Inbox/Item/ItemDate/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Separator/index.js +0 -2
- package/lib/module/components/Inbox/Item/Separator/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Subtitle/index.js +0 -2
- package/lib/module/components/Inbox/Item/Subtitle/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Swipeable/index.js +0 -2
- package/lib/module/components/Inbox/Item/Swipeable/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/Title/index.js +0 -2
- package/lib/module/components/Inbox/Item/Title/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/UnreadIndicator/index.js +0 -2
- package/lib/module/components/Inbox/Item/UnreadIndicator/index.js.map +0 -1
- package/lib/module/components/Inbox/Item/index.js +0 -2
- package/lib/module/components/Inbox/Item/index.js.map +0 -1
- package/lib/module/components/Inbox/index.js +0 -2
- package/lib/module/components/Inbox/index.js.map +0 -1
- package/lib/module/components/Inbox/question.md +0 -21
- package/lib/module/components/Inbox/readme.md +0 -21
- package/lib/module/components/Inbox/types.js +0 -2
- package/lib/module/components/Inbox/types.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Footer/Button/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Footer/Button/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Footer/Input/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Footer/Input/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Footer/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Footer/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Item/Icon/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Item/Icon/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/Item/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/Item/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Content/index.js +0 -2
- package/lib/module/components/RoomCreator/Content/index.js.map +0 -1
- package/lib/module/components/RoomCreator/Header/index.js +0 -2
- package/lib/module/components/RoomCreator/Header/index.js.map +0 -1
- package/lib/module/components/RoomCreator/index.js +0 -2
- package/lib/module/components/RoomCreator/index.js.map +0 -1
- package/lib/module/components/RoomCreator/types.js +0 -2
- package/lib/module/components/RoomCreator/types.js.map +0 -1
- package/lib/module/components/TypingIndicator/index.js +0 -2
- package/lib/module/components/TypingIndicator/index.js.map +0 -1
- package/lib/module/components/index.js +0 -2
- package/lib/module/components/index.js.map +0 -1
- package/lib/module/helpers/getInitials.js +0 -2
- package/lib/module/helpers/getInitials.js.map +0 -1
- package/lib/module/helpers/sortByAvatar.js +0 -2
- package/lib/module/helpers/sortByAvatar.js.map +0 -1
- package/lib/module/hooks/index.js +0 -2
- package/lib/module/hooks/index.js.map +0 -1
- package/lib/module/hooks/useCreateRoom/index.js +0 -2
- package/lib/module/hooks/useCreateRoom/index.js.map +0 -1
- package/lib/module/hooks/useCreator/index.js +0 -2
- package/lib/module/hooks/useCreator/index.js.map +0 -1
- package/lib/module/hooks/useInbox/index.js +0 -2
- package/lib/module/hooks/useInbox/index.js.map +0 -1
- package/lib/module/hooks/useInbox/types.js +0 -2
- package/lib/module/hooks/useInbox/types.js.map +0 -1
- package/lib/module/hooks/useMessages/index.js +0 -2
- package/lib/module/hooks/useMessages/index.js.map +0 -1
- package/lib/module/hooks/useMessages/types.js +0 -2
- package/lib/module/hooks/useMessages/types.js.map +0 -1
- package/lib/module/hooks/useRoom/index.js +0 -2
- package/lib/module/hooks/useRoom/index.js.map +0 -1
- package/lib/module/hooks/useRoom/types.js +0 -2
- package/lib/module/hooks/useRoom/types.js.map +0 -1
- package/lib/module/hooks/useSend/useSendToGroup/index.js +0 -2
- package/lib/module/hooks/useSend/useSendToGroup/index.js.map +0 -1
- package/lib/module/hooks/useSend/useSendToPeople/index.js +0 -2
- package/lib/module/hooks/useSend/useSendToPeople/index.js.map +0 -1
- package/lib/module/hooks/useTyping/index.js +0 -2
- package/lib/module/hooks/useTyping/index.js.map +0 -1
- package/lib/module/hooks/useTypingOLD/index.js +0 -2
- package/lib/module/hooks/useTypingOLD/index.js.map +0 -1
- package/lib/module/hooks/useTypingOLD/types.js +0 -2
- package/lib/module/hooks/useTypingOLD/types.js.map +0 -1
- package/lib/module/hooks/useViewMessages/index.js +0 -2
- package/lib/module/hooks/useViewMessages/index.js.map +0 -1
- package/lib/module/hooks/useViewMessages/types.js +0 -2
- package/lib/module/hooks/useViewMessages/types.js.map +0 -1
- package/lib/module/hooks/useViewMessagesOld/index.js +0 -2
- package/lib/module/hooks/useViewMessagesOld/index.js.map +0 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +0 -1
- package/lib/typescript/ChatContext/index.d.ts +0 -2
- package/lib/typescript/ChatContext/types.d.ts +0 -4
- package/lib/typescript/classes/Chat/index.d.ts +0 -14
- package/lib/typescript/classes/Chat/types.d.ts +0 -21
- package/lib/typescript/classes/Inbox/types.d.ts +0 -2
- package/lib/typescript/classes/Message/index.d.ts +0 -47
- package/lib/typescript/classes/Message/types.d.ts +0 -66
- package/lib/typescript/classes/Reaction/index.d.ts +0 -17
- package/lib/typescript/classes/Reaction/types.d.ts +0 -33
- package/lib/typescript/classes/Room/index.d.ts +0 -42
- package/lib/typescript/classes/Room/types.d.ts +0 -112
- package/lib/typescript/classes/index.d.ts +0 -4
- package/lib/typescript/components/Avatar/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Bubble/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Composer/Input/index.d.ts +0 -7
- package/lib/typescript/components/Chat/Composer/Send/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Composer/index.d.ts +0 -8
- package/lib/typescript/components/Chat/Media/Image/index.d.ts +0 -7
- package/lib/typescript/components/Chat/Media/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Message/Touchable/index.d.ts +0 -4
- package/lib/typescript/components/Chat/Message/index.d.ts +0 -8
- package/lib/typescript/components/Chat/SystemMessage/index.d.ts +0 -4
- package/lib/typescript/components/Chat/TypingFooter/index.d.ts +0 -4
- package/lib/typescript/components/Chat/index.d.ts +0 -8
- package/lib/typescript/components/Chat/types.d.ts +0 -843
- package/lib/typescript/components/ChatProvider/index.d.ts +0 -10
- package/lib/typescript/components/ChatProvider/types.d.ts +0 -7
- package/lib/typescript/components/Inbox/Item/Initials/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/Item/ItemDate/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/Item/Separator/index.d.ts +0 -6
- package/lib/typescript/components/Inbox/Item/Subtitle/index.d.ts +0 -3
- package/lib/typescript/components/Inbox/Item/Swipeable/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/Item/Title/index.d.ts +0 -3
- package/lib/typescript/components/Inbox/Item/UnreadIndicator/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/Item/index.d.ts +0 -6
- package/lib/typescript/components/Inbox/index.d.ts +0 -4
- package/lib/typescript/components/Inbox/types.d.ts +0 -304
- package/lib/typescript/components/RoomCreator/Content/Footer/Button/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Content/Footer/Input/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Content/Footer/index.d.ts +0 -3
- package/lib/typescript/components/RoomCreator/Content/Item/Icon/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Content/Item/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Content/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/Header/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/index.d.ts +0 -4
- package/lib/typescript/components/RoomCreator/types.d.ts +0 -208
- package/lib/typescript/components/TypingIndicator/index.d.ts +0 -9
- package/lib/typescript/components/index.d.ts +0 -12
- package/lib/typescript/helpers/getInitials.d.ts +0 -1
- package/lib/typescript/hooks/index.d.ts +0 -8
- package/lib/typescript/hooks/useCreator/index.d.ts +0 -27
- package/lib/typescript/hooks/useInbox/index.d.ts +0 -29
- package/lib/typescript/hooks/useInbox/types.d.ts +0 -5
- package/lib/typescript/hooks/useMessages/index.d.ts +0 -24
- package/lib/typescript/hooks/useMessages/types.d.ts +0 -5
- package/lib/typescript/hooks/useRoom/index.d.ts +0 -26
- package/lib/typescript/hooks/useRoom/types.d.ts +0 -5
- package/lib/typescript/hooks/useSend/useSendToGroup/index.d.ts +0 -6
- package/lib/typescript/hooks/useSend/useSendToPeople/index.d.ts +0 -6
- package/lib/typescript/hooks/useTyping/index.d.ts +0 -36
- package/lib/typescript/hooks/useViewMessages/index.d.ts +0 -18
- package/lib/typescript/hooks/useViewMessages/types.d.ts +0 -20
- package/lib/typescript/index.d.ts +0 -11
- package/readme.md +0 -201
- package/src/ChatContext/index.tsx +0 -9
- package/src/ChatContext/types.ts +0 -4
- package/src/classes/Chat/index.ts +0 -46
- package/src/classes/Chat/types.ts +0 -23
- package/src/classes/Inbox/index.ts +0 -12
- package/src/classes/Inbox/types.ts +0 -3
- package/src/classes/Message/index.ts +0 -310
- package/src/classes/Message/types.ts +0 -118
- package/src/classes/Reaction/index.ts +0 -108
- package/src/classes/Reaction/types.ts +0 -37
- package/src/classes/Room/index.ts +0 -323
- package/src/classes/Room/types.ts +0 -161
- package/src/classes/index.ts +0 -4
- package/src/components/Avatar/index.tsx +0 -25
- package/src/components/Chat/Bubble/index.tsx +0 -139
- package/src/components/Chat/Composer/Input/index.tsx +0 -45
- package/src/components/Chat/Composer/Send/index.tsx +0 -51
- package/src/components/Chat/Composer/index.tsx +0 -187
- package/src/components/Chat/Media/Image/index.tsx +0 -26
- package/src/components/Chat/Media/index.tsx +0 -11
- package/src/components/Chat/Message/Swiper/Action/index.tsx +0 -7
- package/src/components/Chat/Message/Swiper/index.tsx +0 -32
- package/src/components/Chat/Message/Touchable/index.tsx +0 -60
- package/src/components/Chat/Message/index.tsx +0 -328
- package/src/components/Chat/SystemMessage/index.tsx +0 -44
- package/src/components/Chat/TypingFooter/index.tsx +0 -48
- package/src/components/Chat/index.tsx +0 -596
- package/src/components/Chat/types.ts +0 -913
- package/src/components/Chat-Old/Bubble/index.tsx +0 -58
- package/src/components/Chat-Old/Composer/Input/index.tsx +0 -34
- package/src/components/Chat-Old/Composer/Send/index.tsx +0 -37
- package/src/components/Chat-Old/Composer/index.tsx +0 -131
- package/src/components/Chat-Old/Message/index.tsx +0 -160
- package/src/components/Chat-Old/Swiper/Action/index.tsx +0 -7
- package/src/components/Chat-Old/Swiper/index.tsx +0 -30
- package/src/components/Chat-Old/SystemMessage/index.tsx +0 -44
- package/src/components/Chat-Old/index.tsx +0 -356
- package/src/components/Chat-Old/types.ts +0 -752
- package/src/components/ChatProvider/index.tsx +0 -31
- package/src/components/ChatProvider/types.ts +0 -8
- package/src/components/Inbox/Item/Circle/index.tsx +0 -47
- package/src/components/Inbox/Item/Circle/types.ts +0 -8
- package/src/components/Inbox/Item/Initials/index.tsx +0 -41
- package/src/components/Inbox/Item/ItemDate/index.tsx +0 -26
- package/src/components/Inbox/Item/Separator/index.tsx +0 -13
- package/src/components/Inbox/Item/Subtitle/index.tsx +0 -23
- package/src/components/Inbox/Item/Swipeable/index.tsx +0 -143
- package/src/components/Inbox/Item/Title/index.tsx +0 -23
- package/src/components/Inbox/Item/UnreadIndicator/index.tsx +0 -84
- package/src/components/Inbox/Item/index.tsx +0 -307
- package/src/components/Inbox/index.tsx +0 -315
- package/src/components/Inbox/question.md +0 -21
- package/src/components/Inbox/readme.md +0 -21
- package/src/components/Inbox/types.ts +0 -371
- package/src/components/RoomCreator/Content/Footer/Button/index.tsx +0 -55
- package/src/components/RoomCreator/Content/Footer/Input/index.tsx +0 -27
- package/src/components/RoomCreator/Content/Footer/index.tsx +0 -72
- package/src/components/RoomCreator/Content/Item/Icon/index.tsx +0 -16
- package/src/components/RoomCreator/Content/Item/index.tsx +0 -87
- package/src/components/RoomCreator/Content/index.tsx +0 -75
- package/src/components/RoomCreator/Header/index.tsx +0 -74
- package/src/components/RoomCreator/index.tsx +0 -177
- package/src/components/RoomCreator/types.ts +0 -233
- package/src/components/TypingIndicator/index.tsx +0 -169
- package/src/components/index.ts +0 -18
- package/src/helpers/getInitials.ts +0 -11
- package/src/helpers/sortByAvatar.ts +0 -1
- package/src/hooks/index.ts +0 -8
- package/src/hooks/useCreateRoom/index.ts +0 -34
- package/src/hooks/useCreator/index.ts +0 -33
- package/src/hooks/useInbox/index.ts +0 -76
- package/src/hooks/useInbox/types.ts +0 -6
- package/src/hooks/useMessages/index.ts +0 -109
- package/src/hooks/useMessages/types.ts +0 -6
- package/src/hooks/useRoom/index.ts +0 -82
- package/src/hooks/useRoom/types.ts +0 -6
- package/src/hooks/useSend/useSendToGroup/index.ts +0 -38
- package/src/hooks/useSend/useSendToPeople/index.ts +0 -38
- package/src/hooks/useTyping/index.ts +0 -154
- package/src/hooks/useTypingOLD/index.ts +0 -67
- package/src/hooks/useTypingOLD/types.ts +0 -7
- package/src/hooks/useViewMessages/index.ts +0 -61
- package/src/hooks/useViewMessages/types.ts +0 -22
- package/src/hooks/useViewMessagesOld/index.ts +0 -39
- package/src/index.ts +0 -13
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React, { FunctionComponent } from 'react'
|
|
2
|
-
import { FuegoProvider, Fuego } from '@nandorojo/fuego'
|
|
3
|
-
import ChatContext from '../../ChatContext'
|
|
4
|
-
import { ChatProviderProps } from './types'
|
|
5
|
-
import Chat from '../../classes/Chat/index'
|
|
6
|
-
|
|
7
|
-
export let fuego: Fuego
|
|
8
|
-
export let chat: Chat
|
|
9
|
-
|
|
10
|
-
// useful for non-react projects that need to use this var too.
|
|
11
|
-
export const setFuego = (f: Fuego) => (fuego = f)
|
|
12
|
-
export const setChat = (c: Chat) => (chat = c)
|
|
13
|
-
|
|
14
|
-
const Provider: FunctionComponent<ChatProviderProps> = ({
|
|
15
|
-
children,
|
|
16
|
-
fuego: FuegoInstance,
|
|
17
|
-
chat: ChatInstance = new Chat({})
|
|
18
|
-
}) => {
|
|
19
|
-
setFuego(FuegoInstance)
|
|
20
|
-
setChat(ChatInstance)
|
|
21
|
-
// fuego = FuegoInstance
|
|
22
|
-
// chat = ChatInstance
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<FuegoProvider fuego={fuego}>
|
|
26
|
-
<ChatContext.Provider>{children}</ChatContext.Provider>
|
|
27
|
-
</FuegoProvider>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default Provider
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React, { FunctionComponent } from 'react'
|
|
2
|
-
import { CircleProps } from './types'
|
|
3
|
-
import { View, StyleSheet } from 'react-native'
|
|
4
|
-
|
|
5
|
-
const Circle: FunctionComponent<CircleProps> = props => {
|
|
6
|
-
const size = props.size
|
|
7
|
-
const height = props.height || size
|
|
8
|
-
const width = props.width || size
|
|
9
|
-
const borderWidth = props.borderWidth || 0
|
|
10
|
-
const borderRadius = props.borderRadius || size / 2
|
|
11
|
-
|
|
12
|
-
const innerSize = size - borderWidth * 2
|
|
13
|
-
const innerBorderRadius = innerSize / 2
|
|
14
|
-
return (
|
|
15
|
-
<View
|
|
16
|
-
style={[
|
|
17
|
-
styles.container,
|
|
18
|
-
{ height, width, borderRadius, backgroundColor: props.borderColor }
|
|
19
|
-
]}
|
|
20
|
-
>
|
|
21
|
-
<View
|
|
22
|
-
style={[
|
|
23
|
-
styles.wrapper,
|
|
24
|
-
{
|
|
25
|
-
height: innerSize,
|
|
26
|
-
width: innerSize,
|
|
27
|
-
borderRadius: innerBorderRadius
|
|
28
|
-
}
|
|
29
|
-
]}
|
|
30
|
-
>
|
|
31
|
-
{props.children}
|
|
32
|
-
</View>
|
|
33
|
-
</View>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default Circle
|
|
38
|
-
|
|
39
|
-
const styles = StyleSheet.create({
|
|
40
|
-
container: {
|
|
41
|
-
justifyContent: 'center',
|
|
42
|
-
alignItems: 'center'
|
|
43
|
-
},
|
|
44
|
-
wrapper: {
|
|
45
|
-
overflow: 'hidden'
|
|
46
|
-
}
|
|
47
|
-
})
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Text, StyleSheet, View } from 'react-native'
|
|
3
|
-
import { InitialsProps } from '../../types'
|
|
4
|
-
|
|
5
|
-
export default React.memo((props: InitialsProps) => {
|
|
6
|
-
const borderRadius = props.size / 2
|
|
7
|
-
const fontSize = props.size / 2.5
|
|
8
|
-
return (
|
|
9
|
-
<View
|
|
10
|
-
style={[
|
|
11
|
-
styles.container,
|
|
12
|
-
props.containerStyle ? props.containerStyle : {},
|
|
13
|
-
props.backgroundColor ? { backgroundColor: props.backgroundColor } : {},
|
|
14
|
-
{ borderRadius, height: props.size, width: props.size }
|
|
15
|
-
]}
|
|
16
|
-
>
|
|
17
|
-
<Text
|
|
18
|
-
style={[
|
|
19
|
-
styles.text,
|
|
20
|
-
{ fontSize },
|
|
21
|
-
props.textStyle ? props.textStyle : {},
|
|
22
|
-
props.textColor ? { color: props.textColor } : {}
|
|
23
|
-
]}
|
|
24
|
-
>
|
|
25
|
-
{props.initials.toUpperCase()}
|
|
26
|
-
</Text>
|
|
27
|
-
</View>
|
|
28
|
-
)
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
const styles = StyleSheet.create({
|
|
32
|
-
container: {
|
|
33
|
-
backgroundColor: 'lightblue',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'center'
|
|
36
|
-
},
|
|
37
|
-
text: {
|
|
38
|
-
color: 'white',
|
|
39
|
-
fontWeight: 'bold'
|
|
40
|
-
}
|
|
41
|
-
})
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Text, StyleSheet } from 'react-native'
|
|
3
|
-
import moment from 'moment'
|
|
4
|
-
import { DateProps } from '../../types'
|
|
5
|
-
|
|
6
|
-
export default (props: DateProps) => {
|
|
7
|
-
const text = props.dateToStringFunc
|
|
8
|
-
? props.dateToStringFunc(props.date)
|
|
9
|
-
: moment(props.date).calendar(undefined, {
|
|
10
|
-
lastDay: '[Yesterday]',
|
|
11
|
-
sameDay: 'LT',
|
|
12
|
-
nextDay: '[Tomorrow at] LT',
|
|
13
|
-
lastWeek: 'dddd',
|
|
14
|
-
nextWeek: '[Next] dddd',
|
|
15
|
-
sameElse: 'L'
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
return <Text style={[styles.text, props.style]}>{text}</Text>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const styles = StyleSheet.create({
|
|
22
|
-
text: {
|
|
23
|
-
color: 'gray',
|
|
24
|
-
paddingLeft: 5
|
|
25
|
-
}
|
|
26
|
-
})
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View } from 'react-native'
|
|
3
|
-
|
|
4
|
-
export default (props: { color?: string; size?: number }) => {
|
|
5
|
-
return (
|
|
6
|
-
<View
|
|
7
|
-
style={{
|
|
8
|
-
backgroundColor: props.color || 'lightgray',
|
|
9
|
-
height: props.size || 0.75
|
|
10
|
-
}}
|
|
11
|
-
/>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Text, StyleSheet } from 'react-native'
|
|
3
|
-
import { InboxItemSubtitleProps } from '../../types'
|
|
4
|
-
|
|
5
|
-
export default function(props: InboxItemSubtitleProps) {
|
|
6
|
-
const { lastMessageText, textStyle = {} } = props
|
|
7
|
-
return (
|
|
8
|
-
<Text
|
|
9
|
-
style={[styles.text, textStyle]}
|
|
10
|
-
numberOfLines={2}
|
|
11
|
-
ellipsizeMode={'tail'}
|
|
12
|
-
>
|
|
13
|
-
{lastMessageText}
|
|
14
|
-
</Text>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const styles = StyleSheet.create({
|
|
19
|
-
text: {
|
|
20
|
-
color: 'gray',
|
|
21
|
-
marginTop: 5
|
|
22
|
-
}
|
|
23
|
-
})
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import React, { FunctionComponent, useRef } from 'react'
|
|
2
|
-
import Swipes from 'react-native-gesture-handler/Swipeable'
|
|
3
|
-
import { Animated, Text, View, StyleSheet } from 'react-native'
|
|
4
|
-
import { SwipeableProps, SwipeableAction } from '../../types'
|
|
5
|
-
import { RectButton } from 'react-native-gesture-handler'
|
|
6
|
-
|
|
7
|
-
const Swipeable: FunctionComponent<SwipeableProps> = props => {
|
|
8
|
-
const actionItemWidth = props.actionWidth || 64
|
|
9
|
-
const swipeableRowRef = useRef<Swipes>(null)
|
|
10
|
-
|
|
11
|
-
function renderAction(
|
|
12
|
-
action: SwipeableAction,
|
|
13
|
-
index: number,
|
|
14
|
-
progress: Progress,
|
|
15
|
-
drag: Drag,
|
|
16
|
-
side: 'left' | 'right',
|
|
17
|
-
numberOfActions: number
|
|
18
|
-
) {
|
|
19
|
-
if (props.renderAction)
|
|
20
|
-
return props.renderAction(action, index, progress, drag, side)
|
|
21
|
-
if (props.renderAction === null) return null
|
|
22
|
-
|
|
23
|
-
const outputRange =
|
|
24
|
-
side === 'right'
|
|
25
|
-
? [(numberOfActions - index) * actionItemWidth, 0]
|
|
26
|
-
: [-index * actionItemWidth, 0]
|
|
27
|
-
|
|
28
|
-
const translateX = progress.interpolate({
|
|
29
|
-
inputRange: [0, 1],
|
|
30
|
-
outputRange
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
function onPress() {
|
|
34
|
-
if (swipeableRowRef.current) swipeableRowRef.current.close()
|
|
35
|
-
if (action.onPress) action.onPress(props.id)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<Animated.View
|
|
40
|
-
key={JSON.stringify(action + `${Math.random()}`)}
|
|
41
|
-
style={{ flex: 1, transform: [{ translateX }] }}
|
|
42
|
-
>
|
|
43
|
-
<RectButton
|
|
44
|
-
style={[styles.action, { backgroundColor: action.backgroundColor }]}
|
|
45
|
-
onPress={onPress}
|
|
46
|
-
>
|
|
47
|
-
{action.renderIcon && action.renderIcon(progress, drag)}
|
|
48
|
-
<Text
|
|
49
|
-
style={[
|
|
50
|
-
styles.actionText,
|
|
51
|
-
{ color: action.color },
|
|
52
|
-
props.textStyle
|
|
53
|
-
]}
|
|
54
|
-
>
|
|
55
|
-
{action.text}
|
|
56
|
-
</Text>
|
|
57
|
-
</RectButton>
|
|
58
|
-
</Animated.View>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
function renderRightActions(progress: Progress, drag: Drag) {
|
|
62
|
-
const actions =
|
|
63
|
-
props.rightActions ||
|
|
64
|
-
[
|
|
65
|
-
// {
|
|
66
|
-
// color: 'white',
|
|
67
|
-
// backgroundColor: 'purple',
|
|
68
|
-
// IconNode: null,
|
|
69
|
-
// text: 'Test'
|
|
70
|
-
// }
|
|
71
|
-
]
|
|
72
|
-
if (props.renderRightActions)
|
|
73
|
-
return props.renderRightActions(actions, progress, drag)
|
|
74
|
-
if (props.renderRightActions === null) return null
|
|
75
|
-
|
|
76
|
-
return renderActionList(actions, progress, drag, 'right')
|
|
77
|
-
}
|
|
78
|
-
function renderLeftActions(progress: Progress, drag: Drag) {
|
|
79
|
-
const actions =
|
|
80
|
-
props.leftActions ||
|
|
81
|
-
[
|
|
82
|
-
// {
|
|
83
|
-
// color: 'white',
|
|
84
|
-
// backgroundColor: 'blue',
|
|
85
|
-
// IconNode: null,
|
|
86
|
-
// text: 'Scripture monkey'
|
|
87
|
-
// }
|
|
88
|
-
]
|
|
89
|
-
if (props.renderLeftActions)
|
|
90
|
-
return props.renderLeftActions(actions, progress, drag)
|
|
91
|
-
if (props.renderLeftActions === null) return null
|
|
92
|
-
|
|
93
|
-
return renderActionList(actions, progress, drag, 'left')
|
|
94
|
-
}
|
|
95
|
-
function renderActionList(
|
|
96
|
-
actions: SwipeableAction[],
|
|
97
|
-
progress: Progress,
|
|
98
|
-
drag: Drag,
|
|
99
|
-
side: 'left' | 'right'
|
|
100
|
-
) {
|
|
101
|
-
return (
|
|
102
|
-
<View
|
|
103
|
-
style={[styles.actionList, { width: actionItemWidth * actions.length }]}
|
|
104
|
-
>
|
|
105
|
-
{actions.map((action, index) =>
|
|
106
|
-
renderAction(action, index, progress, drag, side, actions.length)
|
|
107
|
-
)}
|
|
108
|
-
</View>
|
|
109
|
-
)
|
|
110
|
-
}
|
|
111
|
-
return (
|
|
112
|
-
<Swipes
|
|
113
|
-
friction={2}
|
|
114
|
-
leftThreshold={30}
|
|
115
|
-
rightThreshold={40}
|
|
116
|
-
renderLeftActions={renderLeftActions}
|
|
117
|
-
renderRightActions={renderRightActions}
|
|
118
|
-
ref={swipeableRowRef}
|
|
119
|
-
{...(props.gestureHandlerProps || {})}
|
|
120
|
-
>
|
|
121
|
-
{props.children}
|
|
122
|
-
</Swipes>
|
|
123
|
-
)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export default React.memo(Swipeable)
|
|
127
|
-
|
|
128
|
-
type Progress = Animated.Value | Animated.AnimatedInterpolation
|
|
129
|
-
type Drag = Animated.AnimatedInterpolation
|
|
130
|
-
|
|
131
|
-
const styles = StyleSheet.create({
|
|
132
|
-
actionList: {
|
|
133
|
-
flexDirection: 'row'
|
|
134
|
-
},
|
|
135
|
-
action: {
|
|
136
|
-
alignItems: 'center',
|
|
137
|
-
justifyContent: 'center',
|
|
138
|
-
flex: 1
|
|
139
|
-
},
|
|
140
|
-
actionText: {
|
|
141
|
-
padding: 10
|
|
142
|
-
}
|
|
143
|
-
})
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Text, StyleSheet, View } from 'react-native'
|
|
3
|
-
import { InboxItemTitleProps } from '../../types'
|
|
4
|
-
|
|
5
|
-
export default function({ title, style, containerStyle }: InboxItemTitleProps) {
|
|
6
|
-
return (
|
|
7
|
-
<View style={[styles.container, containerStyle]}>
|
|
8
|
-
<Text numberOfLines={1} ellipsizeMode="tail" style={[styles.text, style]}>
|
|
9
|
-
{title}
|
|
10
|
-
</Text>
|
|
11
|
-
</View>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const styles = StyleSheet.create({
|
|
16
|
-
container: {
|
|
17
|
-
flex: 1
|
|
18
|
-
},
|
|
19
|
-
text: {
|
|
20
|
-
fontWeight: '600',
|
|
21
|
-
fontSize: 17
|
|
22
|
-
}
|
|
23
|
-
})
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Text, StyleSheet, ViewStyle } from 'react-native'
|
|
3
|
-
import { UnreadIndicatorProps } from '../../types'
|
|
4
|
-
import { LinearGradient } from 'expo-linear-gradient'
|
|
5
|
-
|
|
6
|
-
const Indicator = (props: UnreadIndicatorProps) => {
|
|
7
|
-
if (!props.show) return null
|
|
8
|
-
|
|
9
|
-
let size = props.size || (props.showCount ? 20 : 15)
|
|
10
|
-
|
|
11
|
-
// set vertical position
|
|
12
|
-
let justifyContent = 'center'
|
|
13
|
-
if (props.position === 'bottom') justifyContent = 'flex-end'
|
|
14
|
-
if (props.position === 'top') justifyContent = 'flex-start'
|
|
15
|
-
|
|
16
|
-
// determine width
|
|
17
|
-
const characterCount =
|
|
18
|
-
(props.unreadCount && props.unreadCount.toString().length) || 1
|
|
19
|
-
|
|
20
|
-
let width = size
|
|
21
|
-
if (props.showCount && characterCount === 2) width = size * 1.1
|
|
22
|
-
else if (props.showCount && characterCount === 3) width = size * 1.5
|
|
23
|
-
|
|
24
|
-
// indicator should be invisible if the count is 0, no?
|
|
25
|
-
const opacity = props.unreadCount ? 1 : 0
|
|
26
|
-
|
|
27
|
-
// if it's a gradient, set the gradient as the component
|
|
28
|
-
const BackgroundComponent = props.type === 'gradient' ? LinearGradient : View
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<View
|
|
32
|
-
style={[
|
|
33
|
-
styles.container,
|
|
34
|
-
{
|
|
35
|
-
justifyContent,
|
|
36
|
-
width: props.showCount ? size * 1.5 : size,
|
|
37
|
-
opacity
|
|
38
|
-
} as ViewStyle
|
|
39
|
-
]}
|
|
40
|
-
>
|
|
41
|
-
<BackgroundComponent
|
|
42
|
-
style={[
|
|
43
|
-
styles.background,
|
|
44
|
-
{
|
|
45
|
-
backgroundColor: props.backgroundColor,
|
|
46
|
-
width,
|
|
47
|
-
height: size,
|
|
48
|
-
borderRadius: size / 2
|
|
49
|
-
},
|
|
50
|
-
props.backgroundStyle || {}
|
|
51
|
-
]}
|
|
52
|
-
{...(props.gradientProps || {
|
|
53
|
-
colors: ['red', 'blue']
|
|
54
|
-
})}
|
|
55
|
-
>
|
|
56
|
-
<Text
|
|
57
|
-
style={[
|
|
58
|
-
styles.text,
|
|
59
|
-
props.textStyle || {},
|
|
60
|
-
props.textColor ? { color: props.textColor } : {}
|
|
61
|
-
]}
|
|
62
|
-
>
|
|
63
|
-
{!!props.showCount && (props.unreadCount || '')}
|
|
64
|
-
</Text>
|
|
65
|
-
</BackgroundComponent>
|
|
66
|
-
</View>
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
const styles = StyleSheet.create({
|
|
70
|
-
container: {
|
|
71
|
-
alignItems: 'center'
|
|
72
|
-
},
|
|
73
|
-
background: {
|
|
74
|
-
overflow: 'hidden',
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
justifyContent: 'center',
|
|
77
|
-
backgroundColor: 'blue'
|
|
78
|
-
},
|
|
79
|
-
text: {
|
|
80
|
-
color: 'white'
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
export default React.memo(Indicator)
|