WIP
This commit is contained in:
@@ -11,76 +11,31 @@ interface TabProps extends DefaultDivProps {
|
||||
}[];
|
||||
}
|
||||
|
||||
export const Tabs = ({ tabs }: TabProps) => {
|
||||
// let [categories] = useState({
|
||||
// Recent: [
|
||||
// {
|
||||
// id: 1,
|
||||
// title: 'Does drinking coffee make you smarter?',
|
||||
// date: '5h ago',
|
||||
// commentCount: 5,
|
||||
// shareCount: 2,
|
||||
// },
|
||||
// {
|
||||
// id: 2,
|
||||
// title: "So you've bought coffee... now what?",
|
||||
// date: '2h ago',
|
||||
// commentCount: 3,
|
||||
// shareCount: 2,
|
||||
// },
|
||||
// ],
|
||||
// Popular: [
|
||||
// {
|
||||
// id: 1,
|
||||
// title: 'Is tech making coffee better or worse?',
|
||||
// date: 'Jan 7',
|
||||
// commentCount: 29,
|
||||
// shareCount: 16,
|
||||
// },
|
||||
// {
|
||||
// id: 2,
|
||||
// title: 'The most innovative things happening in coffee',
|
||||
// date: 'Mar 19',
|
||||
// commentCount: 24,
|
||||
// shareCount: 12,
|
||||
// },
|
||||
// ],
|
||||
// Trending: [
|
||||
// {
|
||||
// id: 1,
|
||||
// title: 'Ask Me Anything: 10 answers to your questions about coffee',
|
||||
// date: '2d ago',
|
||||
// commentCount: 9,
|
||||
// shareCount: 5,
|
||||
// },
|
||||
// {
|
||||
// id: 2,
|
||||
// title: "The worst advice we've ever heard about coffee",
|
||||
// date: '4d ago',
|
||||
// commentCount: 1,
|
||||
// shareCount: 2,
|
||||
// },
|
||||
// ],
|
||||
// })
|
||||
|
||||
export const Tabs = ({ tabs, className, ...props }: TabProps): JSX.Element => {
|
||||
return (
|
||||
<Tab.Group as="div">
|
||||
<Tab.List className="flex p-2 space-x-2 border shadow-md rounded-t-3xl dark:border-gray-600">
|
||||
<Tab.Group as="div" className={className}>
|
||||
<Tab.List className="flex border-l border-r border-t shadow-md rounded-t-3xl dark:border-gray-600">
|
||||
{tabs.map((tab) => (
|
||||
<Tab
|
||||
key={tab.name}
|
||||
className={({ selected }) => `w-full text-lg font-medium`}
|
||||
className={({ selected }): string =>
|
||||
`w-full text-lg font-medium p-2 border-b-2 ${
|
||||
selected
|
||||
? 'dark:border-gray-200 border-gray-600'
|
||||
: 'border-transparent dark:border-transparent'
|
||||
}`
|
||||
}
|
||||
>
|
||||
{tab.name}
|
||||
</Tab>
|
||||
))}
|
||||
</Tab.List>
|
||||
<Tab.Panels>
|
||||
<Tab.Panels className="h-full">
|
||||
{tabs.map((tab, index) => (
|
||||
<Tab.Panel
|
||||
key={index}
|
||||
className={
|
||||
'border dark:border-gray-600 rounded-b-3xl p-2 h-80 shadow-md'
|
||||
'border dark:border-gray-600 rounded-b-3xl p-4 h-full shadow-md'
|
||||
}
|
||||
>
|
||||
{tab.body}
|
||||
|
||||
@@ -19,7 +19,7 @@ export const MobileNav = (): JSX.Element => {
|
||||
dispatch(closeMobileNav());
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-col w-64">
|
||||
<div className="flex flex-col">
|
||||
<div className="m-auto my-6">
|
||||
<Logo />
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@ export const Navigation = ({
|
||||
const route = useRoute();
|
||||
return (
|
||||
<div
|
||||
className={`h-16 px-4 md:space-x-2 space-y-2 md:space-y-0 ${className}`}
|
||||
className={`px-4 md:space-x-2 space-y-2 md:space-y-0 ${className}`}
|
||||
{...props}
|
||||
>
|
||||
<div onClick={onClick}>
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
import Avatar from 'boring-avatars';
|
||||
|
||||
import type { Protobuf } from '@meshtastic/meshtasticjs';
|
||||
|
||||
type DefaultDivProps = JSX.IntrinsicElements['div'];
|
||||
|
||||
export interface NodeProps extends DefaultDivProps {
|
||||
node: Protobuf.NodeInfo;
|
||||
}
|
||||
|
||||
export const Node = ({ node, ...props }: NodeProps): JSX.Element => {
|
||||
return (
|
||||
<div
|
||||
{...props}
|
||||
className="flex items-center w-full p-2 mt-6 space-x-4 border rounded-md shadow-md dark:bg-primaryDark dark:border-gray-600 dark:text-white hover:bg-gray-200 dark:hover:bg-gray-900"
|
||||
>
|
||||
<Avatar
|
||||
size={30}
|
||||
name={node.user?.longName ?? 'UNK'}
|
||||
variant="beam"
|
||||
colors={['#213435', '#46685B', '#648A64', '#A6B985', '#E1E3AC']}
|
||||
/>
|
||||
<div>{node.user?.longName}</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -17,7 +17,7 @@ export const PrimaryTemplate = ({
|
||||
}: PrimaryTemplateProps): JSX.Element => {
|
||||
return (
|
||||
<div className="flex flex-col flex-auto min-w-0">
|
||||
<div className="flex px-6 py-2 bg-white border-b md:p-6 md:flex-row flex-0 md:items-center md:justify-between md:py-8 md:px-10 dark:border-gray-600 dark:bg-secondaryDark">
|
||||
<div className="flex p-4 bg-white border-b md:flex-row flex-0 md:items-center md:justify-between md:px-10 dark:border-gray-600 dark:bg-secondaryDark">
|
||||
{button && <div className="pr-2 m-auto md:hidden">{button}</div>}
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex flex-wrap items-center font-medium">
|
||||
@@ -32,11 +32,11 @@ export const PrimaryTemplate = ({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-auto flex-grow p-6 bg-white md:p-10 dark:bg-secondaryDark">
|
||||
<div className="flex-auto flex-grow p-6 bg-white md:p-10 dark:bg-secondaryDark overflow-y-auto">
|
||||
{children}
|
||||
</div>
|
||||
{footer && (
|
||||
<div className="flex p-6 bg-white border-t md:flex-row flex-0 md:items-center md:justify-between md:py-8 md:px-10 dark:border-gray-600 dark:bg-secondaryDark">
|
||||
<div className="flex p-4 bg-white border-t md:flex-row flex-0 md:items-center md:justify-between md:px-10 dark:border-gray-600 dark:bg-secondaryDark">
|
||||
{button && <div className="pr-2 m-auto md:hidden">{button}</div>}
|
||||
<div className="flex-1 min-w-0">{footer}</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user