Skip to content

Commit 634057e

Browse files
ostermanclaude
andcommitted
feat: Replace community embeds with theme-aware components
- Add CloudPosseSlackEmbed and CloudPosseOfficeHoursEmbed components with automatic theme detection - Update community pages to use new embeds with proper utm_source (cloudposse-docs) - Hide office hours page title for cleaner embed presentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 6e3b92b commit 634057e

7 files changed

Lines changed: 127 additions & 47 deletions

File tree

docs/community/office-hours.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@ title: Office Hours Registration
33
sidebar_position: 3
44
sidebar_label: Office Hours
55
description: Office Hours with Cloud Posse
6+
hide_title: true
67
id: office-hours
78
tags:
89
- office-hours
910
- community
1011
---
11-
import HubspotForm from 'react-hubspot-form'
12+
import CloudPosseOfficeHoursEmbed from '@site/src/components/CloudPosseOfficeHoursEmbed';
1213
import { YouTubePlaylist } from '@codesweetly/react-youtube-playlist';
1314

14-
<HubspotForm
15-
portalId='2197148'
16-
region="na1"
17-
formId='bbcd46fe-0b11-43aa-9214-33f319e52a01'
18-
onSubmit={() => console.log('Submit!')}
19-
onReady={(form) => console.log('Form ready!')}
20-
loading={<div>Loading...</div>}
21-
/>
15+
<CloudPosseOfficeHoursEmbed />
2216

2317
## Past Recordings
2418

docs/community/slack.mdx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,10 @@ tags:
88
- slack
99
- community
1010
---
11+
import CloudPosseSlackEmbed from '@site/src/components/CloudPosseSlackEmbed';
1112

1213
## Join our Slack Community!
1314

1415
Cloud Posse has a great community of active users who are more than willing to help each other. So, join us!
1516

16-
<iframe src="https://slack.cloudposse.com/?theme=dark&background=00000000"
17-
marginWidth="0"
18-
marginHeight="0"
19-
hspace="0"
20-
vspace="0"
21-
width="300"
22-
height="330"
23-
scrolling="no"
24-
frameBorder="0"
25-
className="join-slack"
26-
allowtransparency="true"
27-
style={{ borderRadius: '6px', display: 'flex', marginRight: 'auto', marginLeft: 'auto'}}
28-
></iframe>
17+
<CloudPosseSlackEmbed />

package-lock.json

Lines changed: 37 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React, { useEffect, useState } from 'react';
2+
3+
export default function CloudPosseOfficeHoursEmbed(): JSX.Element {
4+
const [theme, setTheme] = useState<'light' | 'dark'>('dark');
5+
6+
useEffect(() => {
7+
const checkTheme = () => {
8+
const currentTheme = document.documentElement.getAttribute('data-theme');
9+
setTheme(currentTheme === 'dark' ? 'dark' : 'light');
10+
};
11+
12+
checkTheme();
13+
14+
// Watch for theme changes
15+
const observer = new MutationObserver(checkTheme);
16+
observer.observe(document.documentElement, {
17+
attributes: true,
18+
attributeFilter: ['data-theme'],
19+
});
20+
21+
return () => observer.disconnect();
22+
}, []);
23+
24+
const src = `https://cloudposse.com/embed/office-hours?theme=${theme}&bg=transparent&utm_source=cloudposse-docs&utm_medium=embed&utm_campaign=office-hours&utm_content=community-page`;
25+
26+
return (
27+
<iframe
28+
src={src}
29+
style={{
30+
height: '380px',
31+
width: '100%',
32+
maxWidth: '80rem',
33+
borderRadius: '0.375rem',
34+
border: '0',
35+
}}
36+
title="Office Hours Registration"
37+
sandbox="allow-same-origin allow-scripts allow-forms allow-popups"
38+
/>
39+
);
40+
}

0 commit comments

Comments
 (0)