Skip to content

Settings following #24

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

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file removed public/images/69.jpg
Binary file not shown.
6 changes: 5 additions & 1 deletion public/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"avatar":"",
"follows":[
{
"url":"",
"url":"dat://6ce0b49e9b045877a18669a1f287a101fb99d8881d2f9fa4ce0486c022c2397d/",
"name":"~~|| dead staff ||~~"
},
{
"url":"dat://7fcca9b6889e23b39a59de3780a74445e49ab722b1cd23358381760d6202a606/",
"name":"another dead staff"
}
]
}
1 change: 0 additions & 1 deletion src/components/ContentSelection/ImagePost/ImageForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const ImageForm = ({
resetImagePath
}) => (
<form onSubmit={e => submitFn(e)} encType="multipart/form-data">
{console.log('imageFile', imageFile)}
<div
className={`${'FormElement'} ${
titleContent !== '' ? 'FormElementActive' : ''
Expand Down
1 change: 0 additions & 1 deletion src/components/ContentSelection/TextPost/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class TextPost extends React.Component {
this.props.userData.name
)
);
//--- TODO Add Post Author above here...

this.setState({
titleContent: '',
Expand Down
10 changes: 0 additions & 10 deletions src/components/ContentView/Settings/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/components/ContentView/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';

import ContentViewLoop from './ContentViewLoop';
import Settings from './Settings';

const ContentView = ({
posts,
Expand All @@ -27,7 +26,6 @@ const ContentView = ({
isOwner={isOwner}
/>
)}
{postDisplay === 'settings' && <Settings />}
</section>
);

Expand Down
5 changes: 5 additions & 0 deletions src/components/Following/FollowSuggestions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

const FollowSuggestions = () => <div className="">Who to follow</div>;

export default FollowSuggestions;
13 changes: 13 additions & 0 deletions src/components/Following/Follows.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

const Follows = ({ follows }) => (
<div className="Following">
{follows &&
follows.map((follow, i) => (
<div className="Following__Item" key={i}>
<a href={follow.url}>{follow.name}</a>
</div>
))}
</div>
);
export default Follows;
13 changes: 13 additions & 0 deletions src/components/Following/NewFollow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

const NewFollow = ({ addFollower }) => (
<div className="">
<h3>Add User</h3>
<form onSubmit={e => addFollower(e)}>
<input type="text" placeholder="Dat URL" id="add-follower-input" />
<input type="submit" />
</form>
</div>
);

export default NewFollow;
16 changes: 8 additions & 8 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ const Header = ({
</a>
<a
className={`
${'ContentDisplayToggle__Item'}
${
postDisplay === 'settings'
? 'ContentDisplayToggle__Item_Selected'
: ''
}
`}
onClick={() => togglePostDisplay('settings')}
${'ContentDisplayToggle__Item'}
${
postDisplay === 'settings'
? 'ContentDisplayToggle__Item_Selected'
: ''
}
`}
href="/settings"
>
<img src="/icons/icon-settings.svg" alt="" />
</a>
Expand Down
58 changes: 58 additions & 0 deletions src/components/SharedComponents/Profile/ProfileEdit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react';

const ProfileEdit = ({
userAvatar,
userName,
userBio,
changeFn,
updateUserData
}) => (
<div className="Profile__Edit">
<form onSubmit={e => updateUserData(e)}>
<div
className={`${'FormElement'} ${
userAvatar !== '' ? 'FormElementActive' : ''
}`}
>
<input
type="text"
name="title-avatar"
value={userAvatar}
onChange={e => changeFn(e, 'avatar')}
/>
<label htmlFor="title-avatar">Avatar</label>
</div>
<div
className={`${'FormElement'} ${
userName !== '' ? 'FormElementActive' : ''
}`}
>
<input
type="text"
name="title-name"
value={userName}
onChange={e => changeFn(e, 'name')}
/>
<label htmlFor="title-name">Name</label>
</div>
<div
className={`${'FormElement'} ${
userBio !== '' ? 'FormElementActive' : ''
}`}
>
<input
type="text"
name="title-bio"
value={userBio}
onChange={e => changeFn(e, 'bio')}
/>
<label htmlFor="title-bio">Bio</label>
</div>
<button className={'Button'} type="submit">
Save Profile
</button>
</form>
</div>
);

export default ProfileEdit;
41 changes: 41 additions & 0 deletions src/components/SharedComponents/Profile/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';

import ProfileEdit from './ProfileEdit';

const Profile = ({
userAvatar,
userName,
userBio,
editProfile,
changeFn,
updateUserData
}) => (
<div className="Profile">
{editProfile ? (
<ProfileEdit
changeFn={changeFn}
userAvatar={userAvatar}
userName={userName}
userBio={userBio}
updateUserData={updateUserData}
/>
) : (
<div>
<div className="Profile__Avatar">
<p className="label">Avatar</p>
{userAvatar}
</div>
<div className="Profile__Name">
<p className="label">Name</p>
<p>{userName}</p>
</div>
<div className="Profile__Bio">
<p className="label">Bio</p>
<p>{userBio}</p>
</div>
</div>
)}
</div>
);

export default Profile;
7 changes: 6 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
//--- Nick
// export const DAT_URL =
// 'aeac0a57a7f65ea03693909d817e93d8340c243137ed483076d7b68b18d09c61';

//--- James
export const DAT_URL =
'aeac0a57a7f65ea03693909d817e93d8340c243137ed483076d7b68b18d09c61';
'7fcca9b6889e23b39a59de3780a74445e49ab722b1cd23358381760d6202a606';
Loading