Skip to content
Snippets Groups Projects
Commit 8cce4600 authored by Lukas's avatar Lukas
Browse files

Add new Posts tab to account page

parent 75a815d9
No related branches found
No related tags found
1 merge request!524Lbudginas/#424 add new tab on account page
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import OperationTabContent from "./operations/OperationsTabContent";
import CommentsTabContent from "./comments/CommentsTabContent";
import PostsTabContent from "./posts/PostsTabContent";
import { useTabs } from "@/contexts/TabsContext";
interface AccountOperationViewTabs {
liveDataEnabled: boolean;
......@@ -9,9 +11,14 @@ interface AccountOperationViewTabs {
const AccountOperationViewTabs: React.FC<AccountOperationViewTabs> = ({
liveDataEnabled,
}) => {
const { activeTab, setActiveTab } = useTabs();
const handleTabChange = (value: string) => setActiveTab(value);
return (
<Tabs
defaultValue="operations"
value={activeTab}
onValueChange={handleTabChange}
className="flex-col w-full"
>
<TabsList className="flex w-full justify-start">
......@@ -22,6 +29,12 @@ const AccountOperationViewTabs: React.FC<AccountOperationViewTabs> = ({
>
Operations
</TabsTrigger>
<TabsTrigger
className="rounded"
value="posts"
>
Posts
</TabsTrigger>
<TabsTrigger
className="rounded"
value="comments"
......@@ -31,9 +44,9 @@ const AccountOperationViewTabs: React.FC<AccountOperationViewTabs> = ({
</div>
</TabsList>
<OperationTabContent liveDataEnabled={liveDataEnabled} />
<PostsTabContent />
<CommentsTabContent />
</Tabs>
);
};
export default AccountOperationViewTabs;
import CommentsPermlinkSearch from "@/components/home/searches/CommentPermlinkSearch";
import CommentPermlinkSearchResults from "@/components/home/searches/searchesResults/CommentPermlinkSearchResults";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { TabsContent } from "@/components/ui/tabs";
const PostsTabContent = () => {
return (
<TabsContent value="posts">
<Card className="mb-4">
<CardHeader>
<CardTitle>Post search</CardTitle>
</CardHeader>
<CardContent>
<CommentsPermlinkSearch />
</CardContent>
</Card>
<CommentPermlinkSearchResults />
</TabsContent>
);
};
export default PostsTabContent;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment