Skip to content
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
26 changes: 26 additions & 0 deletions Assignment-4/code/Mock-data/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"user":
[
{"name":"Siva",
"location":"Bengaluru",
"likes":64,
"description": "Kick start your career",
"PostImage": "https://www.moneycrashers.com/wp-content/uploads/2011/09/college-education-career-major-field.jpg",
"date": "10 Jan 2021"
},
{"name":"Neeraj",
"location":"Pune",
"likes":93,
"description": "Beautiful Big Sur",
"PostImage": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT6KZDOmFtq8ufnkT4sWIsPH1JlsQMOZ-CpBA&usqp=CAU",
"date": "6 Jan 2021"
},
{"name":"Rahul",
"location":"Hyderabad",
"likes":30,
"description": "Off to Switzerland",
"PostImage": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSTEcM8bIyMFmgCF8cxoKPUmyiwNw3eUtGSPg&usqp=CAU",
"date": "29 Dec 2020"
}
]
}
21,157 changes: 953 additions & 20,204 deletions Assignment-4/code/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Assignment-4/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"enzyme-matchers": "^7.1.2",
"json-server": "^0.17.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
Expand Down
75 changes: 74 additions & 1 deletion Assignment-4/code/src/Postview.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*{
margin: 0;
padding: 0;
}
.site-container{
text-align: center;
}
Expand All @@ -8,4 +12,73 @@ body {
line-height: 1.5;
color: black;
margin:0;
}
}
.nav_header{
height: 50px;
position: sticky;
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 1px solid black;

}
.navbar_camera{
margin-left: 60%;
}
.instalogo_name{
color: green;
font-weight: bold;
font-size: 25px;
}
.Box_container1{
width: 50%;
height: 380px;
border: 1px solid black;
margin-top: 20px;
margin-bottom: 20px;
margin-left: 25%;
margin-right: 25%;

}
.data_container{
display: flex;
flex-direction: row;
}
.header_content{
text-align: left;
margin-left: 10px;
}
.header_content1{
padding-top: 10px;
margin-left: 82%;
}
.middle_container{
width: 100%;
margin-top: 10px;
}
.middle_container img{
width: 100%;
height: 200px;
}
.bottomFirst_content{
display: flex;
flex-direction: row;
text-align: left;
margin-top: 10px;
margin-left: 10px;
}
.share_button{
margin-left: 15px;
}
.Date{
margin-left: 75%;
}
.Likes_count{
text-align: left;
margin-left: 12px;
}
.description_box{
text-align: left;
margin-left: 12px;
margin-top: 10px;
}

48 changes: 46 additions & 2 deletions Assignment-4/code/src/Postview.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,54 @@
import React from 'react';
import React ,{useEffect} from 'react';
import './Postview.css';

import camera from './img/icons8-camera-24.png';
import share from './img/share_logo.png';
import like from './img/like_button.png';
import threeDots from './img/menu_button.png';

const Postview=()=> {
const[users, setusers]=React.useState([])
useEffect(()=>{
fetch("http://localhost:3004/user")
.then((res)=>res.json())
.then((res)=>setusers(res));

},[])
return (
<div className="site-container">
<div className='nav_header'>
<label><img className='instaclone_logo' src='' alt=''/></label>
<label className='instalogo_name'>Instaclone</label>
<label className='navbar_camera'><img className='camera' src={camera} alt='camera_logo'/></label>
</div>
{
users.map((user,index)=>(
// <div key={index} className='userss'>
<div className='Box_container1'>
<div className='data_container'>
<div className='header_content'>
<h2>{user.name}</h2>
<p>{user.location}</p>
</div>
<div className='header_content1'><img className='dot_img' src={threeDots} alt='menu'/></div>
</div>
<div className='middle_container'><img className='post_img' src={user.PostImage} alt='postimage'/> </div>
<div className='secondData_container'>
<div className='bottomFirst_content'>
<img className='Like_button' src={like} alt='like_img'/>
<img className='share_button' src={share} alt='share_img'/>
<p className='Date'>{user.date}</p>
</div>
<div className='Likes_count'>
<p className='Likes'>{user.likes + " Likes"}</p>
</div>
<div className='description_box'>
<h4>{user.description}</h4>
</div>
</div>
</div>
// </div>
))
}
</div>
);
}
Expand Down
Binary file added Assignment-4/code/src/img/icons8-camera-24.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 Assignment-4/code/src/img/like_button.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 Assignment-4/code/src/img/menu_button.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 Assignment-4/code/src/img/share_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.