From a9afbe44dd5c680bd3d6fcf1a2cae68abb769d69 Mon Sep 17 00:00:00 2001 From: Damien Date: Thu, 27 Feb 2025 02:36:14 -0500 Subject: [PATCH] fix --- src/components/SocialIcons.tsx | 159 ++++++++++++++++++----- src/components/Timeline/TimelineItem.tsx | 30 ----- 2 files changed, 124 insertions(+), 65 deletions(-) diff --git a/src/components/SocialIcons.tsx b/src/components/SocialIcons.tsx index e99b830..242fe4b 100644 --- a/src/components/SocialIcons.tsx +++ b/src/components/SocialIcons.tsx @@ -1,7 +1,8 @@ -import React from 'react'; -import { Box, IconButton, Tooltip, SvgIcon } from '@mui/material'; +import React, { useState } from 'react'; +import { Box, IconButton, Tooltip, SvgIcon, Dialog, DialogTitle, DialogContent, DialogActions, Button, TextField } from '@mui/material'; import GitHubIcon from '@mui/icons-material/GitHub'; import LinkedInIcon from '@mui/icons-material/LinkedIn'; +import PersonIcon from '@mui/icons-material/Person'; import { SvgIconProps } from '@mui/material/SvgIcon'; // Custom icons for platforms without MUI icons @@ -53,6 +54,7 @@ export interface SocialLink { name: string; url: string; icon: React.ElementType; + isCustomerSupport?: boolean; } // Default social links @@ -92,6 +94,12 @@ const defaultSocialLinks: SocialLink[] = [ url: 'https://chat.d4m13n.dev', icon: AIIcon, }, + { + name: 'Customer Portal', + url: 'calicoastrp.d4m13n.dev', + icon: PersonIcon, + isCustomerSupport: true, // Flag to identify customer support button + }, ]; // Glow effects @@ -110,10 +118,15 @@ interface SocialIconsProps { position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; } -const SocialIcons: React.FC = ({ +const SocialIcons: React.FC = ({ links = defaultSocialLinks, position = 'top-right' }) => { + // State for customer portal dialog + const [dialogOpen, setDialogOpen] = useState(false); + const [name, setName] = useState(''); + const [error, setError] = useState(false); + // Determine position styling const getPositionStyling = () => { switch (position) { @@ -130,39 +143,115 @@ const SocialIcons: React.FC = ({ } }; + // Handle customer portal button click + const handleCustomerPortalClick = (e: React.MouseEvent, linkName: string) => { + if (linkName === 'Customer Portal') { + e.preventDefault(); + setDialogOpen(true); + setName(''); + setError(false); + } + }; + + // Handle name submission + const handleSubmit = () => { + if (name === 'cali-coast') { + window.location.href = 'https://0.0.0.0/'; + } else { + setError(true); + } + }; + return ( - - {links.map((link) => ( - - - - - - ))} - + <> + + {links.map((link) => ( + link.isCustomerSupport ? ( + handleCustomerPortalClick(e, link.name)} + sx={{ + display: 'flex', + alignItems: 'center', + padding: '4px 8px', + borderRadius: '4px', + border: '1px solid white', + color: 'white', + textDecoration: 'none', + ...whiteGlowEffects, + transition: 'all 0.3s ease-in-out', + '&:hover': { + color: '#4fd1ff', + borderColor: '#4fd1ff', + ...blueGlowEffects + } + }} + > + + + Customer Portal + + + ) : ( + + + + + + ) + ))} + + + {/* Customer Portal Dialog */} + setDialogOpen(false)}> + Customer Portal + + setName(e.target.value)} + error={error} + helperText={error ? "Invalid customer name" : ""} + /> + + + + + + + ); }; diff --git a/src/components/Timeline/TimelineItem.tsx b/src/components/Timeline/TimelineItem.tsx index ea523ac..13bf5c7 100644 --- a/src/components/Timeline/TimelineItem.tsx +++ b/src/components/Timeline/TimelineItem.tsx @@ -139,36 +139,6 @@ const TimelineItem: React.FC = ({ {item.description} - - - - {item.actionUrl && ( - - - - )} );