chore(asf): disable calendar display by default, click to show (#28048)

This commit is contained in:
Evan Rusackas
2024-04-16 17:25:42 -06:00
committed by GitHub
parent 594e5a50a3
commit 19170d94c8

View File

@@ -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';
@@ -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"
@@ -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>