Skip to content

Commit

Permalink
src folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjunBEG committed Mar 2, 2022
1 parent 9854160 commit dcd425c
Show file tree
Hide file tree
Showing 73 changed files with 2,832 additions and 7,789 deletions.
32 changes: 11 additions & 21 deletions src/components/ActionLink.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
import React from 'react';
import _ from 'lodash';

import { Link, withPrefix, classNames } from '../utils';
import {Link, withPrefix, classNames} from '../utils';
import Icon from './Icon';

export default class ActionLink extends React.Component {
render() {
let action = _.get(this.props, 'action', null);
return (
<Link
to={withPrefix(_.get(action, 'url', null))}
{...(_.get(action, 'new_window', null) ? { target: '_blank' } : null)}
{...(_.get(action, 'new_window', null) || _.get(action, 'no_follow', null)
? { rel: (_.get(action, 'new_window', null) ? 'noopener ' : '') + (_.get(action, 'no_follow', null) ? 'nofollow' : '') }
: null)}
className={classNames({
button: _.get(action, 'style', null) !== 'link',
'button-secondary': _.get(action, 'style', null) === 'secondary',
'button-icon': _.get(action, 'style', null) === 'icon'
})}
>
{_.get(action, 'style', null) === 'icon' && _.get(action, 'icon_class', null) ? (
<React.Fragment>
<Icon {...this.props} icon={_.get(action, 'icon_class', null)} />
<span className="screen-reader-text">{_.get(action, 'label', null)}</span>
</React.Fragment>
) : (
_.get(action, 'label', null)
)}
<Link to={withPrefix(_.get(action, 'url', null))}
{...(_.get(action, 'new_window', null) ? ({target: '_blank'}) : null)}
{...((_.get(action, 'new_window', null) || _.get(action, 'no_follow', null)) ? ({rel: (_.get(action, 'new_window', null) ? ('noopener ') : '') + (_.get(action, 'no_follow', null) ? ('nofollow') : '')}) : null)}
className={classNames({'button': _.get(action, 'style', null) !== 'link', 'button-secondary': _.get(action, 'style', null) === 'secondary', 'button-icon': _.get(action, 'style', null) === 'icon'})}>
{((_.get(action, 'style', null) === 'icon') && _.get(action, 'icon_class', null)) ? (<React.Fragment>
<Icon {...this.props} icon={_.get(action, 'icon_class', null)} />
<span className="screen-reader-text">{_.get(action, 'label', null)}</span>
</React.Fragment>) :
_.get(action, 'label', null)
}
</Link>
);
}
Expand Down
26 changes: 9 additions & 17 deletions src/components/CtaButtons.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
import React from 'react';
import _ from 'lodash';

import { Link, withPrefix, classNames } from '../utils';
import {Link, withPrefix, classNames} from '../utils';

export default class CtaButtons extends React.Component {
render() {
let actions = _.get(this.props, 'actions', null);
return _.map(actions, (action, action_idx) => (
<Link
key={action_idx}
to={withPrefix(_.get(action, 'url', null))}
{...(_.get(action, 'new_window', null) ? { target: '_blank' } : null)}
{...(_.get(action, 'new_window', null) || _.get(action, 'no_follow', null)
? { rel: (_.get(action, 'new_window', null) ? 'noopener ' : '') + (_.get(action, 'no_follow', null) ? 'nofollow' : '') }
: null)}
className={classNames({
button: _.get(action, 'style', null) === 'primary' || _.get(action, 'style', null) === 'secondary',
'button-secondary': _.get(action, 'style', null) === 'secondary'
})}
>
{_.get(action, 'label', null)}
</Link>
));
return (
_.map(actions, (action, action_idx) => (
<Link key={action_idx} to={withPrefix(_.get(action, 'url', null))}
{...(_.get(action, 'new_window', null) ? ({target: '_blank'}) : null)}
{...((_.get(action, 'new_window', null) || _.get(action, 'no_follow', null)) ? ({rel: (_.get(action, 'new_window', null) ? ('noopener ') : '') + (_.get(action, 'no_follow', null) ? ('nofollow') : '')}) : null)}
className={classNames({'button': (_.get(action, 'style', null) === 'primary') || (_.get(action, 'style', null) === 'secondary'), 'button-secondary': _.get(action, 'style', null) === 'secondary'})}>{_.get(action, 'label', null)}</Link>
))
);
}
}
77 changes: 28 additions & 49 deletions src/components/DocsMenu.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import _ from 'lodash';

import { getPage, classNames, Link, withPrefix, pathJoin, getPages } from '../utils';
import {getPage, classNames, Link, withPrefix, pathJoin, getPages} from '../utils';
import DocsSubmenu from './DocsSubmenu';

export default class DocsMenu extends React.Component {
Expand All @@ -12,55 +12,34 @@ export default class DocsMenu extends React.Component {
let root_page = getPage(this.props.pageContext.pages, root_docs_path);
return (
<nav id="docs-nav" className="docs-nav">
<div id="docs-nav-inside" className="docs-nav-inside sticky">
<button id="docs-nav-toggle" className="docs-nav-toggle">
Navigate Docs
<span className="icon-angle-right" aria-hidden="true" />
</button>
<div className="docs-nav-menu">
<ul id="docs-menu" className="docs-menu">
<li
className={classNames('docs-menu-item', {
current: _.get(page, 'url', null) === _.get(root_page, 'url', null)
})}
>
<Link to={withPrefix(_.get(root_page, 'url', null))}>{_.get(root_page, 'frontmatter.title', null)}</Link>
</li>
{_.map(_.get(site, 'data.doc_sections.sections', null), (section, section_idx) => {
let section_path = pathJoin(root_docs_path, section);
let section_page = getPage(this.props.pageContext.pages, section_path);
let child_pages = _.orderBy(getPages(this.props.pageContext.pages, section_path), 'frontmatter.weight');
let child_count = _.size(child_pages);
let has_children = child_count > 0 ? true : false;
let is_current_page = _.get(page, 'url', null) === _.get(section_page, 'url', null) ? true : false;
let is_active = _.get(page, 'url', null).startsWith(_.get(section_page, 'url', null));
return (
<React.Fragment key={section_idx + '.1'}>
<li
key={section_idx}
className={classNames('docs-menu-item', {
'has-children': has_children,
current: is_current_page,
active: is_active
})}
>
<Link to={withPrefix(_.get(section_page, 'url', null))}>{_.get(section_page, 'frontmatter.title', null)}</Link>
{has_children && (
<React.Fragment>
<button className="docs-submenu-toggle">
<span className="screen-reader-text">Submenu</span>
<span className="icon-angle-right" aria-hidden="true" />
</button>
<DocsSubmenu {...this.props} child_pages={child_pages} page={page} site={site} />
</React.Fragment>
)}
</li>
</React.Fragment>
);
})}
</ul>
</div>
<div id="docs-nav-inside" className="docs-nav-inside sticky">
<button id="docs-nav-toggle" className="docs-nav-toggle">Navigate Docs<span className="icon-angle-right" aria-hidden="true" /></button>
<div className="docs-nav-menu">
<ul id="docs-menu" className="docs-menu">
<li className={classNames('docs-menu-item', {'current': _.get(page, 'url', null) === _.get(root_page, 'url', null)})}>
<Link to={withPrefix(_.get(root_page, 'url', null))}>{_.get(root_page, 'frontmatter.title', null)}</Link>
</li>
{_.map(_.get(site, 'data.doc_sections.sections', null), (section, section_idx) => {
let section_path = pathJoin(root_docs_path, section);
let section_page = getPage(this.props.pageContext.pages, section_path);
let child_pages = _.orderBy(getPages(this.props.pageContext.pages, section_path), 'frontmatter.weight');
let child_count = _.size(child_pages);
let has_children = (child_count > 0) ? (true) : false;
let is_current_page = (_.get(page, 'url', null) === _.get(section_page, 'url', null)) ? (true) : false;
let is_active = _.get(page, 'url', null).startsWith(_.get(section_page, 'url', null));
return (<React.Fragment key={section_idx + '.1'}>
<li key={section_idx} className={classNames('docs-menu-item', {'has-children': has_children, 'current': is_current_page, 'active': is_active})}>
<Link to={withPrefix(_.get(section_page, 'url', null))}>{_.get(section_page, 'frontmatter.title', null)}</Link>
{has_children && (<React.Fragment>
<button className="docs-submenu-toggle"><span className="screen-reader-text">Submenu</span><span className="icon-angle-right" aria-hidden="true" /></button>
<DocsSubmenu {...this.props} child_pages={child_pages} page={page} site={site} />
</React.Fragment>)}
</li>
</React.Fragment>)
})}
</ul>
</div>
</div>
</nav>
);
}
Expand Down
17 changes: 6 additions & 11 deletions src/components/DocsSubmenu.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import React from 'react';
import _ from 'lodash';

import { classNames, Link, withPrefix } from '../utils';
import {classNames, Link, withPrefix} from '../utils';

export default class DocsSubmenu extends React.Component {
render() {
let child_pages = _.get(this.props, 'child_pages', null);
let page = _.get(this.props, 'page', null);
return (
<ul className="docs-submenu">
{_.map(child_pages, (child_page, child_page_idx) => (
<li
key={child_page_idx}
className={classNames('docs-menu-item', {
current: _.get(page, 'url', null) === _.get(child_page, 'url', null)
})}
>
<Link to={withPrefix(_.get(child_page, 'url', null))}>{_.get(child_page, 'frontmatter.title', null)}</Link>
</li>
))}
{_.map(child_pages, (child_page, child_page_idx) => (
<li key={child_page_idx} className={classNames('docs-menu-item', {'current': _.get(page, 'url', null) === _.get(child_page, 'url', null)})}>
<Link to={withPrefix(_.get(child_page, 'url', null))}>{_.get(child_page, 'frontmatter.title', null)}</Link>
</li>
))}
</ul>
);
}
Expand Down
34 changes: 14 additions & 20 deletions src/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import _ from 'lodash';
import React from 'react';
import { htmlToReact } from '../utils';
import ActionLink from './ActionLink';

import addScript from './../hooks/addScript';
const Script = (props) => {
importScript('./../hooks/addScript.js');
};
export default class Footer extends React.Component {
render() {
return (
<footer id="colophon" className="site-footer outer">
<div>
<center>
<br />
<div id="search"> {Script} </div>
<br />
<table cellPadding={0} cellSpacing={0} border={0}>
<tbody>
<tr>
Expand Down Expand Up @@ -76,8 +82,7 @@ export default class Footer extends React.Component {
action="https://search.freefind.com/find.html"
method="get"
acceptCharset="utf-8"
target="_self"
>
target="_self">
<input type="hidden" name="si" defaultValue={14588965} />
<input type="hidden" name="pid" defaultValue="r" />
<input type="hidden" name="n" defaultValue={0} />
Expand All @@ -95,16 +100,14 @@ export default class Footer extends React.Component {
fontFamily: 'Arial, Helvetica, sans-serif',
fontSize: '7.5pt',
paddingTop: '4px'
}}
>
}} >
<a
style={{
textDecoration: 'none',
color: 'transparent'
}}
href="https://www.freefind.com"
rel="nofollow"
>
rel="nofollow">
search engine
</a>
<a
Expand All @@ -113,8 +116,7 @@ export default class Footer extends React.Component {
color: 'transparent'
}}
href="https://www.freefind.com"
rel="nofollow"
>
rel="nofollow">
by
<span style={{ color: 'transparent' }}>freefind</span>
</a>
Expand All @@ -130,22 +132,14 @@ export default class Footer extends React.Component {
</tr>
</tbody>
</table>
<a
className="save2PDF"
href="//pdfcrowd.com/url_to_pdf/?"
onclick="if(!this.p)href+='&url='+encodeURIComponent(location.href);this.p=1"
>
<a className="save2PDF" href="//pdfcrowd.com/url_to_pdf/?" onclick="if(!this.p)href+='&url='+encodeURIComponent(location.href);this.p=1">
Save to PDF
</a>
</center>
<a aria-current="page" className="site-logo" href="/">
<img
src="https://d33wubrfki0l68.cloudfront.net/e5662f0d4f3e7730aea1a0faf7ff09ea20184700/6ca0b/images/dgqlkqjtmk.png"
alt="webdevhub logo"
/>
</a>
<a aria-current="page" className="site-logo" href="/"><img src="https://d33wubrfki0l68.cloudfront.net/e5662f0d4f3e7730aea1a0faf7ff09ea20184700/6ca0b/images/dgqlkqjtmk.png" alt="webdevhub logo" /></a>
</div>
<div className="inner">
<div id="search" className="inner"></div>
<div className="site-footer-inside">
<p className="site-info">
{_.get(this.props, 'pageContext.site.siteMetadata.footer.content', null) && (
Expand Down
16 changes: 14 additions & 2 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class Header extends React.Component {
return (
<header id="masthead" className="site-header outer">
{/* <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@algolia/algoliasearch-netlify-frontend@1/dist/algoliasearchNetlify.css" /> */}

<br />
<div className="inner">
<div className="site-header-inside">
Expand Down Expand Up @@ -86,7 +86,19 @@ export default class Header extends React.Component {
</div>

<div>
<div id="search" className="gcse-search search"></div>
<div id="sb-search-example" >

{/* style={{
position: 'fixed',
top: '20px',
border: 0,
left: '100px',
}} */}
<div className="sb-search-icon" id="myCustomSearchButtonID">
<i className="sb-icon"></i>
<p>Search</p>
</div>
</div>
<a className="github-corner" href="https://github.com/bgoonz/BGOONZ_BLOG_2.0" aria-label="View source on Github">
<svg
aria-hidden="true"
Expand Down
Loading

1 comment on commit dcd425c

@vercel
Copy link

@vercel vercel bot commented on dcd425c Mar 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.