From d484fb56649cdd5e44fc8a29566914455a58dcfa Mon Sep 17 00:00:00 2001 From: rathi Date: Wed, 4 Dec 2024 23:39:14 -0500 Subject: [PATCH] re-debugging --- netlify.toml | 11 + src/components/ShareButtons.tsx | 60 ----- src/components/ui/calendar.tsx | 4 +- src/components/ui/chart.tsx | 368 ----------------------------- src/components/ui/toast.tsx | 12 +- src/pages/NetworkVisualization.tsx | 27 ++- src/pages/SocialClass.tsx | 1 - src/pages/SuccessStories.tsx | 1 - src/pages/Timeline.tsx | 2 +- src/pages/Vendors.tsx | 4 +- 10 files changed, 40 insertions(+), 450 deletions(-) create mode 100644 netlify.toml delete mode 100644 src/components/ShareButtons.tsx delete mode 100644 src/components/ui/chart.tsx diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..3b956f1 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,11 @@ +[build] + command = "npm run build" + publish = "dist" + +[build.environment] + NODE_VERSION = "18.20.5" + +[[redirects]] + from = "/*" + to = "/index.html" + status = 200 diff --git a/src/components/ShareButtons.tsx b/src/components/ShareButtons.tsx deleted file mode 100644 index 371383c..0000000 --- a/src/components/ShareButtons.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; -import { BlogPost } from '../data/blogPosts'; - -interface ShareButtonsProps { - post: BlogPost; -} - -export const ShareButtons: React.FC = ({ post }) => { - const url = window.location.href; - const title = `Check out ${post.character}'s blog post: ${post.title}`; - - const shareLinks = [ - { - name: 'Twitter', - url: `https://twitter.com/intent/tweet?text=${encodeURIComponent(title)}&url=${encodeURIComponent(url)}`, - icon: ( - - - - ), - color: 'text-blue-400 hover:text-blue-600', - }, - { - name: 'Facebook', - url: `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(url)}`, - icon: ( - - - - ), - color: 'text-blue-600 hover:text-blue-800', - }, - { - name: 'Reddit', - url: `https://reddit.com/submit?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}`, - icon: ( - - - - ), - color: 'text-orange-500 hover:text-orange-700', - }, - ]; - - return ( -
- Share: - {shareLinks.map((link) => ( - - ))} -
- ); -}; diff --git a/src/components/ui/calendar.tsx b/src/components/ui/calendar.tsx index 1b7bc45..1c59433 100644 --- a/src/components/ui/calendar.tsx +++ b/src/components/ui/calendar.tsx @@ -58,8 +58,8 @@ function Calendar({ ...classNames, }} components={{ - IconLeft: ({ ...props }) => , - IconRight: ({ ...props }) => , + IconLeft: () => , + IconRight: () => , }} {...props} /> diff --git a/src/components/ui/chart.tsx b/src/components/ui/chart.tsx deleted file mode 100644 index 13c1bd3..0000000 --- a/src/components/ui/chart.tsx +++ /dev/null @@ -1,368 +0,0 @@ -import * as React from 'react'; -import * as RechartsPrimitive from 'recharts'; -import { - NameType, - Payload, - ValueType, -} from 'recharts/types/component/DefaultTooltipContent'; - -import { cn } from '@/lib/utils'; - -// Format: { THEME_NAME: CSS_SELECTOR } -const THEMES = { light: '', dark: '.dark' } as const; - -export type ChartConfig = { - [k in string]: { - label?: React.ReactNode; - icon?: React.ComponentType; - } & ( - | { color?: string; theme?: never } - | { color?: never; theme: Record } - ); -}; - -type ChartContextProps = { - config: ChartConfig; -}; - -const ChartContext = React.createContext(null); - -function useChart() { - const context = React.useContext(ChartContext); - - if (!context) { - throw new Error('useChart must be used within a '); - } - - return context; -} - -const ChartContainer = React.forwardRef< - HTMLDivElement, - React.ComponentProps<'div'> & { - config: ChartConfig; - children: React.ComponentProps< - typeof RechartsPrimitive.ResponsiveContainer - >['children']; - } ->(({ id, className, children, config, ...props }, ref) => { - const uniqueId = React.useId(); - const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`; - - return ( - -
- - - {children} - -
-
- ); -}); -ChartContainer.displayName = 'Chart'; - -const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => { - const colorConfig = Object.entries(config).filter( - ([_, config]) => config.theme || config.color - ); - - if (!colorConfig.length) { - return null; - } - - return ( -