-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
making chat component and fix style issues relate to issue #7 #29
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
949dd37
making chat component and fix style issues relate to issue #7
ishak52 cad3434
updating to the master last version
ishak52 57bc86d
fix files places
ishak52 09380f8
dont know what happend
ishak52 1dfb6fb
making chat component and fix style issues relate to issue #7
ishak52 9aa31bf
resolved conflictes with branch master
ishak52 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.AppRoutes { | ||
text-align: center; | ||
position: relative; | ||
min-height: 667px; | ||
|
||
} | ||
|
||
#root { | ||
font-family: arial; | ||
/* margin: 0 auto; */ | ||
max-width: 375px; | ||
min-height: 600px; | ||
background-color:#EEEEEE; | ||
|
||
/* padding-bottom: 0px; */ | ||
} |
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,45 @@ | ||
/* eslint-disable react/jsx-filename-extension */ | ||
import React from 'react'; | ||
import { BrowserRouter, Route, Switch } from 'react-router-dom'; | ||
import {BrowserRouter, Route, Switch} from 'react-router-dom' | ||
|
||
import './AppRoutes.css'; | ||
import './style/style.css'; | ||
|
||
import Login from './components/Login/Login'; | ||
import Header from './components/Header'; | ||
import Chats from './components/Chats/Chats'; | ||
import Carers from './components/Carers/Carers'; | ||
import signUp from './components/singup/singup'; | ||
import Profile from './components/Profile/Profile'; | ||
import Diaries from './components/MyDiary/MyDiary'; | ||
import Discussion from './components/Discussions/Discussions'; | ||
import Connection from './components/Connections/Connections'; | ||
import './style/style.css'; | ||
|
||
import MyBook from './components/MyCarePlan/MyCarePlan'; | ||
import signUp from './components/singup/singup'; | ||
import Error from "./components/Error"; | ||
import NavElements from './components/Navbar/NavElement' | ||
|
||
const AppRoutes = () => ( | ||
|
||
<div className="AppRoutes"> | ||
<BrowserRouter> | ||
|
||
<Switch> | ||
<Route path="/" component={Carers} exact /> | ||
<Route path="/login" component={Login} /> | ||
<Route path="/carers" component={Carers} /> | ||
<Route path="/signUp" component={signUp} /> | ||
<Route path="/MyFriends" component={Connection} /> | ||
</Switch> | ||
|
||
</BrowserRouter> | ||
<div> | ||
<Header connectReq={['adsfa','sdfg']}/> | ||
<Switch> | ||
<Route path="/" component={Carers} exact /> | ||
<Route path="/login" component={Login} /> | ||
<Route path="/carers" component={Carers} /> | ||
<Route path="/profile" component={Profile} /> | ||
<Route path="/diaries" component={Diaries} /> | ||
<Route path="/discussion" component={Discussion} /> | ||
<Route path="/connection" component={Connection} /> | ||
<Route path="/mybook" component={MyBook} /> | ||
<Route path="/chats" component={Chats} /> | ||
<Route path="/signUp" component={signUp} /> | ||
<Route path="/MyFriends" component={Connection} /> | ||
<Route component={Error} /> | ||
</Switch> | ||
<NavElements /> | ||
</div> | ||
</BrowserRouter> | ||
</div> | ||
); | ||
|
||
|
||
export default AppRoutes; |
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,75 @@ | ||
import React, { Component } from 'react'; | ||
import FontAwesome from 'react-fontawesome'; | ||
|
||
import './styles.css'; | ||
|
||
class Chats extends React.PureComponent { | ||
|
||
state = { | ||
chat: ['hello', 'hi!', 'do you want to chat?'] | ||
} | ||
|
||
saveMsg = (msg) => this.setState({ | ||
chat: [ | ||
...this.state.chat, | ||
msg | ||
] | ||
}) | ||
|
||
render() { | ||
return ( | ||
<section className="chat"> | ||
<div> | ||
<header className="is-link is-bold"> | ||
<h1> Chat Page </h1> | ||
</header> | ||
</div> | ||
<section className="chat section"> | ||
<div className="chats-body"> | ||
<Messages chat={this.state.chat} /> | ||
</div> | ||
</section> | ||
<div> | ||
<footer className="is-small"> | ||
<Chat saveMsg={this.saveMsg} /> | ||
</footer> | ||
</div> | ||
</section> | ||
) | ||
} | ||
} | ||
|
||
const Chat = ({ saveMsg }) => ( | ||
<form className="messageFiled" onSubmit={(e) => { | ||
e.preventDefault(); | ||
saveMsg(e.target.elements.userInput.value); | ||
e.target.reset(); | ||
}}> | ||
<div className="field has-addons"> | ||
<div className="control is-expanded"> | ||
<input className="input" name="userInput" type="text" placeholder="Type your message" /> | ||
</div> | ||
<div className="control"> | ||
<button className="button is-info"> | ||
<FontAwesome name='send' /> Send | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
); | ||
|
||
const Messages = ({ chat }) => ( | ||
<div style={{ heigth: '100%', width: '100%' }}> | ||
{chat.map((m, i) => { | ||
const msgClass = i === 0 || i % 2 === 0 // for demo purposes, format every other msg | ||
return ( | ||
<p style={{ padding: '.25em', textAlign: msgClass ? 'left' : 'right', overflowWrap: 'normal' }}> | ||
<span key={i} className={`tag is-medium ${msgClass ? 'is-success' : 'is-info'}`}>{m}</span> | ||
</p> | ||
)} | ||
)} | ||
</div> | ||
); | ||
|
||
export default Chats; |
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,195 @@ | ||
.chat{ | ||
padding: 3rem 1.5rem; | ||
box-sizing: inherit; | ||
font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", | ||
"Arial", sans-serif; | ||
width: 302px; | ||
text-align: center; | ||
padding-left: 10px; | ||
} | ||
|
||
.chat h1{ | ||
color: #48a1af; | ||
margin-left: 60px; | ||
} | ||
|
||
.chat p{ | ||
padding: 0.25em; | ||
text-align: left; | ||
overflow-wrap: normal; | ||
} | ||
|
||
.tag:not(body).is-medium { | ||
font-size: 16px; | ||
} | ||
|
||
.tag:not(body).is-success { | ||
background-color: #23d160; | ||
color: #fff; | ||
} | ||
|
||
.tag:not(body) { | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
background-color: whitesmoke; | ||
border-radius: 3px; | ||
color: #4a4a4a; | ||
display: -webkit-inline-box; | ||
display: -ms-inline-flexbox; | ||
display: inline-flex; | ||
font-size: 0.75rem; | ||
height: 2em; | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
justify-content: center; | ||
line-height: 1.5; | ||
padding-left: 0.75em; | ||
padding-right: 0.75em; | ||
white-space: nowrap; | ||
} | ||
|
||
.chat span { | ||
font-style: inherit; | ||
font-weight: inherit; | ||
} | ||
|
||
.tag:not(body).is-info { | ||
background-color: #209cee; | ||
color: #fff; | ||
} | ||
|
||
.field.has-addons .control:first-child .input, .field.has-addons .control:first-child .select select { | ||
border-bottom-right-radius: 0; | ||
border-top-right-radius: 0; | ||
} | ||
|
||
.input, .textarea { | ||
-moz-appearance: none; | ||
-webkit-appearance: none; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
border: 1px solid transparent; | ||
border-radius: 3px; | ||
-webkit-box-shadow: none; | ||
box-shadow: none; | ||
display: -webkit-inline-box; | ||
display: -ms-inline-flexbox; | ||
display: inline-flex; | ||
font-size: 1rem; | ||
height: 2.25em; | ||
-webkit-box-pack: start; | ||
-ms-flex-pack: start; | ||
justify-content: flex-start; | ||
line-height: 1.5; | ||
padding-bottom: calc(0.375em - 1px); | ||
padding-left: calc(0.625em - 1px); | ||
padding-right: calc(0.625em - 1px); | ||
padding-top: calc(0.375em - 1px); | ||
position: relative; | ||
vertical-align: top; | ||
background-color: white; | ||
border-color: #dbdbdb; | ||
color: #363636; | ||
-webkit-box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); | ||
box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1); | ||
max-width: 100%; | ||
width: 100%; | ||
} | ||
|
||
.chat input, select, textarea { | ||
font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif; | ||
margin: 0; | ||
margin-left: 23px; | ||
} | ||
|
||
.button.is-info { | ||
background-color: #209cee; | ||
border-color: transparent; | ||
color: #fff; | ||
height: 45px; | ||
width: 72px; | ||
font-size: 17px; | ||
} | ||
|
||
.button { | ||
-moz-appearance: none; | ||
-webkit-appearance: none; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
border: 1px solid transparent; | ||
border-radius: 3px; | ||
-webkit-box-shadow: none; | ||
box-shadow: none; | ||
display: -webkit-inline-box; | ||
display: -ms-inline-flexbox; | ||
display: inline-flex; | ||
font-size: 1rem; | ||
height: 2.25em; | ||
-webkit-box-pack: start; | ||
-ms-flex-pack: start; | ||
justify-content: flex-start; | ||
line-height: 1.5; | ||
padding-bottom: calc(0.375em - 1px); | ||
padding-left: calc(0.625em - 1px); | ||
padding-right: calc(0.625em - 1px); | ||
padding-top: calc(0.375em - 1px); | ||
position: relative; | ||
vertical-align: top; | ||
-webkit-touch-callout: none; | ||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
background-color: white; | ||
border-color: #dbdbdb; | ||
color: #363636; | ||
cursor: pointer; | ||
-webkit-box-pack: center; | ||
-ms-flex-pack: center; | ||
justify-content: center; | ||
padding-left: 0.75em; | ||
padding-right: 0.75em; | ||
text-align: center; | ||
white-space: nowrap; | ||
} | ||
|
||
.chat button{ | ||
font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif; | ||
} | ||
|
||
.chat footer{ | ||
display: block; | ||
} | ||
|
||
.chat input{ | ||
height: 45px; | ||
font-size: 17px; | ||
} | ||
|
||
.field { | ||
width: 328px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content:center; | ||
} | ||
|
||
.messageFiled{ | ||
position: absolute; | ||
bottom: 70px; | ||
} | ||
|
||
.is-expanded{ | ||
width: 100%; | ||
} | ||
|
||
.section{ | ||
overflow-y: scroll; | ||
height: 340px; | ||
margin-top: 20px; | ||
margin-left: 25px; | ||
background-color: #FAFAFA; | ||
} |
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,32 @@ | ||
.navStyle{ | ||
/* padding-top: 545px; */ | ||
position: absolute; | ||
bottom: 0; | ||
width: 375px; | ||
height: 55px; | ||
|
||
} | ||
|
||
.navStyle button{ | ||
cursor: pointer; | ||
width: 62px; | ||
height: 55px; | ||
border: none; | ||
background-color: #48A1AF; | ||
padding: 5px; | ||
} | ||
|
||
.navStyle button img{ | ||
margin-top: 4px; | ||
width: 60%; | ||
height: 51%; | ||
} | ||
|
||
.navStyle button p{ | ||
margin-top: 4px; | ||
font-size: 10px; | ||
} | ||
|
||
.active button { | ||
background-color: #335e65; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete unnecessary comments