Skip to content

Commit

Permalink
For review
Browse files Browse the repository at this point in the history
  • Loading branch information
Pdzly committed Dec 13, 2023
1 parent 3c5ccfd commit 66d8c21
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/app/user/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PersonBio, PersonHeader } from '@/components/person-detail';

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

const User = () => (
Expand All @@ -17,7 +17,7 @@ const User = () => (
<PersonBio bio={testData.person_view.person.bio} />
</div>
<div className="w-4/12 lg:w-3/12 relative">
<ModeratesList moderates={testData.moderates as any} />
<ModeratesList moderates={testData.moderates as ModeratesProps[]} />
</div>
</div>
</MainCard>
Expand Down
19 changes: 17 additions & 2 deletions src/components/moderates-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import Image from 'next/image';
import Link from 'next/link';
import { H1 } from '../text';

export const ModeratesListItem = ({ communityName, communityAvatar, url }: { communityName: string, communityAvatar: string | undefined, url: string }) => (
interface ModeratesListItemProps {
communityName: string;
communityAvatar: string | undefined;
url: string;
}

export const ModeratesListItem = ({ communityName, communityAvatar, url }: ModeratesListItemProps) => (
<Link className="flex gap-12 relative center items-center" href={url}>
{communityAvatar && <Image
src={communityAvatar}
Expand All @@ -17,7 +23,16 @@ export const ModeratesListItem = ({ communityName, communityAvatar, url }: { com
</Link>
)

export const ModeratesList = ({ moderates }: { moderates: { community: { title: string, actor_id: string, icon: string, } }[] }) => (
export interface ModeratesProps {
community: {
title: string,
actor_id: string,
icon?: string,
}

}

export const ModeratesList = ({ moderates }: {moderates: ModeratesProps[]}) => (
<div className="w-full border-l-2 pl-16 ">
<H1 className="mb-4 border-collapse border-b dark:border-gray-400 border-gray-800">Moderates:</H1>
<div className="max-h-500 overflow-y-scroll">
Expand Down
15 changes: 11 additions & 4 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Config } from 'tailwindcss';
import withMT from '@material-tailwind/react/utils/withMT';

const spacing = {
0: '0',
Expand Down Expand Up @@ -37,8 +36,8 @@ const config: Config = {
content: [
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
"path-to-your-node_modules/@material-tailwind/react/components/**/*.{js,ts,jsx,tsx}",
"path-to-your-node_modules/@material-tailwind/react/theme/components/**/*.{js,ts,jsx,tsx}",
'node_modules/@material-tailwind/react/components/**/*.{js,ts,jsx,tsx}',
'node_modules/@material-tailwind/react/theme/components/**/*.{js,ts,jsx,tsx}',
],
theme: {
spacing,
Expand All @@ -50,6 +49,14 @@ const config: Config = {
...spacing,
full: '100%'
},
minHeight: {
...spacing,
full: '100%'
},
minWidth: {
...spacing,
full: '100%'
},
extend: {
colors: {
brand: {
Expand All @@ -75,4 +82,4 @@ const config: Config = {
plugins: []
};

export default withMT(config);
export default config;

0 comments on commit 66d8c21

Please sign in to comment.