Skip to content

Commit

Permalink
feat: explore page UI 구현 & 오타 수정 (#9)
Browse files Browse the repository at this point in the history
- Explore page UI 구현
- 일부 오타 수정

Co-authored-by: 박세준 <[email protected]>
  • Loading branch information
LikeACloud7 and 박세준 authored Jan 2, 2025
1 parent f276569 commit bc9b7fb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
File renamed without changes.
10 changes: 6 additions & 4 deletions src/components/MobileBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Heart, Home, PlusSquare, Search, User } from 'lucide-react';
import { Compass, Heart, Home, PlusSquare, User } from 'lucide-react';
import React from 'react';
import { Link } from 'react-router-dom';

Expand All @@ -12,13 +12,15 @@ const NavItem = ({ icon }: NavItemProps) => (
</a>
);

const BottomBar = () => {
const MobileBar = () => {
return (
<nav className="flex md:hidden justify-around py-2 bg-white border-t">
<Link to="/">
<NavItem icon={<Home />} />
</Link>
<NavItem icon={<Search />} />
<Link to="/explore">
<NavItem icon={<Compass />} />
</Link>
<NavItem icon={<PlusSquare />} />
<NavItem icon={<Heart />} />
<Link to="/username">
Expand All @@ -28,4 +30,4 @@ const BottomBar = () => {
);
};

export default BottomBar;
export default MobileBar;
12 changes: 7 additions & 5 deletions src/components/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const NavItem = ({ icon, label, active }: NavItemProps) => (
</a>
);

const Sidebar = () => {
const SideBar = () => {
const [isMenuOpen, setIsMenuOpen] = React.useState(false);

const toggleMenu = () => {
Expand All @@ -44,14 +44,16 @@ const Sidebar = () => {
<img src="/instagram-logo.png" alt="Instagram" className="w-24" />
</div>
<div className="flex flex-col flex-1 space-y-2">
<Link to="/" className="no-underline">
<Link to="/">
<NavItem icon={<Home />} label="Home" active />
</Link>
<NavItem icon={<Search />} label="Search" active={false} />
<NavItem icon={<Compass />} label="Explore" active={false} />
<Link to="/explore">
<NavItem icon={<Compass />} label="Explore" active={false} />
</Link>
<NavItem icon={<Heart />} label="Notifications" active={false} />
<NavItem icon={<PlusSquare />} label="Create" active={false} />
<Link to="/username" className="no-underline">
<Link to="/username">
<NavItem icon={<User />} label="Profile" active={false} />
</Link>
</div>
Expand Down Expand Up @@ -83,4 +85,4 @@ const Sidebar = () => {
);
};

export default Sidebar;
export default SideBar;
21 changes: 18 additions & 3 deletions src/pages/ExplorePage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
import React from 'react';
import MobileBar from '../components/MobileBar';
import PostGrid from '../components/PostGrid';
import SideBar from '../components/SideBar';

const ExplorePage: React.FC = () => {
return <h1>Explore Page</h1>;
const ExplorePage = () => {
return (
<div className="flex flex-col min-h-screen bg-gray-50">
<div className="flex-1 p-4 pb-16 md:pb-4 md:ml-64 overflow-y-auto">
<div className="max-w-3xl mx-auto">
<PostGrid />
</div>
</div>

<div className="fixed bottom-0 left-0 right-0 md:left-0 md:top-0 md:right-auto md:w-64 bg-white border-t md:border-r md:border-t-0">
<SideBar />
<MobileBar />
</div>
</div>
);
};

export default ExplorePage;
2 changes: 1 addition & 1 deletion src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useParams } from 'react-router-dom';

import Highlights from '../components/Hilghlights';
import Highlights from '../components/Highlights';
import MobileBar from '../components/MobileBar';
import MobileHeader from '../components/MobileHeader';
import ProfileInfo from '../components/ProfileInfo';
Expand Down

0 comments on commit bc9b7fb

Please sign in to comment.