Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-J 16
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-J 16
22_23-J 16
Commits
af3cd13e
Commit
af3cd13e
authored
May 10, 2023
by
Ishini Kiridena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main view and sample hamburger
parent
d3f70110
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
1 deletion
+126
-1
emma-frontend/App.js
emma-frontend/App.js
+5
-0
emma-frontend/components/patientscreens/patientMainChatView.js
...frontend/components/patientscreens/patientMainChatView.js
+68
-0
emma-frontend/components/patientscreens/registration/regEight.js
...ontend/components/patientscreens/registration/regEight.js
+7
-1
emma-frontend/components/shared/menuContainers.js
emma-frontend/components/shared/menuContainers.js
+46
-0
No files found.
emma-frontend/App.js
View file @
af3cd13e
...
...
@@ -15,6 +15,7 @@ import PatientRegSix from "./components/patientscreens/registration/regSix";
import
PatientRegSeven
from
"
./components/patientscreens/registration/regSeven
"
;
import
PatientRegEight
from
"
./components/patientscreens/registration/regEight
"
;
import
PatientConsentForm
from
"
./components/patientscreens/consent
"
;
import
PatientMainChatView
from
"
./components/patientscreens/patientMainChatView
"
;
const
Stack
=
createStackNavigator
();
...
...
@@ -96,6 +97,10 @@ export default function App() {
component
=
{
PatientConsentForm
}
options
=
{{
headerShown
:
false
}}
/
>
<
Stack
.
Screen
name
=
"
PatientMainChatView
"
component
=
{
PatientMainChatView
}
/
>
<
/Stack.Navigator
>
)
:
(
<
SplashScreenComponent
/>
...
...
emma-frontend/components/patientscreens/patientMainChatView.js
0 → 100644
View file @
af3cd13e
import
React
,
{
useState
}
from
"
react
"
;
import
{
View
,
TextInput
,
TouchableOpacity
,
Text
}
from
"
react-native
"
;
import
{
Ionicons
}
from
"
@expo/vector-icons
"
;
export
default
function
PatientMainChatView
({
navigation
,
route
})
{
const
[
message
,
setMessage
]
=
useState
(
""
);
const
[
chatMessages
,
setChatMessages
]
=
useState
([]);
const
sendMessage
=
()
=>
{
if
(
message
.
trim
()
===
""
)
{
return
;
// Don't send empty messages
}
const
newMessage
=
{
id
:
chatMessages
.
length
+
1
,
text
:
message
,
sender
:
"
Me
"
,
timestamp
:
new
Date
().
toISOString
(),
};
setChatMessages
([...
chatMessages
,
newMessage
]);
setMessage
(
""
);
};
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
alignItems
:
"
center
"
,
padding
:
10
}}
>
<
TouchableOpacity
onPress
=
{()
=>
navigation
.
openDrawer
()}
>
<
Ionicons
name
=
"
menu-outline
"
size
=
{
24
}
color
=
"
black
"
/>
<
/TouchableOpacity
>
<
Text
style
=
{{
fontSize
:
20
,
marginLeft
:
10
}}
>
Chat
<
/Text
>
<
/View
>
{
/* Chat messages */
}
<
View
style
=
{{
flex
:
1
,
padding
:
10
}}
>
{
chatMessages
.
map
((
msg
)
=>
(
<
View
key
=
{
msg
.
id
}
style
=
{{
marginBottom
:
10
,
alignSelf
:
msg
.
sender
===
"
Me
"
?
"
flex-end
"
:
"
flex-start
"
,
}}
>
<
Text
>
{
msg
.
text
}
<
/Text
>
<
/View
>
))}
<
/View
>
{
/* Message input and send button */
}
<
View
style
=
{{
flexDirection
:
"
row
"
,
alignItems
:
"
center
"
,
padding
:
10
}}
>
<
TextInput
style
=
{{
flex
:
1
,
borderWidth
:
1
,
borderColor
:
"
gray
"
,
borderRadius
:
10
,
paddingHorizontal
:
10
,
}}
placeholder
=
"
Type your message...
"
value
=
{
message
}
onChangeText
=
{(
text
)
=>
setMessage
(
text
)}
/
>
<
TouchableOpacity
onPress
=
{
sendMessage
}
style
=
{{
marginLeft
:
10
}}
>
<
Ionicons
name
=
"
send
"
size
=
{
24
}
color
=
"
blue
"
/>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
);
}
emma-frontend/components/patientscreens/registration/regEight.js
View file @
af3cd13e
...
...
@@ -146,7 +146,13 @@ export default function PatientRegEight({ navigation, route }) {
);
},
},
{
text
:
"
Close
"
,
style
:
"
cancel
"
},
{
text
:
"
Close
"
,
style
:
"
cancel
"
,
onPress
:
()
=>
{
navigation
.
navigate
(
"
PatientMainChatView
"
);
},
},
]);
//on close send to main UI
}
catch
(
errorWhenStoringInAsyncStorage
)
{
...
...
emma-frontend/components/shared/menuContainers.js
0 → 100644
View file @
af3cd13e
import
{
createAppContainer
}
from
"
react-navigation
"
;
import
{
createStackNavigator
}
from
"
react-navigation-stack
"
;
import
{
createDrawerNavigator
}
from
"
react-navigation-drawer
"
;
// Create a Drawer Navigator for the first hamburger menu component
const
DrawerNavigatorPatient
=
createDrawerNavigator
(
{
Home
:
HomeScreen
,
Profile
:
ProfileScreen
,
},
{
initialRouteName
:
"
Home
"
,
contentOptions
:
{
// Customization options for the drawer content
},
}
);
// Create a Drawer Navigator for the second hamburger menu component
const
DrawerNavigatorPractitioner
=
createDrawerNavigator
(
{
Home
:
HomeScreen
,
Settings
:
SettingsScreen
,
},
{
initialRouteName
:
"
Home
"
,
contentOptions
:
{
// Customization options for the drawer content
},
}
);
// Create separate stacks for each hamburger menu component
const
StackNavigatorPatient
=
createStackNavigator
({
Drawer1
:
{
screen
:
DrawerNavigatorPatient
},
});
const
StackNavigatorPractitioner
=
createStackNavigator
({
Drawer2
:
{
screen
:
DrawerNavigatorPractitioner
},
});
// Create the app containers for each hamburger menu component
const
AppContainerPatient
=
createAppContainer
(
StackNavigatorPatient
);
const
AppContainerPractitioner
=
createAppContainer
(
StackNavigatorPractitioner
);
export
{
AppContainerPatient
,
AppContainerPractitioner
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment