-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(follow and unfollow): users should be able to follow each other
Add action creators for follow Add reducers for follow [Maintains #165273540]
- Loading branch information
Showing
39 changed files
with
1,769 additions
and
10 deletions.
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
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
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
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
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,4 +1,5 @@ | ||
@import 'assets/MainStyle.scss'; | ||
@import 'sass-rem'; | ||
|
||
.navbar { | ||
padding-top: 0.5rem; | ||
|
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
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,51 @@ | ||
// import react library | ||
import React from 'react'; | ||
// import third pary libraries | ||
import PropTypes from 'prop-types'; | ||
import { Tab } from 'semantic-ui-react'; | ||
|
||
// import settings components | ||
import Settings from 'components/Profile/Settings'; | ||
|
||
// import profile style | ||
import './Profile.scss'; | ||
|
||
export const ProfileMain = ({ match: { params: { profileUser } }, authenticatedUser }) => { | ||
const panes = [ | ||
{ menuItem: 'Articles ', render: () => <Tab.Pane attached></Tab.Pane> }, | ||
]; | ||
if (authenticatedUser === profileUser) { | ||
panes.push({ menuItem: '| Settings', render: () => <Tab.Pane attached><Settings /></Tab.Pane> }); | ||
} | ||
|
||
return ( | ||
<div className="main"> | ||
<div className="profile-tab-menu"> | ||
<Tab className="tab" menu={{ secondary: true, pointing: true }} panes={panes} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
/** | ||
* Assigning props types | ||
*/ | ||
ProfileMain.propTypes = { | ||
match: PropTypes.shape({ | ||
params: PropTypes.shape({ | ||
profileUser: PropTypes.string, | ||
}) | ||
}), | ||
authenticatedUser: PropTypes.string, | ||
}; | ||
|
||
ProfileMain.defaultProps = { | ||
match: PropTypes.shape({ | ||
params: PropTypes.shape({ | ||
profileUser: 'nadralia', | ||
}) | ||
}), | ||
authenticatedUser: 'lou', | ||
}; | ||
|
||
export default ProfileMain; |
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,62 @@ | ||
@import 'assets/MainStyle.scss'; | ||
|
||
.main { | ||
width: 70%; | ||
padding-left: 2%; | ||
font-family: 'Open Sans', sans-serif; | ||
} | ||
|
||
.profile-tab-menu { | ||
&__menu { | ||
border-bottom: .125rem solid $secondary; | ||
display: flex; | ||
margin-bottom: 0; | ||
width: 100%; | ||
|
||
&__item { | ||
color: $black; | ||
font-family: 'Open Sans', sans-serif; | ||
font-size: 1.5rem; | ||
line-height: 1.8125rem; | ||
padding: 2.075rem; | ||
} | ||
|
||
&__active.item { | ||
font-weight: 400 !important; | ||
} | ||
} | ||
|
||
&__segment { | ||
border: 0; | ||
border-radius: 0; | ||
box-shadow: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
} | ||
|
||
.settings { | ||
margin-top: 1.875rem; | ||
} | ||
|
||
.edit-profile { | ||
background: $white; | ||
border: .0625rem solid $secondary; | ||
border-radius: .25rem; | ||
box-sizing: border-box; | ||
padding: 4.6875rem 1.3125rem 1.5rem; | ||
} | ||
|
||
@media only screen and (max-width: 37.5rem) { | ||
.main { | ||
width: 100%; | ||
} | ||
} | ||
|
||
menuItem { | ||
padding: 4.6875rem 1.3125rem 1.5rem; | ||
} | ||
|
||
.tab a { | ||
cursor: pointer; | ||
} |
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,25 @@ | ||
import React from 'react'; | ||
import { shallow, mount } from 'enzyme'; | ||
import ProfileMain from 'components/Profile/Index'; | ||
|
||
describe('Setting Component', () => { | ||
const props = { | ||
match: | ||
{ | ||
params: { | ||
profileUser: 'nadralia', | ||
} | ||
}, | ||
authenticatedUser: 'nadralia', | ||
}; | ||
|
||
it('should match the snapshot', () => { | ||
const component = shallow(<ProfileMain {...props} />); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render correctly', () => { | ||
const wrapper = mount(<ProfileMain {...props} />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
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,67 @@ | ||
.main { | ||
display: 'flex'; | ||
} | ||
|
||
.edit-btn { | ||
width: 40%; | ||
padding: 0.5rem 2rem; | ||
margin: 10px auto; | ||
border: 1px solid #F34579; | ||
background-color: #F34579; | ||
border-radius: 25px; | ||
display: block; | ||
font-size: 1.2rem; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
outline: transparent; | ||
background-color: #2D6686; | ||
color: #FFFFFF; | ||
} | ||
|
||
&:focus { | ||
outline: transparent; | ||
} | ||
} | ||
|
||
.settings__edit-profile textarea { | ||
margin: 0; | ||
width: 100%; | ||
-webkit-appearance: none; | ||
padding: .78571429rem 1rem; | ||
background: #FFF; | ||
border: 1px solid rgba(34,36,38,.15); | ||
outline: 0; | ||
color: rgba(0,0,0,.87); | ||
border-radius: .28571429rem; | ||
-webkit-box-shadow: 0 0 0 0 transparent inset; | ||
box-shadow: 0 0 0 0 transparent inset; | ||
-webkit-transition: color .1s ease,border-color .1s ease; | ||
transition: color .1s ease,border-color .1s ease; | ||
font-size: 1rem; | ||
line-height: 1.2857; | ||
resize: vertical; | ||
-webkit-box-sizing: border-box; | ||
-moz-box-sizing: border-box; | ||
box-sizing: border-box; | ||
} | ||
|
||
.settings__edit-profile input[type=text] { | ||
font-family: 'Open Sans', sans-serif; | ||
margin: 0; | ||
outline: 0; | ||
width: 100%; | ||
-webkit-appearance: none; | ||
line-height: 1.21428571rem; | ||
padding: .67857143rem 1rem; | ||
font-size: 1rem; | ||
background: #FFF; | ||
border: 1px solid rgba(34,36,38,.15); | ||
color: rgba(0,0,0,.87); | ||
border-radius: .28571429rem; | ||
-webkit-box-shadow: 0 0 0 0 transparent inset; | ||
box-shadow: 0 0 0 0 transparent inset; | ||
-webkit-transition: color .1s ease,border-color .1s ease; | ||
transition: color .1s ease,border-color .1s ease; | ||
margin-bottom: 0.978rem; | ||
} |
Oops, something went wrong.