Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"postbuild": "react-snap",
"test": "react-scripts test",
"eject": "react-scripts eject",
"create-play": "plop"
Expand All @@ -30,6 +31,12 @@
"react-app/jest"
]
},
"reactSnap": {
"puppeteerArgs": [
"--no-sandbox",
"--disable-setuid-sandbox"
]
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -41,5 +48,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"react-snap": "^1.23.0"
}
}
60 changes: 58 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,64 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="canonical" href="https://reactoplay.vercel.app/" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/og-image.png" />

<!--All meta tags are available in src/meta/DefMeta.jsx-->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="ReactPlay" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="300" />
<meta name="twitter:card" content="summary_large_image" />
<meta
name="description"
content="ReactPlay is an open-source application to learn, create and
share ReactJS projects with the developer community."
data-react-helmet="true"
/>
<meta
property="og:description"
content="ReactPlay is an open-source application to learn, create and
share ReactJS projects with the developer community."
data-react-helmet="true"
/>
<meta
property="og:title"
content="ReactPlay - One app to learn, create, and share ReactJS projects."
data-react-helmet="true"
/>
<meta
property="og:image"
content="/og-image.png"
these
to
public
data-react-helmet="true"
/>
<meta
property="og:image:alt"
content="Start React Code Arena with ReactPlay"
data-react-helmet="true"
/>
<meta name="twitter:site" content="@ReactPlayIO" data-react-helmet="true" />
<meta
name="twitter:title"
content="ReactPlay - One app to learn, create, and share ReactJS projects."
data-react-helmet="true"
/>
<meta
name="twitter:description"
content="ReactPlay is an open-source application to learn, create and
share ReactJS projects with the developer community."
data-react-helmet="true"
/>
<meta
name="twitter:image"
content="/og-image.png"
these
to
public
data-react-helmet="true"
/>

<!--
manifest.json provides metadata used when your web app is installed on a
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import RouteDefs from "common/routing/RouteDefs";
import { SearchContext } from "common/search/search-context";
import "index.css";
import React, { useState } from "react";
import { createRoot } from 'react-dom/client';
import { createRoot } from "react-dom/client";
import reportWebVitals from "reportWebVitals";

const Index = () => {
const [searchTerm, setSearchTerm] = useState("");
const [filterQuery, setFilterQuery] = useState({
level: "",
tags: [],
creator: ""
creator: "",
});

const value = { searchTerm, setSearchTerm, filterQuery, setFilterQuery };
Expand Down
8 changes: 0 additions & 8 deletions src/meta/DefMeta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ import { Helmet } from "react-helmet";
function DefMeta() {
return (
<Helmet>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="ReactPlay is an open-source application to learn, create and
share ReactJS projects with the developer community."
data-react-helmet="true"
/>
<meta property="og:type" content="website" />
<meta property="og:site_name" content="ReactPlay" />
<meta
property="og:description"
content="ReactPlay is an open-source application to learn, create and
Expand All @@ -29,15 +25,11 @@ function DefMeta() {
content="/og-image.png" // React should default these to public
data-react-helmet="true"
/>
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="300" />
<meta
property="og:image:alt"
content="Start React Code Arena with ReactPlay"
data-react-helmet="true"
/>
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:site"
content="@ReactPlayIO"
Expand Down
5 changes: 1 addition & 4 deletions src/plays/why-react/WhyReact.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import PlayHeader from "common/playlists/PlayHeader";
import { useState } from "react";
import { useLocation } from "react-router-dom";
import { getPlayById } from "meta/play-meta-util";
import "./why-react.css";

const WhyReact = () => {
const WhyReact = ({ id }) => {
// The following code is to fetch the current play from the URL
const location = useLocation();
const { id } = location.state;
const play = getPlayById(id);
const [reasons] = useState([
"React is Declarative",
Expand Down
Loading