Skip to content

Commit cc9b55c

Browse files
committed
Make profile navbar and search bar reusable
1 parent 898666f commit cc9b55c

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed
Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
import React from 'react'
1+
import React from "react";
2+
import SearchBar from "../reusable/SearchBar";
3+
import { IoMdHome, IoIosNotifications } from "react-icons/io";
4+
import { BiSolidMessageRounded } from "react-icons/bi";
5+
import Image from "next/image";
26

37
const Navbar = () => {
48
return (
5-
<div>
6-
I am navbar for profile
9+
<div className="flex justify-between mt-2 mb-8">
10+
<SearchBar placeholder="Enter interests" />
11+
<div className="flex gap-10 items-center">
12+
<IoMdHome className="text-2xl" />
13+
<BiSolidMessageRounded className="text-2xl" />
14+
<IoIosNotifications className="text-2xl" />
15+
<Image
16+
src="/profile-image.png"
17+
height={35}
18+
width={35}
19+
alt="profile-image"
20+
className="rounded-full"
21+
/>
22+
</div>
723
</div>
8-
)
9-
}
24+
);
25+
};
1026

1127
export default Navbar;

app/components/reusable/SearchBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
const SearchBar = () => {
3+
const SearchBar = ({placeholder}: {placeholder: string}) => {
44
return (
55
<form className="min-w-[50%] text-center">
66
<label
@@ -31,7 +31,7 @@ const SearchBar = () => {
3131
type="search"
3232
id="default-search"
3333
className="block w-full p-2 ps-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
34-
placeholder="Find new friends, chat, and discover communities"
34+
placeholder={placeholder}
3535
required
3636
/>
3737
{/* <button

0 commit comments

Comments
 (0)