src/containers/Homepage/NarrowFacebookFeed.tsx
import { ContentContext } from 'src/providers/Content.provider';
import { useContext } from 'react';
import type { Ibook } from 'src/providers/utils';
import PicSlider from '../../components/PicSlider';
import { shuffle } from './About';
const FacebookIframe = () => (
<>
<p style={{
textAlign: 'center', fontSize: '10pt', marginTop: '10px', marginBottom: 0, paddingBottom: '4px',
}}
>
<i>
Like Us On
{' '}
<a style={{ fontSize: '10pt' }} href="https://www.facebook.com/CollegeLutheranChurch/">Facebook</a>
</i>
</p>
<div style={{ maxWidth: '300px', margin: 'auto', marginBottom: 0 }}>
<iframe
title="clc-facebook" /* eslint-disable-next-line max-len */
src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FCollegeLutheranChurch&width=300&height=500&colorscheme=light&show_faces=false&header=true&stream=true&show_border=false"
width="300"
height="300"
style={{ border: 'none', overflow: 'hidden' }}
scrolling="no"
frameBorder="0"
allow="encrypted-media"
/>
</div>
</>
);
export function FamilySlideContainer({ data }: { data: Ibook[] }) {
return (
<div className="familySlideContainer">
<div
id="familySlideshowWide"
style={{
display: 'flex', flexDirection: 'column', marginTop: '1px', marginRight: 0,
}}
>
{data && data.length > 0 ? (<PicSlider data={data} />) : null}
</div>
</div>
);
}
export const FacebookFeed = (): JSX.Element => {
const { pictures } = useContext(ContentContext);
const {
familyPics = [], musicPics = [], youthPics = [], otherPics = [], habitatPics = [],
} = pictures;
const allPics = familyPics.concat(youthPics).concat(habitatPics).concat(otherPics).concat(musicPics);
const data = shuffle(allPics);
return (
<div className="notWidescreen" style={{ maxWidth: '320px', margin: 'auto' }}>
<p style={{
textAlign: 'center', fontSize: '10pt', marginTop: 0, marginBottom: 0, paddingBottom: '2px',
}}
>
<a style={{ fontSize: '10pt' }} href="/calendar">
<i>View Full Calendar</i>
</a>
</p>
<div style={{ maxWidth: '300px', margin: 'auto', marginBottom: 0 }}>
<iframe
title="clc-calendar"/* eslint-disable-next-line max-len */
src="https://calendar.google.com/calendar/embed?title=College%20Lutheran%20Events%20Calendar&showNav=0&showDate=0&showPrint=0&showTabs=0&showCalendars=0&mode=AGENDA&height=500&wkst=1&bgcolor=%23FFFFFF&src=ra8um2u26p59a2t92lfooq4els%40group.calendar.google.com&color=%23060D5E&ctz=America%2FNew_York"
style={{ borderWidth: 0 }}
width="300"
height="300"
frameBorder="0"
scrolling="no"
/>
</div>
<hr />
<FacebookIframe />
<hr />
<p style={{
textAlign: 'center', fontSize: '10pt', marginTop: '10px', marginBottom: 0, paddingBottom: '4px',
}}
>
{' '}
</p>
<FamilySlideContainer data={data} />
</div>
);
};