From ee47d3b8beb376b24df0bb0da303247b132523d8 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 20:15:26 +0000 Subject: [PATCH] Fix copy link for Neighbor Sum Avoidance --- src/components/NeighborSumAvoidance.tsx | 5 +++-- src/pages/theme-pages/discrete-math/Graphs.tsx | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/NeighborSumAvoidance.tsx b/src/components/NeighborSumAvoidance.tsx index 6aee214..1defb8e 100644 --- a/src/components/NeighborSumAvoidance.tsx +++ b/src/components/NeighborSumAvoidance.tsx @@ -11,9 +11,10 @@ import SocialShare from '@/components/SocialShare'; interface NeighborSumAvoidanceProps { showSocialShare?: boolean; + shareUrl?: string; } -const NeighborSumAvoidance = ({ showSocialShare = false }: NeighborSumAvoidanceProps) => { +const NeighborSumAvoidance = ({ showSocialShare = false, shareUrl }: NeighborSumAvoidanceProps) => { const [numberCount, setNumberCount] = useState(9); const [mode, setMode] = useState<'default' | 'guided'>('default'); const [isActive, setIsActive] = useState(false); @@ -383,7 +384,7 @@ const NeighborSumAvoidance = ({ showSocialShare = false }: NeighborSumAvoidanceP {showSocialShare && (
diff --git a/src/pages/theme-pages/discrete-math/Graphs.tsx b/src/pages/theme-pages/discrete-math/Graphs.tsx index c033615..c96c216 100644 --- a/src/pages/theme-pages/discrete-math/Graphs.tsx +++ b/src/pages/theme-pages/discrete-math/Graphs.tsx @@ -11,7 +11,8 @@ interface Interactive { title: string; description: string; tags: string[]; - component: React.ComponentType<{ showSocialShare?: boolean }>; + path: string; + component: React.ComponentType<{ showSocialShare?: boolean; shareUrl?: string }>; } const interactives: Interactive[] = [ @@ -20,6 +21,7 @@ const interactives: Interactive[] = [ title: 'Neighbor Sum Avoidance', description: 'Arrange numbers 1-9 in a circle so that the sum of two neighbors is never divisible by 3, 5, or 7. Two modes: default and guided!', tags: ['graphs', 'cycles', 'constraints', 'puzzle', 'graph-theory'], + path: '/themes/discrete-math/graphs/neighbor-sum-avoidance', component: NeighborSumAvoidance }, ]; @@ -36,6 +38,7 @@ const Graphs = () => { if (selectedInteractive) { const InteractiveComponent = selectedInteractive.component; + const shareUrl = `${window.location.origin}${selectedInteractive.path}`; return (
@@ -47,7 +50,7 @@ const Graphs = () => { ← Back to Graphs
- +
);