Skip to content

Commit

Permalink
chore(asf): disable calendar display by default, click to show (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
rusackas authored Apr 16, 2024
1 parent fc95464 commit 29ec27b
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions docs/src/pages/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import React, { useState } from 'react';
import styled from '@emotion/styled';
import { List } from 'antd';
import Layout from '@theme/Layout';
Expand Down Expand Up @@ -179,7 +179,19 @@ const StyledLink = styled('a')`
}
`;

const FinePrint = styled('div')`
font-size: 14px;
color: var(--ifm-secondary-text);
`

const Community = () => {

const [showCalendar, setShowCalendar] = useState(false); // State to control calendar visibility

const toggleCalendar = () => {
setShowCalendar(!showCalendar); // Toggle calendar visibility
};

return (
<Layout
title="Community"
Expand Down Expand Up @@ -238,14 +250,22 @@ const Community = () => {
<img src="/img/calendar-icon.svg" alt="calendar-icon" />
Subscribe to the Superset Community Calendar
</StyledLink>
<br />
<StyledLink onClick={toggleCalendar}>
<img src="/img/calendar-icon.svg" alt="calendar-icon" />
{showCalendar ? 'Hide Calendar' : 'Display Calendar*'}
</StyledLink>
{!showCalendar && <FinePrint><sup>*</sup>Clicking on this link will load and send data from and to Google.</FinePrint>}
</>
}
/>
<StyledCalendarIframe
src="https://calendar.google.com/calendar/embed?src=superset.committers%40gmail.com&ctz=America%2FLos_Angeles"
frameBorder="0"
scrolling="no"
/>
{showCalendar && (
<StyledCalendarIframe
src="https://calendar.google.com/calendar/embed?src=superset.committers%40gmail.com&ctz=America%2FLos_Angeles"
frameBorder="0"
scrolling="no"
/>
)}
</BlurredSection>
</main>
</Layout>
Expand Down

0 comments on commit 29ec27b

Please sign in to comment.