Skip to content

Commit

Permalink
Fixed eslint and any type props
Browse files Browse the repository at this point in the history
  • Loading branch information
Pdzly committed Dec 13, 2023
1 parent 66d8c21 commit e417324
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 47 deletions.
39 changes: 22 additions & 17 deletions src/app/user/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,35 @@ import React from 'react';

import { PersonBio, PersonHeader } from '@/components/person-detail';

import * as testData from '../../../test-person-data.json';
import MainCard from '@/components/main-card';
import { ModeratesList, ModeratesProps } from '@/components/moderates-list';
import { PersonDetailSelection } from '@/components/person-comments-posts';
import * as testData from '../../../test-person-data.json';

const User = () => (
<div>
<div className="mb-12">
<MainCard>
<div className="flex">
<div className="w-8/12 lg:w-9/12 relative mr-16">
<PersonHeader avatar={testData.person_view.person.avatar} is_admin={testData.person_view.is_admin} name={testData.person_view.person.display_name} banner={testData.person_view.person.banner} />
<PersonBio bio={testData.person_view.person.bio} />
</div>
<div className="w-4/12 lg:w-3/12 relative">
<ModeratesList moderates={testData.moderates as ModeratesProps[]} />
</div>
<div className="mb-12">
<MainCard>
<div className="flex">
<div className="w-8/12 lg:w-9/12 relative mr-16">
<PersonHeader
avatar={testData.person_view.person.avatar}
is_admin={testData.person_view.is_admin}
name={testData.person_view.person.display_name}
banner={testData.person_view.person.banner}
/>
<PersonBio bio={testData.person_view.person.bio} />
</div>
<div className="w-4/12 lg:w-3/12 relative">
<ModeratesList moderates={testData.moderates as ModeratesProps[]} />
</div>
</div>
</MainCard>
</div>
</MainCard>
</div>
<MainCard>
<PersonDetailSelection posts={testData.posts as any} comments={testData.comments as any} />
</MainCard>
<MainCard>
<PersonDetailSelection />
</MainCard>
</div>
);
);

export default User;
60 changes: 30 additions & 30 deletions src/components/person-comments-posts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import React from 'react';
import Link from 'next/link';
import { Components } from 'react-markdown';
import {
Tabs,
TabsHeader,
TabsBody,
Tab,
TabPanel,
} from "@/utils/TailwindMaterial";

import { LinkText } from '../text';
TabPanel
} from '@/utils/TailwindMaterial';

const tabs = [
{ label: 'Posts', value: 'posts' },
{ label: 'Comments', value: 'comments' },
]
{ label: 'Comments', value: 'comments' }
];

// @todo: implement posts and comments
export const PersonDetailSelection = ({ posts, comments }: { posts: {}[], comments: {}[] }) =>
(<div className="mt-24 text-gray-600 dark:text-gray-200 text-sm">
<Tabs value="posts" >
<TabsHeader
indicatorProps={{
className: "bg-gray-900/10 shadow-none !text-gray-900",
}}>
{tabs.map(({ label, value }) => (
<Tab key={value} value={value}>
{label}
</Tab>
))}
</TabsHeader>
<TabsBody>
{tabs.map(({ value }) => (
<TabPanel key={value} value={value} className="">
TODO: {value}
</TabPanel>
))}
</TabsBody>
</Tabs>
</div>)
export const PersonDetailSelection = () => (
<div className="mt-24 text-gray-600 dark:text-gray-200 text-sm">
<Tabs value="posts">
<TabsHeader
indicatorProps={{
className: 'bg-gray-900/10 shadow-none !text-gray-900'
}}
>
{tabs.map(({ label, value }) => (
<Tab key={value} value={value}>
{label}
</Tab>
))}
</TabsHeader>
<TabsBody>
{tabs.map(({ value }) => (
<TabPanel key={value} value={value} className="">
TODO:
{' '}
{value}
</TabPanel>
))}
</TabsBody>
</Tabs>
</div>
);

0 comments on commit e417324

Please sign in to comment.