From 31f4baba407239c28c5f5eec45180dee252e1aa1 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Sat, 29 Apr 2023 23:24:28 -0500 Subject: [PATCH] add nicep and do saner exports in layout index --- src/components/layout/index.tsx | 56 ++++++++++++++------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/src/components/layout/index.tsx b/src/components/layout/index.tsx index 6044e18..a8a6097 100644 --- a/src/components/layout/index.tsx +++ b/src/components/layout/index.tsx @@ -4,20 +4,27 @@ import { Button, ButtonLink } from "./Button" import { Separator } from "@kobalte/core" import { useMegaStore } from "~/state/megaStore" -const SmallHeader: ParentComponent<{ class?: string }> = (props) => { +export { + Button, + ButtonLink, + Linkify, +} + +export const SmallHeader: ParentComponent<{ class?: string }> = (props) => { return
{props.children}
} -const Card: ParentComponent<{ title?: string }> = (props) => { +export const Card: ParentComponent<{ title?: string, titleElement?: JSX.Element }> = (props) => { return (
{props.title && {props.title}} + {props.titleElement && props.titleElement} {props.children}
) } -const InnerCard: ParentComponent<{ title?: string }> = (props) => { +export const InnerCard: ParentComponent<{ title?: string }> = (props) => { return (
{props.title && {props.title}} @@ -26,7 +33,7 @@ const InnerCard: ParentComponent<{ title?: string }> = (props) => { ) } -const FancyCard: ParentComponent<{ title?: string, tag?: JSX.Element }> = (props) => { +export const FancyCard: ParentComponent<{ title?: string, tag?: JSX.Element }> = (props) => { return (
@@ -38,7 +45,7 @@ const FancyCard: ParentComponent<{ title?: string, tag?: JSX.Element }> = (props ) } -const SafeArea: ParentComponent = (props) => { +export const SafeArea: ParentComponent = (props) => { return (
{/*
*/} @@ -48,7 +55,7 @@ const SafeArea: ParentComponent = (props) => { ) } -const DefaultMain: ParentComponent = (props) => { +export const DefaultMain: ParentComponent = (props) => { return (
{props.children} @@ -56,7 +63,7 @@ const DefaultMain: ParentComponent = (props) => { ) } -function FullscreenLoader() { +export const FullscreenLoader = () => { return (
@@ -64,7 +71,7 @@ function FullscreenLoader() { ); } -const NodeManagerGuard: ParentComponent = (props) => { +export const NodeManagerGuard: ParentComponent = (props) => { const [state, _] = useMegaStore(); return ( }> @@ -75,7 +82,7 @@ const NodeManagerGuard: ParentComponent = (props) => { ) } -const LoadingSpinner = (props: { big?: boolean, wide?: boolean }) => { +export const LoadingSpinner = (props: { big?: boolean, wide?: boolean }) => { return (
); } -const Hr = () => +export const Hr = () => -const LargeHeader: ParentComponent = (props) => { +export const LargeHeader: ParentComponent = (props) => { return (

{props.children}

) } -const VStack: ParentComponent<{ biggap?: boolean }> = (props) => { +export const VStack: ParentComponent<{ biggap?: boolean }> = (props) => { return (
{props.children}
) } -const HStack: ParentComponent<{ biggap?: boolean }> = (props) => { +export const HStack: ParentComponent<{ biggap?: boolean }> = (props) => { return (
{props.children}
) } -const SmallAmount: ParentComponent<{ amount: number | bigint }> = (props) => { +export const SmallAmount: ParentComponent<{ amount: number | bigint }> = (props) => { return (

{props.amount.toLocaleString()} SATS

) } @@ -107,22 +114,5 @@ export const NiceP: ParentComponent = (props) => { return (

{props.children}

) } -export { - SmallHeader, - Card, - SafeArea, - LoadingSpinner, - Button, - ButtonLink, - Linkify, - Hr, - NodeManagerGuard, - FullscreenLoader, - InnerCard, - FancyCard, - DefaultMain, - LargeHeader, - VStack, - HStack, - SmallAmount -} + +