mirror of https://github.com/apache/superset.git
chore(asf): disable calendar display by default, click to show (#28048)
This commit is contained in:
parent
594e5a50a3
commit
19170d94c8
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { List } from 'antd';
|
import { List } from 'antd';
|
||||||
import Layout from '@theme/Layout';
|
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 Community = () => {
|
||||||
|
|
||||||
|
const [showCalendar, setShowCalendar] = useState(false); // State to control calendar visibility
|
||||||
|
|
||||||
|
const toggleCalendar = () => {
|
||||||
|
setShowCalendar(!showCalendar); // Toggle calendar visibility
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout
|
<Layout
|
||||||
title="Community"
|
title="Community"
|
||||||
|
@ -238,14 +250,22 @@ const Community = () => {
|
||||||
<img src="/img/calendar-icon.svg" alt="calendar-icon" />
|
<img src="/img/calendar-icon.svg" alt="calendar-icon" />
|
||||||
Subscribe to the Superset Community Calendar
|
Subscribe to the Superset Community Calendar
|
||||||
</StyledLink>
|
</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>}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
{showCalendar && (
|
||||||
<StyledCalendarIframe
|
<StyledCalendarIframe
|
||||||
src="https://calendar.google.com/calendar/embed?src=superset.committers%40gmail.com&ctz=America%2FLos_Angeles"
|
src="https://calendar.google.com/calendar/embed?src=superset.committers%40gmail.com&ctz=America%2FLos_Angeles"
|
||||||
frameBorder="0"
|
frameBorder="0"
|
||||||
scrolling="no"
|
scrolling="no"
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</BlurredSection>
|
</BlurredSection>
|
||||||
</main>
|
</main>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
Loading…
Reference in New Issue