<commit_before>import React from 'react'
import { object, string, bool, shape } from 'prop-types'
import Helmet from 'react-helmet'
import Header from '../components/Header/Header'
import Menu from '../components/menu/Menu'
import Sidebar from '../components/Sidebar'
import favicon from '../assets/favicon.ico'
import { StaticQuery, graphql } from "gatsby"
import '../styles/scss/main.scss'

const MainLayoutWrapper = ({children, displaySidebar, page: { title, description }}) => (
	<StaticQuery
		query={graphql`
			query RootLayoutQuery {
				site {
					siteMetadata {
						title
						about
					}
				}
		
				allMarkdownRemark(
					sort: { fields: [frontmatter___date], order: DESC }
					limit: 7
				) {
					edges {
						node {
							timeToRead
							frontmatter {
								title
								path
								date(formatString: "MMMM DD, YYYY")
								author {
									name
									link
									avatar
								}
								image {
									feature
									thumbnail
									teaser
								}
								tags
							}
						}
					}
				}

				authorsJson {
					social {
						name
						link
					}
				}

				dataJson{
					location {
						town
						country
					}
					email
					emailAlias
				}				
			}
		`}
		render={({ 
			site: { 
				siteMetadata: { title, about } 
			}, 
			allMarkdownRemark: { edges: miniPosts }, 
			authorsJson: { social },
			dataJson: {
				location : {
					town,
					country
				},
				email,
				emailAlias,
			}
		}) => (
			<>
				<Helmet
					title={title ? `${title} - ${title}` : title}
					meta={[
						{ name: 'description', content: 'LJournal, a simple blog' },
						{
							name: 'keywords',
							content: 'data, Lusina, Brian Lusina, code, bugs, algorithms',
						},
					]}
					link={[{ rel: 'shortcut icon', type: 'image/png', href: `${favicon}` }]}
				/>
				<div id="wrapper">
					<Header />
					<Menu />
					<div id="main">{children}</div>
					{ 
						displaySidebar && 
						<Sidebar 
							miniPosts={miniPosts} 
							about={about} 
							socialLinks={social}
							contact={{
								town, 
								country,
								email,
								emailAlias,
							}}
							pageDesc={description}
						/>
					}
				</div>
			</>
		)}
	/>
)

MainLayoutWrapper.defaultProps = {
	displaySidebar: true,
	page: {
		title: null,
		description: null
	}
}

/**
 * Prop Type validation
 */
MainLayoutWrapper.propTypes = {
	children: object,
	displaySidebar: bool,
	page: shape({
		title: string,
		description: string,
	}),
}

export default MainLayoutWrapper
<commit_msg>update prop types in main layout<commit_after>import React from 'react'
import { object, string, bool, shape, oneOfType, array } from 'prop-types'
import Helmet from 'react-helmet'
import Header from '../components/Header/Header'
import Menu from '../components/menu/Menu'
import Sidebar from '../components/Sidebar'
import favicon from '../assets/favicon.ico'
import { StaticQuery, graphql } from "gatsby"
import '../styles/scss/main.scss'

const MainLayoutWrapper = ({children, displaySidebar, page: { title, description }}) => (
	<StaticQuery
		query={graphql`
			query RootLayoutQuery {
				site {
					siteMetadata {
						title
						about
					}
				}
		
				allMarkdownRemark(
					sort: { fields: [frontmatter___date], order: DESC }
					limit: 7
				) {
					edges {
						node {
							timeToRead
							frontmatter {
								title
								path
								date(formatString: "MMMM DD, YYYY")
								author {
									name
									link
									avatar
								}
								image {
									feature
									thumbnail
									teaser
								}
								tags
							}
						}
					}
				}

				authorsJson {
					social {
						name
						link
					}
				}

				dataJson{
					location {
						town
						country
					}
					email
					emailAlias
				}				
			}
		`}
		render={({ 
			site: { 
				siteMetadata: { title, about } 
			}, 
			allMarkdownRemark: { edges: miniPosts }, 
			authorsJson: { social },
			dataJson: {
				location : {
					town,
					country
				},
				email,
				emailAlias,
			}
		}) => (
			<>
				<Helmet
					title={title ? `${title} - ${title}` : title}
					meta={[
						{ name: 'description', content: 'LJournal, a simple blog' },
						{
							name: 'keywords',
							content: 'data, Lusina, <NAME>, code, bugs, algorithms',
						},
					]}
					link={[{ rel: 'shortcut icon', type: 'image/png', href: `${favicon}` }]}
				/>
				<div id="wrapper">
					<Header />
					<Menu />
					<div id="main">{children}</div>
					{ 
						displaySidebar && 
						<Sidebar 
							miniPosts={miniPosts} 
							about={about} 
							socialLinks={social}
							contact={{
								town, 
								country,
								email,
								emailAlias,
							}}
							pageDesc={description}
						/>
					}
				</div>
			</>
		)}
	/>
)

MainLayoutWrapper.defaultProps = {
	displaySidebar: true,
	page: {
		title: null,
		description: null
	}
}

/**
 * Prop Type validation
 */
MainLayoutWrapper.propTypes = {
	children: oneOfType([object, array]),
	displaySidebar: bool,
	page: shape({
		title: string,
		description: string,
	}),
}

export default MainLayoutWrapper

{'fraction_non_alphanumeric': 0.12834537995702286, 'fraction_numerical': 0.0003907013088493846, 'mean_word_length': 1.8635346756152125, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1751417', 'n_tokens_mistral': 2538, 'n_tokens_neox': 1617, 'n_words': 367}