Skip to content

Commit d0dfc8f

Browse files
committed
bottomのレイアウトを変更
1 parent c89e3ce commit d0dfc8f

File tree

6 files changed

+24
-19
lines changed

6 files changed

+24
-19
lines changed

web/app/chat/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function ChatPageLayout({
1313
<div className="absolute top-14 right-0 bottom-14 left-0 overflow-y-auto sm:top-16">
1414
{children}
1515
</div>
16-
<BottomBar activeTab="2_chat" />
16+
<BottomBar activeTab="3_chat" />
1717
</NavigateByAuthState>
1818
);
1919
}

web/app/friends/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import BottomBar from "~/components/BottomBar";
22
import Header from "~/components/Header";
3+
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
34

45
export default function FriendsPageLayout({
56
children,
67
}: {
78
children: React.ReactNode;
89
}) {
910
return (
10-
<>
11+
<NavigateByAuthState type="toLoginForUnauthenticated">
1112
<Header title="フレンド/Friends" />
1213
<div className="absolute top-14 right-0 bottom-14 left-0 overflow-y-auto sm:top-16">
1314
{children}
1415
</div>
1516
<BottomBar activeTab="1_friends" />
16-
</>
17+
</NavigateByAuthState>
1718
);
1819
}

web/app/home/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import BottomBar from "~/components/BottomBar";
22
import Header from "~/components/Header";
3+
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
34

45
export default function HomePageLayout({
56
children,
67
}: {
78
children: React.ReactNode;
89
}) {
910
return (
10-
<>
11+
<NavigateByAuthState type="toLoginForUnauthenticated">
1112
<Header title="ホーム/Home" />
1213
<div className="relative top-14 right-0 bottom-14 left-0 overflow-y-auto sm:top-16">
1314
{children}
1415
</div>
1516
<BottomBar activeTab="0_home" />
16-
</>
17+
</NavigateByAuthState>
1718
);
1819
}

web/app/search/layout.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import BottomBar from "~/components/BottomBar";
22
import Header from "~/components/Header";
3+
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
34

45
export default function HomePageLayout({
56
children,
67
}: {
78
children: React.ReactNode;
89
}) {
910
return (
10-
<>
11+
<NavigateByAuthState type="toLoginForUnauthenticated">
1112
<Header title="検索/Search" />
1213
<div className="absolute top-14 right-0 bottom-14 left-0 overflow-y-auto sm:top-16">
1314
{children}
1415
</div>
15-
<BottomBar activeTab="4_search" />
16-
</>
16+
<BottomBar activeTab="2_search" />
17+
</NavigateByAuthState>
1718
);
1819
}

web/app/settings/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function SettingsPageLayout({
1212
<div className="absolute top-14 right-0 bottom-14 left-0 overflow-y-auto sm:top-16">
1313
{children}
1414
</div>
15-
<BottomBar activeTab="3_settings" />
15+
<BottomBar activeTab="4_settings" />
1616
</>
1717
);
1818
}

web/components/BottomBar.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MdSettings } from "react-icons/md";
66
import { MdSearch } from "react-icons/md";
77

88
type Props = {
9-
activeTab: "0_home" | "1_friends" | "2_chat" | "3_settings" | "4_search";
9+
activeTab: "0_home" | "1_friends" | "2_search" | "3_chat" | "4_settings";
1010
};
1111

1212
function BottomBarCell({
@@ -23,7 +23,9 @@ function BottomBarCell({
2323
return (
2424
<Link
2525
href={href}
26-
className={`focus:bg-gray-300 ${isActive ? "active text-primary" : "text-secondary"}`}
26+
className={`focus:bg-gray-300 ${
27+
isActive ? "active text-primary" : "text-secondary"
28+
}`}
2729
>
2830
{iconComponent}
2931
<span
@@ -51,24 +53,24 @@ export default function BottomBar(props: Props) {
5153
isActive={activeTab === "1_friends"}
5254
iconComponent={<MdPeople className="text-2xl" />}
5355
/>
56+
<BottomBarCell
57+
label="Search"
58+
href="/search"
59+
isActive={activeTab === "2_search"}
60+
iconComponent={<MdSearch className="text-2xl" />}
61+
/>
5462
<BottomBarCell
5563
label="Chat"
5664
href="/chat"
57-
isActive={activeTab === "2_chat"}
65+
isActive={activeTab === "3_chat"}
5866
iconComponent={<MdChat className="text-2xl" />}
5967
/>
6068
<BottomBarCell
6169
label="Settings"
6270
href="/settings"
63-
isActive={activeTab === "3_settings"}
71+
isActive={activeTab === "4_settings"}
6472
iconComponent={<MdSettings className="text-2xl" />}
6573
/>
66-
<BottomBarCell
67-
label="Search"
68-
href="/search"
69-
isActive={activeTab === "4_search"}
70-
iconComponent={<MdSearch className="text-2xl" />}
71-
/>
7274
</div>
7375
);
7476
}

0 commit comments

Comments
 (0)