Skip to content

Commit

Permalink
feat: conversation screen POC
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Mar 27, 2024
1 parent 0077722 commit 6c325bd
Show file tree
Hide file tree
Showing 20 changed files with 991 additions and 26 deletions.
1 change: 1 addition & 0 deletions .storybook/storybook.requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const getStories = () => {
"./app/screens/authentication-screen/authentication-check-screen.stories.tsx": require("../app/screens/authentication-screen/authentication-check-screen.stories.tsx"),
"./app/screens/authentication-screen/authentication-screen.stories.tsx": require("../app/screens/authentication-screen/authentication-screen.stories.tsx"),
"./app/screens/authentication-screen/pin-screen.stories.tsx": require("../app/screens/authentication-screen/pin-screen.stories.tsx"),
"./app/screens/conversation/conversation.stories.tsx": require("../app/screens/conversation/conversation.stories.tsx"),
"./app/screens/conversion-flow/conversion-success-screen.stories.tsx": require("../app/screens/conversion-flow/conversion-success-screen.stories.tsx"),
"./app/screens/earns-map-screen/earns-map-screen.stories.tsx": require("../app/screens/earns-map-screen/earns-map-screen.stories.tsx"),
"./app/screens/earns-screen/earns-quiz.stories.tsx": require("../app/screens/earns-screen/earns-quiz.stories.tsx"),
Expand Down
4 changes: 2 additions & 2 deletions .storybook/storybook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import { NotificationsProvider } from "../app/components/notifications"
RNBootSplash.hide({ fade: true })

const StorybookUI = getStorybookUI({
enableWebsockets: true, // for @storybook/react-native-server
enableWebsockets: true,
onDeviceUI: true,
initialSelection: { kind: "Notification Card UI", name: "Default" },
initialSelection: { kind: "Conversation Screen", name: "Default" },
shouldPersistSelection: false,
})

Expand Down
15 changes: 15 additions & 0 deletions app/components/contact-modal/contact-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import ReactNativeModal from "react-native-modal"

import { CONTACT_EMAIL_ADDRESS, WHATSAPP_CONTACT_NUMBER } from "@app/config"
import { useI18nContext } from "@app/i18n/i18n-react"
import { RootStackParamList } from "@app/navigation/stack-param-lists"
import { openWhatsApp } from "@app/utils/external"
import { useNavigation } from "@react-navigation/native"
import { StackNavigationProp } from "@react-navigation/stack"
import { Icon, ListItem, makeStyles, useTheme } from "@rneui/themed"

import TelegramOutline from "./telegram.svg"
Expand All @@ -16,6 +19,7 @@ export const SupportChannels = {
StatusPage: "statusPage",
Mattermost: "mattermost",
Faq: "faq",
Chatbot: "chatbot",
} as const

export type SupportChannels = (typeof SupportChannels)[keyof typeof SupportChannels]
Expand Down Expand Up @@ -44,7 +48,18 @@ const ContactModal: React.FC<Props> = ({
theme: { colors },
} = useTheme()

const { navigate } = useNavigation<StackNavigationProp<RootStackParamList>>()

const contactOptionList = [
{
id: SupportChannels.Chatbot,
name: LL.support.chatbot(),
icon: <Icon name={"chatbubbles-outline"} type="ionicon" />,
action: () => {
navigate("chatbot")
toggleModal()
},
},
{
id: SupportChannels.StatusPage,
name: LL.support.statusPage(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const ContactSupportButton = ({
isVisible={showContactSupport}
toggleModal={() => setShowContactSupport(!showContactSupport)}
supportChannels={[
SupportChannels.Chatbot,
SupportChannels.Faq,
SupportChannels.StatusPage,
SupportChannels.Email,
Expand Down
31 changes: 31 additions & 0 deletions app/graphql/generated.gql
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,23 @@ mutation quizClaim($input: QuizClaimInput!) {
}
}

mutation supportChatMessageAdd($input: SupportChatMessageAddInput!) {
supportChatMessageAdd(input: $input) {
errors {
message
__typename
}
supportMessage {
id
message
role
timestamp
__typename
}
__typename
}
}

mutation userContactUpdateAlias($input: UserContactUpdateAliasInput!) {
userContactUpdateAlias(input: $input) {
errors {
Expand Down Expand Up @@ -1458,6 +1475,20 @@ query settingsScreen {
}
}

query supportChat {
me {
id
supportChat {
id
message
role
timestamp
__typename
}
__typename
}
}

query supportedCountries {
globals {
supportedCountries {
Expand Down
Loading

0 comments on commit 6c325bd

Please sign in to comment.