Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
38f120c
pain
ms00l May 2, 2022
d9d873d
upgraded navbar
ms00l May 2, 2022
41034c0
new new
ms00l May 2, 2022
8feaf92
deleted dropdown
ms00l May 2, 2022
9a46dd3
Merge branch 'groupdevelopment' into devmoe
ms00l May 3, 2022
634a9f4
Merge branch 'groupdevelopment' into devmoe
ms00l May 3, 2022
10a4c05
Merge pull request #2 from MoSaCo-Group/devmoe
ms00l May 3, 2022
46f5353
Fixed merge Conflicts
SakoPak May 3, 2022
54571c6
Edited out Index api call
SakoPak May 3, 2022
3de77f9
Add route to connect to ShowProfile
SakoPak May 3, 2022
2c5009a
Comment out IndexProfiles
SakoPak May 3, 2022
443bf46
Connect with Create Profile
SakoPak May 3, 2022
8215eab
Edited code to correctly UpdateProfile
SakoPak May 3, 2022
20309ff
Delete IndexProfiles
SakoPak May 3, 2022
9b44fe0
Merge pull request #5 from MoSaCo-Group/DevSako
SakoPak May 3, 2022
cba9aef
added chatroom
Jackson916 May 4, 2022
59f914d
post merge commits
ms00l May 3, 2022
bd77514
commit
ms00l May 4, 2022
c5bbf4d
doesnt work
ms00l May 4, 2022
e02f5c9
connected socket.io with the backend
Jackson916 May 5, 2022
62342b3
removed socket.io not needed when using socket.io client
Jackson916 May 5, 2022
ccee323
lol
ms00l May 5, 2022
a031237
Add Images
SakoPak May 5, 2022
0cc220b
Add new image to Header
SakoPak May 5, 2022
92b7794
Add styling to body
SakoPak May 5, 2022
d457837
Add landing page
SakoPak May 5, 2022
30469c4
Add Landing files
SakoPak May 5, 2022
2182a07
Add edits to profile
SakoPak May 5, 2022
f6d49bb
Adding edited files
SakoPak May 5, 2022
e518ab3
ok
ms00l May 5, 2022
70511fe
Merge pull request #7 from MoSaCo-Group/DevSako
SakoPak May 5, 2022
6b4c42c
added chat abr and nav links
Jackson916 May 5, 2022
3e9553a
newest
ms00l May 5, 2022
d531182
commit
Jackson916 May 5, 2022
9816066
commit
Jackson916 May 5, 2022
0ccb904
commit
Jackson916 May 5, 2022
fb396eb
new new new
ms00l May 5, 2022
e7911cf
try new again
ms00l May 5, 2022
d4ea491
updated index.scss
ms00l May 5, 2022
72b586c
Merge branch 'devmoe' into groupdevelopment
ms00l May 5, 2022
3aa98ca
chat comp
Jackson916 May 5, 2022
07b98f9
Merge branch 'groupdevelopment' into colinsfeature
Jackson916 May 5, 2022
4cd539d
Merge pull request #12 from MoSaCo-Group/colinsfeature
Jackson916 May 5, 2022
6d5d210
add base ChatBox
ms00l May 5, 2022
42b87b7
edits to Container
SakoPak May 5, 2022
681f302
Edits to landing style
SakoPak May 5, 2022
af5953f
Add Component Updates for Styling
SakoPak May 6, 2022
414d061
Edits for styling
SakoPak May 6, 2022
60c42de
Changing landing
SakoPak May 6, 2022
86f9a59
Edits to logos
SakoPak May 6, 2022
1c47441
Add all
SakoPak May 6, 2022
975fae2
Edits
SakoPak May 6, 2022
478001f
Added heroku URL
SakoPak May 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
566 changes: 324 additions & 242 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"homepage": "http://MoSaCo-Group.github.io/chat-app-react-front",
"homepage": "http://MoSaCo-Group.github.io/",
"name": "chat-app-react-front",
"version": "0.1.0",
"private": true,
Expand All @@ -21,12 +21,17 @@
"react": "^17.0.2",
"react-bootstrap": "^2.0.0-alpha.2",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-ticker": "^1.3.2",
"react-typist": "^2.0.5",
"resolve": "^1.18.1",
"socket.io": "^4.5.0",
"socket.io-client": "^4.5.0",
"web-vitals": "^1.1.2"
"styled-components": "^5.3.5",
"typewriter-effect": "^2.18.2",
"web-vitals": "^1.1.2",
"whatwg-fetch": "^3.6.2"
},
"scripts": {
"start": "PORT=7165 react-scripts start",
Expand Down
6 changes: 5 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@

<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">


<script src="gh-pages-url-parser.js" type="text/javascript"></script>

<title>React App</title>
<title>ReAct</title>
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>

</body>

</html>
3 changes: 3 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* .bg {
image: url('./background.jpeg');
} */
213 changes: 121 additions & 92 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-tabs */
import React, { Component, Fragment } from 'react'
import { Route } from 'react-router-dom'
import { BrowserRouter as Router, Route } from 'react-router-dom'
import { v4 as uuid } from 'uuid'
import './App.css'

import AuthenticatedRoute from './components/AuthenticatedRoute/AuthenticatedRoute'
import AutoDismissAlert from './components/AutoDismissAlert/AutoDismissAlert'
Expand All @@ -10,11 +11,16 @@ import SignUp from './components/auth/SignUp'
import SignIn from './components/auth/SignIn'
import SignOut from './components/auth/SignOut'
import ChangePassword from './components/auth/ChangePassword'
import CreateChat from './components/Chat/CreateChat'

import CreateProfile from './components/Profile/CreateProfile'
import ShowProfile from './components/Profile/ShowProfile'
import UpdateProfile from './components/Profile/UpdateProfile'
import IndexProfile from './components/Profile/IndexProfiles'

// import IndexProfile from './components/Profile/IndexProfiles'

import Container from './components/Landing/Container'
import MoveStuffAround from './components/MoveStuffAround'

class App extends Component {
constructor (props) {
Expand All @@ -25,102 +31,125 @@ class App extends Component {
}
}

setUser = (user) => this.setState({ user })
setUser = (user) => this.setState({ user })

clearUser = () => this.setState({ user: null })
clearUser = () => this.setState({ user: null })

deleteAlert = (id) => {
this.setState((state) => {
return { msgAlerts: state.msgAlerts.filter((msg) => msg.id !== id) }
})
}
deleteAlert = (id) => {
this.setState((state) => {
return { msgAlerts: state.msgAlerts.filter((msg) => msg.id !== id) }
})
}

msgAlert = ({ heading, message, variant }) => {
const id = uuid()
this.setState((state) => {
return {
msgAlerts: [...state.msgAlerts, { heading, message, variant, id }]
msgAlert = ({ heading, message, variant }) => {
const id = uuid()
this.setState((state) => {
return {
msgAlerts: [...state.msgAlerts, { heading, message, variant, id }]
}
})
}
})
}
// handleSignInClick() {
// this.setState({isSignedIn: true})
// }

render () {
const { msgAlerts, user } = this.state
// handleSignOutClick() {
// this.setState({isSignedIn: false})
// }

return (
<Fragment>
<Header user={user} />
{msgAlerts.map((msgAlert) => (
<AutoDismissAlert
key={msgAlert.id}
heading={msgAlert.heading}
variant={msgAlert.variant}
message={msgAlert.message}
id={msgAlert.id}
deleteAlert={this.deleteAlert}
/>
))}
<main className='container'>
<Route
path='/sign-up'
render={() => (
<SignUp msgAlert={this.msgAlert} setUser={this.setUser} />
)}
/>
<Route
path='/sign-in'
render={() => (
<SignIn msgAlert={this.msgAlert} setUser={this.setUser} />
)}
/>
<AuthenticatedRoute
user={user}
path='/sign-out'
render={() => (
<SignOut
msgAlert={this.msgAlert}
clearUser={this.clearUser}
user={user}
/>
)}
/>
<AuthenticatedRoute
user={user}
path='/change-password'
render={() => (
<ChangePassword msgAlert={this.msgAlert} user={user} />
)}
/>
<AuthenticatedRoute
user={user}
path='/create-profile'
render={() => (
<CreateProfile msgAlert={this.msgAlert} user={user} />
)}
/>
<AuthenticatedRoute
exact
user={user}
path='/profiles/:id'
render={() => <ShowProfile msgAlert={this.msgAlert} user={user} />}
/>
<AuthenticatedRoute
user={user}
path='/profiles/:id/edit'
render={() => (
<UpdateProfile msgAlert={this.msgAlert} user={user} />
)}
/>
<AuthenticatedRoute
user={user}
exact
path='/profiles'
render={() => <IndexProfile msgAlert={this.msgAlert} user={user} />}
/>
</main>
</Fragment>
)
}
render () {
const { msgAlerts, user } = this.state
// const isSignedIn = this.state.isSignedIn

return (
<Fragment>
<Router>
<Header user={user} />
{msgAlerts.map((msgAlert) => (
<AutoDismissAlert
key={msgAlert.id}
heading={msgAlert.heading}
variant={msgAlert.variant}
message={msgAlert.message}
id={msgAlert.id}
deleteAlert={this.deleteAlert}
/>
))}
<main className='container'>
<Route
exact path='/'
render={() => (
<Container/>
)}
/>
<Route
path='/sign-up'
render={() => (
<SignUp msgAlert={this.msgAlert} setUser={this.setUser} />
)}
/>
<Route
path='/sign-in'
render={() => (
<SignIn msgAlert={this.msgAlert} setUser={this.setUser} />
)}
/>
<Route path='/critics' render={() => <MoveStuffAround />} />
<AuthenticatedRoute
user={user}
path='/sign-out'
render={() => (
<SignOut
msgAlert={this.msgAlert}
clearUser={this.clearUser}
user={user}
/>
)}
/>
<AuthenticatedRoute
user={user}
path='/change-password'
render={() => (
<ChangePassword msgAlert={this.msgAlert} user={user} />
)}
/>
<AuthenticatedRoute
user={user}
path='/create-profile'
render={() => (
<CreateProfile msgAlert={this.msgAlert} user={user} />
)}
/>
<AuthenticatedRoute
exact
user={user}
path='/profile/:id'
render={() => (
<ShowProfile msgAlert={this.msgAlert} user={user} />
)}
/>
<AuthenticatedRoute
user={user}
path='/profile/:id/edit'
render={() => (
<UpdateProfile msgAlert={this.msgAlert} user={user} />
)}
/>
<AuthenticatedRoute
user={user}
exact
path='/Chat'
render={() => (
<CreateChat msgAlert={this.msgAlert} user={user} />
)}
/>
</main>
</Router>
<>
</>
</Fragment>
)
}
}

export default App
Binary file added src/Images/landingText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/mainLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/navLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/rechatLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Images/soloLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions src/api/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import apiUrl from '../apiConfig'
import axios from 'axios'

export const createChat = (data, user) => {
console.log(data)
return axios({
method: 'POST',
url: apiUrl + '/chat/',
url: apiUrl + '/Chat/',
data: {
chat: {
name: data.name,
message: data.message
body: data.body
}
},
headers: {
Expand All @@ -17,9 +17,15 @@ export const createChat = (data, user) => {
})
}

// const data = {
// chat: {
// body: '',
// },
// }

export const indexChat = (user) => {
return axios({
url: apiUrl + '/chat/',
url: apiUrl + '/Chat',
method: 'GET',
headers: {
Authorization: `Bearer ${user.token}`
Expand Down
19 changes: 19 additions & 0 deletions src/api/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ export const showProfile = (id, user) => {
})
}

// export const indexProfiles = (user) => {
// return axios({
// url: apiUrl + '/profiles/',
// method: 'GET',
// headers: {
// Authorization: `Bearer ${user.token}`
// }
// })
// }

export const deleteProfile = (id, user) => {
return axios({
url: apiUrl + '/profile/' + id,
Expand All @@ -54,3 +64,12 @@ export const deleteProfile = (id, user) => {
}
})
}
export const indexProfiles = (id, user) => {
return axios({
url: apiUrl + '/profile/',
method: 'GET',
headers: {
Authorization: `Bearer ${user.token}`
}
})
}
2 changes: 1 addition & 1 deletion src/apiConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let apiUrl
const apiUrls = {
production: 'https://aqueous-atoll-85096.herokuapp.com',
production: 'https://sleepy-river-31745.herokuapp.com',
development: 'http://localhost:4741'
}

Expand Down
Binary file added src/background.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions src/components/AutoDismissAlert/AutoDismissAlert.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
.alert {
align-items: center;
animation: .5s ease-in-out 0s 1 light-bounce-in;
bottom: 1rem;
animation: .3s ease-in-out 0s 1 light-bounce-in;
bottom: .5rem;
display: flex;
left: 0;
margin: auto;
max-width: 30rem;
position: fixed;
right: 0;
z-index: 10000;
color: #253439;


.alert-body {
width: 20%;
margin-bottom: 0;
color: #253439;
}
}


.close {
&:active,
&:focus {
Expand Down
Loading