1. First, we need fresh reactjs setup, and for that, we need to run below commands into out terminal, and also we should have latest node version installed on our system:
npx create-react-app my-awesome-project
cd my-awesome-project
npm start
2. Now we need to run below commands into our project terminal to get bootstrap and related modules into our reactjs application:
npm install [email protected] --save
npm start //For start project again
3. Finally for the main output, we need to add below code into our my-awesome-project/src/App.js file or if you have fresh setup then you can replace my-awesome-project/src/App.js file code with below code:
import React from 'react';
import './App.css';
import 'bootstrap/dist/css/bootstrap.min.css';
function App() {
return (
<div>
<div class="container">
<div class="row">
<div class="col-md-8">
<div class="people-nearby">
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar7.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Sophia Page</a></h5>
<p>Software Engineer</p>
<p class="text-muted">500m away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Emma Johnson</a></h5>
<p>Model at Fashion</p>
<p class="text-muted">800m away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar5.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Nora Wilson</a></h5>
<p>Writer at Newspaper</p>
<p class="text-muted">2.5km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar4.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Diana Amber</a></h5>
<p>Student</p>
<p class="text-muted">700m away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar3.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Addison Thomas</a></h5>
<p>Barber at Fashion</p>
<p class="text-muted">1.5km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar2.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Jonathon Thompson</a></h5>
<p>Fashion Designer</p>
<p class="text-muted">2km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar7.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Olivia Steward</a></h5>
<p>Creative Director</p>
<p class="text-muted">2km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Elena Foster</a></h5>
<p>Executive Officer</p>
<p class="text-muted">4km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Brian Walton</a></h5>
<p>Designer at Designer</p>
<p class="text-muted">3km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
<div class="nearby-user">
<div class="row">
<div class="col-md-2 col-sm-2">
<img src="https://bootdey.com/img/Content/avatar/avatar7.png" alt="user" class="profile-photo-lg"/>
</div>
<div class="col-md-7 col-sm-7">
<h5><a href="#/" class="profile-link">Cris Haris</a></h5>
<p>General Manager at Manager</p>
<p class="text-muted">1km away</p>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-primary pull-right">Add Friend</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
);
}
export default App;
4. Now we need to add below code into our my-awesome-project/src/App.css file :
body{
margin-top:20px;
background:#FAFAFA;
}
/*==================================================
Nearby People CSS
==================================================*/
.people-nearby .google-maps{
background: #f8f8f8;
border-radius: 4px;
border: 1px solid #f1f2f2;
padding: 20px;
margin-bottom: 20px;
}
.people-nearby .google-maps .map{
height: 300px;
width: 100%;
border: none;
}
.people-nearby .nearby-user{
padding: 20px 0;
border-top: 1px solid #f1f2f2;
border-bottom: 1px solid #f1f2f2;
margin-bottom: 20px;
}
img.profile-photo-lg{
height: 80px;
width: 80px;
border-radius: 50%;
}