diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 000000000..02b176d69
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,20 @@
+---
+name: Bug report
+about: Create a report to help us improve
+
+---
+
+## Bug description
+
+
+## Steps to reproduce
+
+
+## Expected behavior
+
+
+## Screenshots
+
+
+## Environment
+
diff --git a/.github/ISSUE_TEMPLATE/discussion.md b/.github/ISSUE_TEMPLATE/discussion.md
new file mode 100644
index 000000000..7a2df3f90
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/discussion.md
@@ -0,0 +1,8 @@
+---
+name: Discussion
+about: Discuss something with us
+
+---
+
+## Description
+
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 000000000..59b6f461d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,9 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+
+---
+
+## Description
+
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..12c0c2862
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,15 @@
+
+
+## Description
+
+
+
+
+## PR Type
+- [ ] Snippets, Tests & Tags (new snippets, updated snippets, re-tagging of snippets, added/updated tests)
+- [ ] Tools, Scripts & Automation (anything related to files in the scripts folder, Gatsby, website, Travis CI or Netlify)
+- [ ] General, Typos, Misc. & Meta (everything related to content, typos, general stuff and meta files in the repository - e.g. the issue template)
+- [ ] Other (please specifiy in the description above)
+
+## Guidelines
+- [ ] I have read the guidelines in the [CONTRIBUTING](https://github.com/30-seconds/30-seconds-of-react/blob/master/CONTRIBUTING.md) document.
diff --git a/.gitignore b/.gitignore
index c221276eb..29d9977a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,7 +20,7 @@ coverage
# nyc test coverage
.nyc_output
-# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
@@ -51,23 +51,23 @@ typings/
# Output of 'npm pack'
*.tgz
+# Yarn
+yarn-error.log
+.pnp/
+.pnp.js
+
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
-# parcel-bundler cache (https://parceljs.org/)
-.cache
-
# next.js build output
.next
-# nuxt.js build output
-.nuxt
+# gatsby files
+.cache/
+public
-# vuepress build output
-.vuepress/dist
-
-# Serverless directories
-.serverless
+# Mac files
+.DS_Store
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..ad4d6e410
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,12 @@
+language: node_js
+cache:
+ directories:
+ - node_modules
+node_js:
+- lts/*
+script:
+- npm run extractor
+- npm run builder
+after_success:
+- chmod +x .travis/push.sh
+- .travis/push.sh
\ No newline at end of file
diff --git a/.travis/push.sh b/.travis/push.sh
new file mode 100644
index 000000000..f60647fd8
--- /dev/null
+++ b/.travis/push.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+setup_git() {
+ git config --global user.email "30secondsofcode@gmail.com"
+ git config --global user.name "30secondsofcode"
+}
+
+commit_website_files() {
+ if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
+ if [ $TRAVIS_BRANCH == "master" ]; then
+ echo "Committing to master branch..."
+ git checkout master
+ git add *
+ if [ $TRAVIS_EVENT_TYPE == "cron" ]; then
+ git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]"
+ elif [ $TRAVIS_EVENT_TYPE == "api" ]; then
+ git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [custom]"
+ else
+ git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
+ fi
+ fi
+ fi
+}
+
+upload_files() {
+ if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
+ if [ $TRAVIS_BRANCH == "master" ]; then
+ echo "Pushing to master branch..."
+ git push --force --quiet "https://${GH_TOKEN}@github.com/30-seconds/30-seconds-of-react.git" master > /dev/null 2>&1
+ fi
+ fi
+}
+
+setup_git
+commit_website_files
+upload_files
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..53001a0b0
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at 30secondsofcode@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f4f398398..ffae9dd84 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -11,12 +11,18 @@ Here's what you can do to help:
### Snippet submission and Pull request guidelines
-- **DO NOT MODIFY THE README.md or index.html FILES!** Make changes to individual snippet files. **Travis CI** will automatically build the `README.md` and `index.html` files when your pull request is merged.
+- **DO NOT MODIFY THE README.md FILE!** Make changes to individual snippet files. **Travis CI** will automatically build the `README.md` file when your pull request is merged.
- **Snippet filenames** must correspond to the title of the snippet. For example, if your snippet is titled `### AwesomeComponent` the filename should be `AwesomeComponent.md`.
- Use `TitleCase`, not `camelCase`, `kebab-case` or `snake_case` when naming components.
+ - Use `camelCase`, not `TitleCase`, `kebab-case` or `snake_case` when naming custom hooks.
- Avoid capitalization of words, except if the whole word is capitalized (e.g. `URL` should be capitalized in the filename and the snippet title).
-- **Snippet titles** should be the same as the name of the component that is present in the snippet.
- - All snippet titles must be prefixed with `###` and be at the very first line of your snippet.
+- **Snippet metadata** must be included in all snippets in the form of frontmatter.
+ - All snippets must contain a title.
+ - All snippets must contain tags, prefixed with `tags:` and separated by commas (optional spaces in-between).
+ - Make sure the first tag in your snippet's tags is one of the main categories, as seen in the `README.md` file or the website.
+ - Snippet tags must include a difficulty setting (`begginer`, `intermediate` or `advanced`), preferrably at the end of the list.
+- **Snippet titles** should be the same as the name of the component or hook that is present in the snippet.
+ - All snippet titles must be prefixed with `title:` and be at the very first line of your snippet's frontmatter.
- Snippet titles must be unique (although if you cannot find a better title, just add some placeholder at the end of the filename and title and we will figure it out).
- Follow snippet titles with an empty line.
- **Snippet descriptions** must be short and to the point. Try to explain _what_ the snippet does and _how_ the snippet works and what Javascript/React features are used. Remember to include what functions you are using and why.
diff --git a/_headers b/_headers
new file mode 100644
index 000000000..4c2f41f08
--- /dev/null
+++ b/_headers
@@ -0,0 +1,4 @@
+[[headers]]
+for = "/static/*"
+[headers.values]
+Cache-Control = "public, max-age=360000"
\ No newline at end of file
diff --git a/gatsby-browser.js b/gatsby-browser.js
new file mode 100644
index 000000000..09c615eb2
--- /dev/null
+++ b/gatsby-browser.js
@@ -0,0 +1,8 @@
+/**
+ * Implement Gatsby's Browser APIs in this file.
+ *
+ * See: https://www.gatsbyjs.org/docs/browser-apis/
+ */
+
+// You can delete this file if you're not using it
+export { default as wrapRootElement } from './src/docs/state/ReduxWrapper';
diff --git a/gatsby-config.js b/gatsby-config.js
new file mode 100644
index 000000000..448c152b1
--- /dev/null
+++ b/gatsby-config.js
@@ -0,0 +1,82 @@
+const config = require('./config');
+
+module.exports = {
+ siteMetadata: {
+ title: `${config.name}`,
+ description: `${config.description}`,
+ author: `@30-seconds`,
+ },
+ plugins: [
+ `gatsby-plugin-transition-link`,
+ {
+ resolve: `gatsby-source-filesystem`,
+ options: {
+ name: `snippets`,
+ path: `${__dirname}/${config.snippetPath}`,
+ },
+ },
+ {
+ resolve: `gatsby-source-filesystem`,
+ options: {
+ name: `snippet_data`,
+ path: `${__dirname}/${config.snippetDataPath}`,
+ },
+ },
+ {
+ resolve: `gatsby-source-filesystem`,
+ options: {
+ name: `assets`,
+ path: `${__dirname}/${config.assetPath}`,
+ },
+ },
+ {
+ resolve: `gatsby-plugin-page-creator`,
+ options: {
+ path: `${__dirname}/${config.pagePath}`,
+ },
+ },
+ {
+ resolve: `gatsby-transformer-remark`,
+ options: {
+ plugins: [
+ {
+ resolve: `gatsby-remark-images`,
+ options: {
+ maxWidth: 590,
+ },
+ },
+ `gatsby-remark-prismjs`,
+ `gatsby-remark-copy-linked-files`,
+ ],
+ },
+ },
+ `gatsby-plugin-sass`,
+ `gatsby-transformer-json`,
+ `gatsby-transformer-sharp`,
+ `gatsby-plugin-sharp`,
+ {
+ resolve: `gatsby-plugin-google-analytics`,
+ options: {
+ trackingId: `UA-117141635-1`,
+ anonymize: true, // Always set this to true, try to comply with GDPR out of the box
+ respectDNT: true, // Always set to true, be respectful of people who ask not to be tracked
+ cookieExpires: 0, // Always set to 0, minimum tracking for your users
+ },
+ },
+ {
+ resolve: `gatsby-plugin-manifest`,
+ options: {
+ name: `${config.name}`,
+ short_name: `${config.shortName}`,
+ start_url: `/`,
+ background_color: `#1e253d`,
+ theme_color: `#1e253d`,
+ display: `standalone`,
+ icon: `assets/30s-icon.png`, // This path is relative to the root of the site.
+ },
+ },
+ `gatsby-plugin-offline`,
+ `gatsby-plugin-react-helmet`,
+ `gatsby-plugin-netlify`,
+ ],
+};
diff --git a/gatsby-node.js b/gatsby-node.js
new file mode 100644
index 000000000..9221ea486
--- /dev/null
+++ b/gatsby-node.js
@@ -0,0 +1,93 @@
+const path = require(`path`);
+const { createFilePath } = require(`gatsby-source-filesystem`);
+
+const toKebabCase = str =>
+ str &&
+ str
+ .match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
+ .map(x => x.toLowerCase())
+ .join('-');
+
+exports.createPages = ({ graphql, actions }) => {
+ const { createPage } = actions;
+
+ const snippetPage = path.resolve(`./src/docs/templates/SnippetPage.js`);
+ const tagPage = path.resolve(`./src/docs/templates/TagPage.js`);
+ return graphql(
+ `
+ {
+ allMarkdownRemark(
+ sort: { fields: [frontmatter___title], order: ASC }
+ limit: 1000
+ ) {
+ edges {
+ node {
+ fields {
+ slug
+ }
+ frontmatter {
+ tags
+ }
+ fileAbsolutePath
+ }
+ }
+ }
+ }
+ `,
+ ).then(result => {
+ if (result.errors) {
+ throw result.errors;
+ }
+
+ // Create individual snippet pages.
+ const snippets = result.data.allMarkdownRemark.edges;
+
+ snippets.forEach((post, index) => {
+ if (post.node.fileAbsolutePath.indexOf('README') !== -1)
+ return;
+ createPage({
+ path: `/snippet${post.node.fields.slug}`,
+ component: snippetPage,
+ context: {
+ slug: post.node.fields.slug,
+ },
+ });
+ });
+
+ // Create tag pages.
+ const tags = snippets.reduce((acc, post) => {
+ if (!post.node.frontmatter || !post.node.frontmatter.tags) return acc;
+ const primaryTag = post.node.frontmatter.tags.split(',')[0];
+ if (!acc.includes(primaryTag)) acc.push(primaryTag);
+ return acc;
+ }, []);
+
+ tags.forEach(tag => {
+ const tagPath = `/tag/${toKebabCase(tag)}/`;
+ const tagRegex = `/^\\s*${tag}/`;
+ createPage({
+ path: tagPath,
+ component: tagPage,
+ context: {
+ tag,
+ tagRegex,
+ },
+ });
+ });
+
+ return null;
+ });
+};
+
+exports.onCreateNode = ({ node, actions, getNode }) => {
+ const { createNodeField } = actions;
+
+ if (node.internal.type === `MarkdownRemark`) {
+ const value = createFilePath({ node, getNode });
+ createNodeField({
+ name: `slug`,
+ node,
+ value,
+ });
+ }
+};
diff --git a/gatsby-ssr.js b/gatsby-ssr.js
new file mode 100644
index 000000000..3513ab31a
--- /dev/null
+++ b/gatsby-ssr.js
@@ -0,0 +1,8 @@
+/**
+ * Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
+ *
+ * See: https://www.gatsbyjs.org/docs/ssr-apis/
+ */
+
+// You can delete this file if you're not using it
+export { default as wrapRootElement } from './src/docs/state/ReduxWrapper';
diff --git a/netlify.toml b/netlify.toml
new file mode 100644
index 000000000..3bcf87c32
--- /dev/null
+++ b/netlify.toml
@@ -0,0 +1,6 @@
+[build]
+ publish = "public"
+ command = "npm run webber"
+[build.environment]
+ YARN_VERSION = "1.9.4"
+ YARN_FLAGS = "--no-ignore-optional"
\ No newline at end of file
diff --git a/snippet-template.md b/snippet-template.md
index 9492b357a..853ee24d8 100644
--- a/snippet-template.md
+++ b/snippet-template.md
@@ -1,3 +1,8 @@
+---
+title: ComponentName
+tags: visual,state,effect,intermediate
+---
+
### ComponentName
Explain briefly what the snippet does.
@@ -19,21 +24,3 @@ function ComponentName(props) {
```jsx
ReactDOM.render(, document.getElementById('root'));
```
-
-
-
-#### Notes:
-
-- Things to remember when using this
-- Other options that might be less appealing or have lower compatibility
-- Common mistakes and issues
-
-
-
-
-
diff --git a/src/docs/components/Meta.js b/src/docs/components/Meta.js
new file mode 100644
index 000000000..c79e07669
--- /dev/null
+++ b/src/docs/components/Meta.js
@@ -0,0 +1,78 @@
+import React from 'react';
+import Helmet from 'react-helmet';
+import { useStaticQuery, graphql } from 'gatsby';
+require('../styles/index.scss'); // Do not change this to `import`, it's not going to work, no clue why
+
+// ===================================================
+// Page metadata (using Helmet)
+// ===================================================
+const Meta = ({ description = '', lang = 'en', meta = [], title }) => {
+ const { site, file } = useStaticQuery(
+ graphql`
+ query {
+ site {
+ siteMetadata {
+ title
+ description
+ author
+ }
+ }
+ file(relativePath: { eq: "logo.png" }) {
+ id
+ childImageSharp {
+ fluid(maxHeight: 400) {
+ src
+ }
+ }
+ }
+ }
+ `,
+ );
+
+ const metaDescription = description || site.siteMetadata.description;
+
+ return (
+
+ );
+};
+
+export default Meta;
diff --git a/src/docs/components/SVGs/BackArrowIcon.js b/src/docs/components/SVGs/BackArrowIcon.js
new file mode 100644
index 000000000..789edf859
--- /dev/null
+++ b/src/docs/components/SVGs/BackArrowIcon.js
@@ -0,0 +1,22 @@
+import React from 'react';
+
+const BackArrowIcon = ({ className, onClick }) => (
+
+);
+
+export default BackArrowIcon;
diff --git a/src/docs/components/SVGs/ClipboardIcon.js b/src/docs/components/SVGs/ClipboardIcon.js
new file mode 100644
index 000000000..e57f84b37
--- /dev/null
+++ b/src/docs/components/SVGs/ClipboardIcon.js
@@ -0,0 +1,22 @@
+import React from 'react';
+
+const ClipboardIcon = ({ className, onClick }) => (
+
+);
+
+export default ClipboardIcon;
diff --git a/src/docs/components/SVGs/CollapseClosedIcon.js b/src/docs/components/SVGs/CollapseClosedIcon.js
new file mode 100644
index 000000000..a72270988
--- /dev/null
+++ b/src/docs/components/SVGs/CollapseClosedIcon.js
@@ -0,0 +1,23 @@
+import React from 'react';
+
+const CollapseClosedIcon = ({ className, onClick }) => (
+
+);
+
+export default CollapseClosedIcon;
diff --git a/src/docs/components/SVGs/CollapseOpenIcon.js b/src/docs/components/SVGs/CollapseOpenIcon.js
new file mode 100644
index 000000000..bcd04cb22
--- /dev/null
+++ b/src/docs/components/SVGs/CollapseOpenIcon.js
@@ -0,0 +1,22 @@
+import React from 'react';
+
+const CollapseOpenIcon = ({ className, onClick }) => (
+
+);
+
+export default CollapseOpenIcon;
diff --git a/src/docs/components/SVGs/DarkModeIcon.js b/src/docs/components/SVGs/DarkModeIcon.js
new file mode 100644
index 000000000..318423094
--- /dev/null
+++ b/src/docs/components/SVGs/DarkModeIcon.js
@@ -0,0 +1,21 @@
+import React from 'react';
+
+const DarkModeIcon = ({ className, onClick }) => (
+
+);
+
+export default DarkModeIcon;
diff --git a/src/docs/components/SVGs/GithubIcon.js b/src/docs/components/SVGs/GithubIcon.js
new file mode 100644
index 000000000..5d2b2bb25
--- /dev/null
+++ b/src/docs/components/SVGs/GithubIcon.js
@@ -0,0 +1,21 @@
+import React from 'react';
+
+const GithubIcon = ({ className, onClick }) => (
+
+);
+
+export default GithubIcon;
diff --git a/src/docs/components/SVGs/LightModeIcon.js b/src/docs/components/SVGs/LightModeIcon.js
new file mode 100644
index 000000000..bb13cb19e
--- /dev/null
+++ b/src/docs/components/SVGs/LightModeIcon.js
@@ -0,0 +1,29 @@
+import React from 'react';
+
+const LightModeIcon = ({ className, onClick }) => (
+
+);
+
+export default LightModeIcon;
diff --git a/src/docs/components/SVGs/ListIcon.js b/src/docs/components/SVGs/ListIcon.js
new file mode 100644
index 000000000..853b1a7b2
--- /dev/null
+++ b/src/docs/components/SVGs/ListIcon.js
@@ -0,0 +1,26 @@
+import React from 'react';
+
+const ListIcon = ({ className, onClick }) => (
+
+);
+
+export default ListIcon;
diff --git a/src/docs/components/SVGs/SearchIcon.js b/src/docs/components/SVGs/SearchIcon.js
new file mode 100644
index 000000000..763ae3ea9
--- /dev/null
+++ b/src/docs/components/SVGs/SearchIcon.js
@@ -0,0 +1,24 @@
+import React from 'react';
+
+const SearchIcon = ({ className, onClick }) => {
+ return (
+
+ );
+};
+
+export default SearchIcon;
diff --git a/src/docs/components/SVGs/ShareIcon.js b/src/docs/components/SVGs/ShareIcon.js
new file mode 100644
index 000000000..8e78b671e
--- /dev/null
+++ b/src/docs/components/SVGs/ShareIcon.js
@@ -0,0 +1,25 @@
+import React from 'react';
+
+const ShareIcon = ({ className, onClick }) => (
+
+);
+
+export default ShareIcon;
diff --git a/src/docs/components/Search.js b/src/docs/components/Search.js
new file mode 100644
index 000000000..5b2903d43
--- /dev/null
+++ b/src/docs/components/Search.js
@@ -0,0 +1,28 @@
+import React from 'react';
+
+// ===================================================
+// Simple, stateful search component
+// ===================================================
+const Search = ({ defaultValue = '', setSearchQuery, className = '' }) => {
+ const [value, setValue] = React.useState(defaultValue);
+
+ React.useEffect(() => {
+ setSearchQuery(value);
+ }, [value]);
+
+ return (
+ {
+ setValue(e.target.value);
+ }}
+ />
+ );
+};
+
+export default Search;
diff --git a/src/docs/components/Shell.js b/src/docs/components/Shell.js
new file mode 100644
index 000000000..988edf6e1
--- /dev/null
+++ b/src/docs/components/Shell.js
@@ -0,0 +1,149 @@
+import React from 'react';
+import { graphql, useStaticQuery } from 'gatsby';
+import { connect } from 'react-redux';
+import AniLink from 'gatsby-plugin-transition-link/AniLink';
+import ReactCSSTransitionReplace from 'react-css-transition-replace';
+import config from '../../../config';
+
+import { toggleDarkMode } from '../state/app';
+
+import SearchIcon from './SVGs/SearchIcon';
+import GithubIcon from './SVGs/GithubIcon';
+import DarkModeIcon from './SVGs/DarkModeIcon';
+import LightModeIcon from './SVGs/LightModeIcon';
+import ListIcon from './SVGs/ListIcon';
+
+// ===================================================
+// Application-level UI component
+// ===================================================
+const Shell = ({
+ isDarkMode,
+ isSearch,
+ isList,
+ dispatch,
+ withIcon = true,
+ withTitle = true,
+ children,
+}) => {
+ const data = useStaticQuery(graphql`
+ query SiteTitleQuery {
+ site {
+ siteMetadata {
+ title
+ description
+ }
+ }
+ file(relativePath: { eq: "30s-icon.png" }) {
+ id
+ childImageSharp {
+ original {
+ src
+ }
+ }
+ }
+ snippetDataJson(meta: { type: { eq: "snippetListingArray" } }) {
+ data {
+ title
+ id
+ attributes {
+ tags
+ }
+ }
+ }
+ }
+ `);
+ let viewportWidth = typeof window !== 'undefined' && window.innerWidth;
+
+ return (
+
+ {/* Menu */}
+
+
+
+
+
+
+
+ {/* eslint-disable-next-line */}
+
+
+
+ {/*
+ The use of React.Fragment here will cause a lot of errors to show up in webber:dev.
+ Truth is, this is the only decent way I found to deal with this module's odd behavior.
+ Keep as is, unless you can provide a better solution, in which case please send a PR.
+ */}
+
+ {isDarkMode ? (
+ dispatch(toggleDarkMode(!isDarkMode))}
+ />
+ ) : (
+ dispatch(toggleDarkMode(!isDarkMode))}
+ />
+ )}
+
+
+ {/* Content */}
+
+ );
+};
+
+export default SnippetCard;
diff --git a/src/docs/pages/404.js b/src/docs/pages/404.js
new file mode 100644
index 000000000..5239aa371
--- /dev/null
+++ b/src/docs/pages/404.js
@@ -0,0 +1,60 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import AniLink from 'gatsby-plugin-transition-link/AniLink';
+
+import Shell from '../components/Shell';
+import Meta from '../components/Meta';
+
+// ===================================================
+// Not found page
+// ===================================================
+const NotFoundPage = ({ isDarkMode }) => (
+ <>
+
+
+
404
+
+
+ Page not found
+
+
+
+ Seems like you have reached a page that does not exist.
+
+
+
+ Go home
+
+
+
+ >
+);
+
+export default connect(
+ state => ({
+ isDarkMode: state.app.isDarkMode,
+ lastPageTitle: state.app.lastPageTitle,
+ lastPageUrl: state.app.lastPageUrl,
+ searchQuery: state.app.searchQuery,
+ }),
+ null,
+)(NotFoundPage);
diff --git a/src/docs/pages/about.js b/src/docs/pages/about.js
new file mode 100644
index 000000000..e7fed6886
--- /dev/null
+++ b/src/docs/pages/about.js
@@ -0,0 +1,99 @@
+import React from 'react';
+import { connect } from 'react-redux';
+
+import Shell from '../components/Shell';
+import Meta from '../components/Meta';
+import SimpleCard from '../components/SimpleCard';
+
+// ===================================================
+// About page
+// ===================================================
+const AboutPage = ({ isDarkMode }) => (
+ <>
+
+
+
About
+
+ A few word about us, our goals and our projects.
+
+
+
+ The core goal of 30 seconds is to provide a quality resource for beginner and advanced developers alike. We want to help improve the software development ecosystem, by lowering the barrier of entry for newcomers and help seasoned veterans pick up new tricks and remember old ones.
+
+
+ In order to achieve this, we have collected hundreds of snippets that can be of use in a wide range of situations. We welcome new contributors and we like fresh ideas, as long as the code is short and easy to grasp in about 30 seconds.
+
+
+ The only catch, if you may, is that a few of our snippets are not perfectly optimized for large, enterprise applications and they might not be deemed production-ready.
+
+
+
+
+ The 30 seconds movement started back in December, 2017, with the release of 30 seconds of code by Angelos Chalaris. Since then, hundreds of developers have contributed snippets to over 6 repositories, creating a thriving community of people willing to help each other write better code.
+
+
+ In late 2018, the 30 seconds organization was formed on GitHub, in order to expand upon existing projects and ensure that they will remain high-quality resources in the future.
+
+
+
+
+ The 30 seconds movement and, to some extent, the associated GitHub organization consists of all the people who have invested time and ideas to be part of this amazing community. Meanwhile, these fine folks are currently responsible for maintaining the codebases and dealing with organizational matters:
+
+ In order for the code provided via the 30 seconds projects to be as accessible and useful as possible, all of the snippets in these collections are licensed under the CC0-1.0 License meaning they are absolutely free to use in any project you like. If you like what we do, you can always credit us, but that is not mandatory.
+
+
+ Logos, names and trademarks are not to be used without the explicit consent of the maintainers or owners of the 30 seconds GitHub organization. The only exception to this is the usage of the 30-seconds-of- name in open source projects, licensed under the CC0-1.0 License and hosted on GitHub, if their README and website clearly states that they are unofficial projects and in no way affiliated with the organization.
+