diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000000..6f9b40ca23
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,11 @@
+node_modules
+
+.git
+.github
+.gitignore
+
+package-lock.json
+yarn-error.log
+yarn.lock
+
+tsconfig.json
\ No newline at end of file
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000000..ffb9589824
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,40 @@
+{
+ "env": {
+ "browser": true,
+ "es2021": true
+ },
+ "extends": ["plugin:react/recommended", "airbnb", "plugin:prettier/recommended"],
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "ecmaFeatures": {
+ "jsx": true
+ },
+ "ecmaVersion": "latest",
+ "sourceType": "module"
+ },
+ "plugins": ["react", "@typescript-eslint", "prettier"],
+ "rules": {
+ "prettier/prettier": "error",
+ "no-console": ["error", { "allow": ["warn", "error"] }],
+ "react/jsx-pascal-case": [1, {}],
+ "react/jsx-sort-props": [
+ 1,
+ {
+ "callbacksLast": true,
+ "shorthandFirst": true,
+ "ignoreCase": true,
+ "noSortAlphabetically": true,
+ "multiline": "last"
+ }
+ ],
+ "react/jsx-boolean-value": [1, "always"],
+ "react/self-closing-comp": [
+ "error",
+ {
+ "component": true,
+ "html": true
+ }
+ ],
+ "react/jsx-curly-brace-presence": [1, "always"]
+ }
+}
diff --git a/.github/ISSUE_TEMPLATE/----bug-report---.md b/.github/ISSUE_TEMPLATE/----bug-report---.md
index d279fb48ca..df6bd53831 100644
--- a/.github/ISSUE_TEMPLATE/----bug-report---.md
+++ b/.github/ISSUE_TEMPLATE/----bug-report---.md
@@ -4,7 +4,6 @@ about: Create a report to help us improve
title: "\U0001F41B [Bug report]: "
labels: bug
assignees: ''
-
---
**Describe the bug**
@@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
+
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- - OS: [e.g. iOS]
- - Browser [e.g. chrome, safari]
- - Version [e.g. 22]
+
+- OS: [e.g. iOS]
+- Browser [e.g. chrome, safari]
+- Version [e.g. 22]
**Smartphone (please complete the following information):**
- - Device: [e.g. iPhone6]
- - OS: [e.g. iOS8.1]
- - Browser [e.g. stock browser, safari]
- - Version [e.g. 22]
+
+- Device: [e.g. iPhone6]
+- OS: [e.g. iOS8.1]
+- Browser [e.g. stock browser, safari]
+- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/---feature-request---.md b/.github/ISSUE_TEMPLATE/---feature-request---.md
index 333c0cb245..f022833946 100644
--- a/.github/ISSUE_TEMPLATE/---feature-request---.md
+++ b/.github/ISSUE_TEMPLATE/---feature-request---.md
@@ -1,10 +1,9 @@
---
-name: "✨ [Feature request]: "
+name: '✨ [Feature request]: '
about: Suggest an idea for this project
-title: "✨ [Feature request]: "
+title: '✨ [Feature request]: '
labels: ''
assignees: ''
-
---
**Is your feature request related to a problem? Please describe.**
diff --git a/.github/ISSUE_TEMPLATE/new-play.md b/.github/ISSUE_TEMPLATE/new-play.md
index d55bf09a88..790f4369da 100644
--- a/.github/ISSUE_TEMPLATE/new-play.md
+++ b/.github/ISSUE_TEMPLATE/new-play.md
@@ -1,18 +1,15 @@
---
name: New Play
about: Add a New Play Request
-title: "[Add a Play]: "
+title: '[Add a Play]: '
labels: play-request
assignees: ''
-
---
-Thank You!
+Thank You!
## What's the Play about?
-
## What ReactJS concept will be used to create this play?
-
## Are you willing to take it up for implementation?
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index f8baf616ae..fc3f3ec4dc 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,4 +1,3 @@
-
> First thing, PLEASE READ THIS: [ReactPlay Code Review Checklist](https://github.com/reactplay/react-play/wiki/ReactPlay-Code-Review-Checklist)
# Description
@@ -18,7 +17,7 @@ Please delete options that are not relevant.
# How Has This Been Tested?
-Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
+Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
# Checklist:
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000000..51daf4483b
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,8 @@
+{
+ "semi": true,
+ "tabWidth": 2,
+ "printWidth": 100,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "endOfLine": "lf"
+}
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 41d9c31373..371ae230ea 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:
-* Demonstrating empathy and kindness toward other people
-* Being respectful of differing opinions, viewpoints, and experiences
-* Giving and gracefully accepting constructive feedback
-* Accepting responsibility and apologizing to those affected by our mistakes,
+- Demonstrating empathy and kindness toward other people
+- Being respectful of differing opinions, viewpoints, and experiences
+- Giving and gracefully accepting constructive feedback
+- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
-* Focusing on what is best not just for us as individuals, but for the
+- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
-* The use of sexualized language or imagery, and sexual attention or
+- The use of sexualized language or imagery, and sexual attention or
advances of any kind
-* Trolling, insulting or derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or email
+- Trolling, insulting or derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or email
address, without their explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
+- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
-standards, including sustained inappropriate behavior, harassment of an
+standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
diff --git a/CREATE-PLAY.md b/CREATE-PLAY.md
index 95a001bd49..3d48444b71 100644
--- a/CREATE-PLAY.md
+++ b/CREATE-PLAY.md
@@ -1,6 +1,9 @@
# Create a Play
+
This document helps you with the steps to `Create a play` in `react-play`. You will also find the details of how to submit a play for code review.
+
## 🖥️ Steps to Create a Play
+
Welcome developers! We are as excited as you are to know that you are going to create a new play. It is super easy to get started.
> **Note:** The steps below assumes that you have forked and cloned the [react-play](https://github.com/reactplay/react-play) repository. Also, you have installed the dependencies using the `npm install` or `yarn install` command. If you are new to forking, please watch this [YouTube Guide](https://www.youtube.com/watch?v=h8suY-Osn8Q) to get started.
@@ -13,82 +16,83 @@ Welcome developers! We are as excited as you are to know that you are going to c
npm run create-play
```
- This will ask a few questions about your `Play` and then perform required steps to create the play. The screen shot below shows the output of the command.
- > **Script Language**: `react-play` is equipped with both `JavaScript` and `TypeScript`. So you can use either of it as base language for your play
-
-
-
-
-
-
-
- Please expand to find the description of the question details.
-
-
-
-
-
- Question
- Mandatory
- Description
-
-
-
-
- Please provide the name of the play
- Yes
- Please provide a meaningful name of the play(Example: Identity Card). This name will be visible to the users.
-
-
- Tell us more about the play
- No
- It is a description of the play for users to understand it better. The maximum number of allowed characters is 1024.
-
-
- Language to be used (javascript/typescript)
- Yes
- Let the application know your choice of script. It supports both JavaScript and TypeScript . You can pick either of it.
-
-
- Style to be used (css/scss)
- Yes
- Let the application know your choice of style. It supports both css and scss . You can pick either of it.
-
-
- What is the level of this play?
- Yes
- You will be asked to select one of the three levels, Beginner, Intermediate, or Advanced. Please select a level for the play. A level indicates the possible complexity of developing the play using React.
-
-
- Provide maximum of 5 tags
- No
- Please provide comma-separated list of tags. You can provide max 5 tags. Example: JSX, Hooks
-
-
- Enter your github username
- Yes
- Provide your GitHub user name to mark you as the creator of the play.
-
-
- Please provide the path(URL) to cover image
- No
- A cover image is used to show your play with a thumbnail in the play list page. Please provide a link a cover image that is publicly accessible using a URL, example: https://res.cloudinary.com/reactplay/image/upload/v1649060528/demos/id-card_pdvyvz.png. Alternatively, you can have a cover.png file in the root of your play folder.
- If you don't have a cover image, the app will use the default cover image.
-
-
- Enter your blog url
- No
- If you have written an article about this play, please provide the link to your blog article page.
-
-
- Enter your video url
- No
- If you have created a video tutorial about this play, please provide the link to your YouTube video.
-
-
-
+
+ > **Script Language**: `react-play` is equipped with both `JavaScript` and `TypeScript`. So you can use either of it as base language for your play
+
+
+
-
-
+
+
+
+ Please expand to find the description of the question details.
+
+
+
+
+
+ Question
+ Mandatory
+ Description
+
+
+
+
+ Please provide the name of the play
+ Yes
+ Please provide a meaningful name of the play(Example: Identity Card). This name will be visible to the users.
+
+
+ Tell us more about the play
+ No
+ It is a description of the play for users to understand it better. The maximum number of allowed characters is 1024.
+
+
+ Language to be used (javascript/typescript)
+ Yes
+ Let the application know your choice of script. It supports both JavaScript and TypeScript . You can pick either of it.
+
+
+ Style to be used (css/scss)
+ Yes
+ Let the application know your choice of style. It supports both css and scss . You can pick either of it.
+
+
+ What is the level of this play?
+ Yes
+ You will be asked to select one of the three levels, Beginner, Intermediate, or Advanced. Please select a level for the play. A level indicates the possible complexity of developing the play using React.
+
+
+ Provide maximum of 5 tags
+ No
+ Please provide comma-separated list of tags. You can provide max 5 tags. Example: JSX, Hooks
+
+
+ Enter your github username
+ Yes
+ Provide your GitHub user name to mark you as the creator of the play.
+
+
+ Please provide the path(URL) to cover image
+ No
+ A cover image is used to show your play with a thumbnail in the play list page. Please provide a link a cover image that is publicly accessible using a URL, example: https://res.cloudinary.com/reactplay/image/upload/v1649060528/demos/id-card_pdvyvz.png. Alternatively, you can have a cover.png file in the root of your play folder.
+ If you don't have a cover image, the app will use the default cover image.
+
+
+ Enter your blog url
+ No
+ If you have written an article about this play, please provide the link to your blog article page.
+
+
+ Enter your video url
+ No
+ If you have created a video tutorial about this play, please provide the link to your YouTube video.
+
+
+
+
+
+
- Now you can run the app using the following command:
```shell
@@ -99,7 +103,9 @@ Welcome developers! We are as excited as you are to know that you are going to c
- You should now see your play added to the [play list](http://localhost:3000/plays) page. You can click on the play thumbnail to see the details of the play.
- That's it. Now start coding your `Play` using your favorite code editor!
+
## 👀 Submitting a Play for Review
+
After you done with coding for your `Play`, you can submit it for review. Submitting a `Play` for review is a two step process.
- Create a Pull Request on the [react-play](https://github.com/reactplay/react-play) repository with your changes. Please add `atapas` as a reviewer.
diff --git a/README.md b/README.md
index df14cd8637..f2b561a931 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,9 @@
# ReactPlay(Repo: `react-play`)
+
+
[](#contributors-)
+
@@ -46,11 +49,13 @@
`react-play` is an `opensource` web app that helps you learn ReactJS faster with hands-on practice model. It is a collection of `ReactJS projects` that you can use to learn ReactJS.
Is that all? Nope. You can also create your own projects and share them with the world. The best part is that the ReactJS experts will `review` your project code before it gets part of the `ReactPlay` app. Isn't that a pure WIN-WIN?
+
## 🔥 Demo
+
Here is the link to the app. We hope you enjoy it.
> [The ReactPlay app Link](https://reactplay.io)
-
+
Who doesn't want motivation and support? Many Thanks to all the Stargazers who has supported this project with stars(⭐). You all are amazing!!!
[](https://github.com/reactplay/react-play/stargazers)
@@ -67,7 +72,8 @@ You may want to set up the `react-play` repo for the following reasons:
Here is a quick overview of the `react-play` repo setup:
-### 🍴 Fork and Clone the Repo
+### 🍴 Fork and Clone the Repo
+
First, you need to fork the `react-play` repo. You can do this by clicking the `Fork` button on the top right corner of the repo. If you are new to forking, please watch this [YouTube Guide](https://www.youtube.com/watch?v=h8suY-Osn8Q) to get started.
Once forked, you can clone the repo by clicking the `Clone or Download` button on the top right corner of forked repo.
@@ -75,25 +81,29 @@ Once forked, you can clone the repo by clicking the `Clone or Download` button o
Please change the directory after cloning the repository using the `cd ` command.
### ⬇️ Install Dependencies
+
Next, install the dependencies by running the following command in the `react-play` repo:
```bash
npm install
```
+
Or
-
+
```bash
yarn install
```
### 🦄 Start the Development Mode
+
Use the following command to start the app in the development mode:
```bash
npm start
```
+
Or
-
+
```bash
yarn start
```
@@ -103,13 +113,15 @@ It runs the app in the development mode. Open [http://localhost:3000](http://loc
The page will reload when you make changes. You may also see any lint errors in the console.
### 🧱 Build the App for Production
+
Use the following command to build the app for production:
```bash
npm run build
```
+
Or
-
+
```bash
yarn build
```
@@ -128,6 +140,7 @@ You can deploy the app to `Vercel` or `Netlify` with a single click.
## 🤝 Contributing to `ReactPlay`
+
Any kind of positive contributions are welcome! Please help us to grow by contributing to the project.
If you wish to contribute, you can,
@@ -157,9 +170,6 @@ If you found the app helpful, consider supporting us with a coffee.
A ⭐️ to ReactPlay is to make us more 💪 stronger and motivated.
-
-
-
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
diff --git a/_config.yml b/_config.yml
index 2f7efbeab5..fff4ab923c 100644
--- a/_config.yml
+++ b/_config.yml
@@ -1 +1 @@
-theme: jekyll-theme-minimal
\ No newline at end of file
+theme: jekyll-theme-minimal
diff --git a/package.json b/package.json
index 23b182eaa1..af064238d9 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,10 @@
"postbuild": "react-snap",
"test": "react-scripts test",
"eject": "react-scripts eject",
- "create-play": "plop"
+ "create-play": "plop",
+ "lint:fix": "eslint . --fix",
+ "prettier:fix": "prettier --write \"**/*.+(js|jsx|ts|tsx|json|yml|yaml|css|scss|md|)\"",
+ "format": "yarn prettier:fix && yarn lint:fix"
},
"eslintConfig": {
"extends": [
@@ -58,6 +61,17 @@
]
},
"devDependencies": {
+ "@typescript-eslint/eslint-plugin": "^5.27.0",
+ "@typescript-eslint/parser": "^5.27.0",
+ "eslint": "^7.32.0 || ^8.2.0",
+ "eslint-config-airbnb": "^19.0.4",
+ "eslint-config-prettier": "^8.5.0",
+ "eslint-plugin-import": "^2.25.3",
+ "eslint-plugin-jsx-a11y": "^6.5.1",
+ "eslint-plugin-prettier": "^4.0.0",
+ "eslint-plugin-react": "^7.28.0",
+ "eslint-plugin-react-hooks": "^4.3.0",
+ "prettier": "^2.6.2",
"puppeteer": "^13.7.0",
"react-snap": "^1.23.0",
"typescript": "^4.6.4"
diff --git a/plopfile.js b/plopfile.js
index 01ab257a45..7fe510b549 100644
--- a/plopfile.js
+++ b/plopfile.js
@@ -1,18 +1,22 @@
-String.prototype.replaceAll = String.prototype.replaceAll || function(string, replaced) {
- return this.replace(new RegExp(string, 'g'), replaced);
-};
+String.prototype.replaceAll =
+ String.prototype.replaceAll ||
+ function (string, replaced) {
+ return this.replace(new RegExp(string, 'g'), replaced);
+ };
-module.exports = plop => {
- plop.setHelper('trim', str => str.trim());
- plop.setHelper('removeAllSpaces', str => str.replaceAll(/\s/g,''));
+module.exports = (plop) => {
+ plop.setHelper('trim', (str) => str.trim());
+ plop.setHelper('removeAllSpaces', (str) => str.replaceAll(/\s/g, ''));
- plop.setHelper('generateId', str => `pl-${str.trim().replaceAll(/\s/g,'-').toLowerCase()}`);
+ plop.setHelper('generateId', (str) => `pl-${str.trim().replaceAll(/\s/g, '-').toLowerCase()}`);
- plop.setHelper('generateFolderName', str => `${str.trim().replaceAll(/\s/g,'-').toLowerCase()}`);
+ plop.setHelper(
+ 'generateFolderName',
+ (str) => `${str.trim().replaceAll(/\s/g, '-').toLowerCase()}`
+ );
const insertIf = (condition, ...elements) => (condition ? elements : []);
-
// demo generator
plop.setGenerator('play', {
description: 'Steps to add a new play',
@@ -20,12 +24,12 @@ module.exports = plop => {
{
type: 'input',
name: 'name',
- message: 'Please provide the name of the play(Example: Identity Card):',
+ message: 'Please provide the name of the play(Example: Identity Card):'
},
{
type: 'input',
name: 'description',
- message: 'Tell us more about the play(Max 1024 characters):',
+ message: 'Tell us more about the play(Max 1024 characters):'
},
{
type: 'list',
@@ -48,63 +52,63 @@ module.exports = plop => {
{
type: 'input',
name: 'tags',
- message: 'Provide maximum of 5 tags(Example: JSX, Hooks):',
+ message: 'Provide maximum of 5 tags(Example: JSX, Hooks):'
},
{
type: 'input',
name: 'github',
- message: 'Enter your github username(Example: atapas):',
+ message: 'Enter your github username(Example: atapas):'
},
{
type: 'input',
name: 'cover',
- message: 'Please provide the path(URL) to cover image(When the image is hosted publicly):',
+ message: 'Please provide the path(URL) to cover image(When the image is hosted publicly):'
},
{
type: 'input',
name: 'blog',
- message: 'Enter your blog url(Example: https://blog.greenroots.info):',
+ message: 'Enter your blog url(Example: https://blog.greenroots.info):'
},
{
type: 'input',
name: 'video',
- message: 'Enter your video url(Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ):',
- },
+ message: 'Enter your video url(Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ):'
+ }
],
actions: [
{
type: 'add',
path: 'src/plays/{{generateFolderName name}}/{{pascalCase name}}.{{language}}x',
- templateFile: 'plop-templates/component_{{language}}.hbs',
+ templateFile: 'plop-templates/component_{{language}}.hbs'
},
{
type: 'add',
path: 'src/plays/{{generateFolderName name}}/{{camelCase name}}.{{style}}',
- templateFile: 'plop-templates/style_{{style}}.hbs',
+ templateFile: 'plop-templates/style_{{style}}.hbs'
},
{
type: 'add',
path: 'src/plays/{{generateFolderName name}}/Readme.md',
- templateFile: 'plop-templates/play-readme.hbs',
+ templateFile: 'plop-templates/play-readme.hbs'
},
{
type: 'modify',
path: 'src/plays/index.js',
pattern: /\/\/add export here/gi,
- templateFile: 'plop-templates/exportPlay.hbs',
+ templateFile: 'plop-templates/exportPlay.hbs'
},
{
type: 'modify',
path: 'src/meta/play-meta.js',
pattern: /\/\/import play here/gi,
- templateFile: 'plop-templates/importToMeta.hbs',
+ templateFile: 'plop-templates/importToMeta.hbs'
},
{
type: 'modify',
path: 'src/meta/play-meta.js',
pattern: /\/\/replace new play item here/gi,
- templateFile: 'plop-templates/play.hbs',
- },
- ],
+ templateFile: 'plop-templates/play.hbs'
+ }
+ ]
});
-};
\ No newline at end of file
+};
diff --git a/src/App.css b/src/App.css
index 7e2e761558..dbd3b9d009 100644
--- a/src/App.css
+++ b/src/App.css
@@ -22,15 +22,15 @@
--color-brand-primary-rgb: 0, 244, 252;
--color-brand-primary-alt: #61dafb;
--color-brand-primary-dark: #00aada;
-
+
/* Neutral */
--color-neutral-10: #ffffff;
--color-neutral-20: #f6f6f9;
--color-neutral-30: #e0e0e6;
- --color-neutral-40: #BDBDBD;
- --color-neutral-50: #7F878A;
- --color-neutral-60: #5C6C70;
- --color-neutral-70: #3E5156;
+ --color-neutral-40: #bdbdbd;
+ --color-neutral-50: #7f878a;
+ --color-neutral-60: #5c6c70;
+ --color-neutral-70: #3e5156;
--color-neutral-80: #242230;
--color-neutral-90: #010326;
--color-neutral-100: #000000;
@@ -58,7 +58,6 @@
--fs-lg: 2rem;
--fs-xl: 3rem;
--fs-xxl: 4rem;
-
/* Line Height */
--lh-xs: 0.8em;
@@ -115,11 +114,9 @@ body * {
}
code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
- monospace;
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}
-
@media screen and (max-width: 1200px) {
:root {
/* Font Sizes */
@@ -202,4 +199,3 @@ code {
.app-footer a:focus {
color: var(--color-brand-primary-alt);
}
-
diff --git a/src/App.js b/src/App.js
index 63c3da6727..2e1f6cb7da 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,9 +1,9 @@
-import "App.css";
-import { Outlet } from "react-router-dom";
+import 'App.css';
+import { Outlet } from 'react-router-dom';
function App() {
return (
-
+
);
diff --git a/src/common/404/404.css b/src/common/404/404.css
index 5ea224850e..3e912ee693 100644
--- a/src/common/404/404.css
+++ b/src/common/404/404.css
@@ -1,63 +1,63 @@
.page-404 {
- padding: 2rem;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- min-height: calc(100vh - 120px);
+ padding: 2rem;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ min-height: calc(100vh - 120px);
}
.page-404-image {
- max-width: 100%;
- height: auto;
+ max-width: 100%;
+ height: auto;
}
.page-404-lead {
- margin: 0;
- font-family: var(--ff-accent);
- font-size: var(--fs-xl);
- text-align: center;
+ margin: 0;
+ font-family: var(--ff-accent);
+ font-size: var(--fs-xl);
+ text-align: center;
}
@media screen and (max-width: 768px) {
- .page-404-lead {
- line-height: var(--lh-rg);
- margin-bottom: 1rem;
- }
+ .page-404-lead {
+ line-height: var(--lh-rg);
+ margin-bottom: 1rem;
+ }
}
.page-404-desc {
- margin-top: 0;
- font-size: var(--fs-md);
- text-align: center;
+ margin-top: 0;
+ font-size: var(--fs-md);
+ text-align: center;
}
.page-404-link {
- position: relative;
- color: var(--color-neutral-80);
- text-decoration: none;
- transition: all .5s ease-in-out;
- font-weight: var(--fw-semibold);
+ position: relative;
+ color: var(--color-neutral-80);
+ text-decoration: none;
+ transition: all 0.5s ease-in-out;
+ font-weight: var(--fw-semibold);
}
.page-404-link:after {
- content: "";
- position: absolute;
- left: 0;
- right: 0;
- bottom: 2px;
- height: 2px;
- background-color: var(--color-brand-primary);
- transition: all .1s ease-in-out;
+ content: '';
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 2px;
+ height: 2px;
+ background-color: var(--color-brand-primary);
+ transition: all 0.1s ease-in-out;
}
.page-404-link:hover,
.page-404-link:focus {
- color: var(--color-neutral-90);
+ color: var(--color-neutral-90);
}
.page-404-link:hover:after,
.page-404-link:focus:after {
- height: 5px;
- bottom: 0;
- /* background-color: var(--color-neutral-90); */
-}
\ No newline at end of file
+ height: 5px;
+ bottom: 0;
+ /* background-color: var(--color-neutral-90); */
+}
diff --git a/src/common/404/PageNotFound.jsx b/src/common/404/PageNotFound.jsx
index 4a81da5045..df8af5b998 100644
--- a/src/common/404/PageNotFound.jsx
+++ b/src/common/404/PageNotFound.jsx
@@ -1,18 +1,21 @@
import { Link } from 'react-router-dom';
-import { ReactComponent as Image404 } from "images/img-404.svg";
-import "./404.css";
+import { ReactComponent as Image404 } from 'images/img-404.svg';
+import './404.css';
const PageNotFound = () => {
-
- return(
-
+ return (
+
- Look like you are lost
-
- Why don't you go back to home?
+
Look like you are lost
+
+ Why don't you go back to{' '}
+
+ home
+
+ ?
);
};
-export default PageNotFound;
\ No newline at end of file
+export default PageNotFound;
diff --git a/src/common/components/Comment.jsx b/src/common/components/Comment.jsx
index ae88a40814..703cfad748 100644
--- a/src/common/components/Comment.jsx
+++ b/src/common/components/Comment.jsx
@@ -1,11 +1,9 @@
-import Giscus from "@giscus/react";
+import Giscus from '@giscus/react';
const Comment = () => {
const projectRepoId = process.env.REACT_APP_GISCUS_PROJECT_REPO_ID;
- const discussionCategoryId =
- process.env.REACT_APP_GISCUS_DISCUSSION_CATEGORY_ID;
- const discussionCategoryName =
- process.env.REACT_APP_GISCUS_DISCUSSION_CATEGORY_NAME;
+ const discussionCategoryId = process.env.REACT_APP_GISCUS_DISCUSSION_CATEGORY_ID;
+ const discussionCategoryName = process.env.REACT_APP_GISCUS_DISCUSSION_CATEGORY_NAME;
return (
<>
diff --git a/src/common/components/LevelBadge.jsx b/src/common/components/LevelBadge.jsx
index 466dbb7f1a..8cdb2b17cd 100644
--- a/src/common/components/LevelBadge.jsx
+++ b/src/common/components/LevelBadge.jsx
@@ -1,43 +1,43 @@
-
import { useState, useEffect } from 'react';
-import { RiMedal2Fill } from "react-icons/ri";
-import { IoMdTrophy } from "react-icons/io";
-import { IoRibbon } from "react-icons/io5";
-
+import { RiMedal2Fill } from 'react-icons/ri';
+import { IoMdTrophy } from 'react-icons/io';
+import { IoRibbon } from 'react-icons/io5';
const LevelBadge = ({ level }) => {
const [playLevel, setPlayLevel] = useState(null);
useEffect(() => {
switch (level) {
- case "Beginner":
+ case 'Beginner':
setPlayLevel(
{level}
- );
+
+ );
break;
- case "Intermediate":
+ case 'Intermediate':
setPlayLevel(
{level}
- );
+
+ );
break;
- case "Advanced":
+ case 'Advanced':
setPlayLevel(
{level}
- );
+
+ );
break;
default:
setPlayLevel(
{level}
- );
+
+ );
}
}, [level]);
- return (
- <>{playLevel}>
- );
+ return <>{playLevel}>;
};
-export default LevelBadge;
\ No newline at end of file
+export default LevelBadge;
diff --git a/src/common/components/SocialShare.jsx b/src/common/components/SocialShare.jsx
index 0475279652..35694ebfcb 100644
--- a/src/common/components/SocialShare.jsx
+++ b/src/common/components/SocialShare.jsx
@@ -1,49 +1,69 @@
-
import { IoLogoFacebook, IoLogoTwitter, IoLogoLinkedin, IoLogoReddit } from 'react-icons/io5';
const SocialShare = () => {
-
const URL = window.location.href;
const VIA = 'reactplayIO';
-
+
const tweetIt = () => {
const msg = 'Learning ReactJS? Check out this awesome React Playlist!';
const hashTags = ['javascript', 'devcommunity', '100daysofcode', 'react', 'reactplay'];
const tags = encodeURIComponent(hashTags.join(','));
- return `https://twitter.com/intent/tweet?url=${URL}&text=${encodeURIComponent(msg)}&hashtags=${tags}&via=${VIA}`;
- }
+ return `https://twitter.com/intent/tweet?url=${URL}&text=${encodeURIComponent(
+ msg
+ )}&hashtags=${tags}&via=${VIA}`;
+ };
const postOnFB = () => {
- return `https://www.facebook.com/sharer.php?u=${URL}`
- }
+ return `https://www.facebook.com/sharer.php?u=${URL}`;
+ };
const postOnLinkedIn = () => {
return `https://www.linkedin.com/sharing/share-offsite/?url=${URL}`;
- }
+ };
const postOnReddit = () => {
const title = 'Learning ReactJS? Check out this awesome React Playlist!';
return `http://www.reddit.com/submit?url=${URL}&title=${encodeURIComponent(title)}`;
- }
+ };
- return(
+ return (
- )
+
+ );
};
-export default SocialShare;
\ No newline at end of file
+export default SocialShare;
diff --git a/src/common/components/YouTubeEmbed.jsx b/src/common/components/YouTubeEmbed.jsx
index c250695615..0ca38ee406 100644
--- a/src/common/components/YouTubeEmbed.jsx
+++ b/src/common/components/YouTubeEmbed.jsx
@@ -1,18 +1,18 @@
-
const YouTubeEmbed = ({ videoId, title }) => {
return (
VIDEO
+ allowFullScreen
+ />
);
};
-export default YouTubeEmbed;
\ No newline at end of file
+export default YouTubeEmbed;
diff --git a/src/common/footer/Footer.jsx b/src/common/footer/Footer.jsx
index 40bd2b2561..b4e5baad8b 100644
--- a/src/common/footer/Footer.jsx
+++ b/src/common/footer/Footer.jsx
@@ -1,14 +1,13 @@
-
-
const Footer = () => {
-
return (
- ReactPlay - The MIT License (MIT) Copyright ©{new Date().getFullYear()} {' '} is an open-source project made with ❤️ by Tapas Adhikary and friends.
+ ReactPlay - The MIT License (MIT) Copyright ©{new Date().getFullYear()} is an
+ open-source project made with ❤️ by{' '}
+
+ Tapas Adhikary
+ {' '}
+ and friends.
);
diff --git a/src/common/header/Header.jsx b/src/common/header/Header.jsx
index 6399914462..3188e18fd3 100644
--- a/src/common/header/Header.jsx
+++ b/src/common/header/Header.jsx
@@ -1,9 +1,9 @@
-import FilterPlays from "common/search/FilterPlays";
-import SearchPlays from "common/search/SearchPlays";
-import HeaderNav from "./HeaderNav";
-import { useEffect, useState } from "react";
-import { Link, useLocation } from "react-router-dom";
-import "./header.css";
+import FilterPlays from 'common/search/FilterPlays';
+import SearchPlays from 'common/search/SearchPlays';
+import HeaderNav from './HeaderNav';
+import { useEffect, useState } from 'react';
+import { Link, useLocation } from 'react-router-dom';
+import './header.css';
const Header = () => {
const location = useLocation();
@@ -12,42 +12,36 @@ const Header = () => {
const [showHideBits, setShowHideBits] = useState({
showSearch: true,
showBrowse: false,
- setHeaderStyle: true,
+ setHeaderStyle: true
});
useEffect(() => {
- if (pathName === "/") {
+ if (pathName === '/') {
setShowHideBits({
...showHideBits,
showSearch: false,
showBrowse: true,
- setHeaderStyle: false,
+ setHeaderStyle: false
});
- } else if (pathName === "/ideas") {
+ } else if (pathName === '/ideas') {
setShowHideBits({
...showHideBits,
showSearch: false,
showBrowse: true,
- setHeaderStyle: true,
+ setHeaderStyle: true
});
} else {
setShowHideBits({
...showHideBits,
showSearch: true,
showBrowse: false,
- setHeaderStyle: true,
+ setHeaderStyle: true
});
}
}, [pathName]);
return (
-
+
React Play
diff --git a/src/common/header/HeaderNav.jsx b/src/common/header/HeaderNav.jsx
index f8d672af05..f4b58255e2 100644
--- a/src/common/header/HeaderNav.jsx
+++ b/src/common/header/HeaderNav.jsx
@@ -1,12 +1,11 @@
-
import { useState } from 'react';
-import { Link } from "react-router-dom";
+import { Link } from 'react-router-dom';
import { BsTwitter, BsGithub } from 'react-icons/bs';
import { FaLightbulb } from 'react-icons/fa';
import { IoAddSharp, IoShareSocial } from 'react-icons/io5';
import { MdManageSearch, MdClose } from 'react-icons/md';
import SocialShare from 'common/components/SocialShare';
-import { Modal } from "common";
+import { Modal } from 'common';
const HeaderNav = ({ showBrowse }) => {
const [showSocial, setShowSocial] = useState(false);
@@ -18,22 +17,24 @@ const HeaderNav = ({ showBrowse }) => {
onClose={() => setShowSocial(false)}
show={showSocial}
cname="share"
- children={
-
- }
+ children={ }
/>
setShowToggleMenu(true)}>
-
- setShowToggleMenu(false)}>
-
- Close
+
+ setShowToggleMenu(false)}
+ >
+
+ Close
- {(showBrowse && !showToggleMenu) && (
+ {showBrowse && !showToggleMenu && (
@@ -81,8 +82,10 @@ const HeaderNav = ({ showBrowse }) => {
- setShowSocial(true)}>
+ setShowSocial(true)}
+ >
Share
diff --git a/src/common/header/header.css b/src/common/header/header.css
index 0f56a346b3..43994e0ff2 100644
--- a/src/common/header/header.css
+++ b/src/common/header/header.css
@@ -29,8 +29,8 @@
width: 178px;
height: 60px;
margin-right: 1rem;
- /* background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='179.712' height='60.577' viewBox='0 0 179.712 60.577'%3E%3Cg id='Group_12' data-name='Group 12' transform='translate(-301.998 -4.291)'%3E%3Cg id='Group_11' data-name='Group 11' transform='translate(297 12.413)'%3E%3Cpath id='Path_11' data-name='Path 11' d='M2 0V-19.17h8.478a5.441 5.441 0 0 1 2.444.554 6.321 6.321 0 0 1 1.931 1.458 6.88 6.88 0 0 1 1.269 2.052 6.172 6.172 0 0 1 .459 2.308 6.375 6.375 0 0 1-.932 3.389 5.347 5.347 0 0 1-2.524 2.2L17.5 0H13.311L9.4-6.426H5.724V0ZM5.724-9.693H10.4a1.97 1.97 0 0 0 .958-.243 2.452 2.452 0 0 0 .77-.661 3.3 3.3 0 0 0 .513-.985 3.818 3.818 0 0 0 .189-1.215 3.462 3.462 0 0 0-.216-1.242 3.241 3.241 0 0 0-.58-.985 2.625 2.625 0 0 0-.837-.648 2.173 2.173 0 0 0-.959-.23H5.724ZM25.758.27A7.851 7.851 0 0 1 22.68-.311 7.058 7.058 0 0 1 20.331-1.89a7.011 7.011 0 0 1-1.5-2.322 7.452 7.452 0 0 1-.526-2.781 7.88 7.88 0 0 1 .513-2.849A6.952 6.952 0 0 1 20.3-12.191 7.09 7.09 0 0 1 22.667-13.8a7.864 7.864 0 0 1 3.119-.594 7.669 7.669 0 0 1 3.092.594A7.109 7.109 0 0 1 31.2-12.2a6.77 6.77 0 0 1 1.458 2.322 7.733 7.733 0 0 1 .5 2.754q0 .351-.014.675a2.746 2.746 0 0 1-.067.54H22.14a4.2 4.2 0 0 0 .405 1.485 3.67 3.67 0 0 0 .837 1.107 3.645 3.645 0 0 0 1.161.7 3.813 3.813 0 0 0 1.35.243A4.171 4.171 0 0 0 27.932-2.9a2.787 2.787 0 0 0 1.309-1.391l3.1.864a6.312 6.312 0 0 1-2.5 2.66A7.741 7.741 0 0 1 25.758.27ZM29.43-8.262a3.761 3.761 0 0 0-1.175-2.551 3.59 3.59 0 0 0-2.524-.958 3.6 3.6 0 0 0-1.364.256 3.558 3.558 0 0 0-1.12.716 3.708 3.708 0 0 0-.8 1.107 3.9 3.9 0 0 0-.364 1.431ZM39.231.27a5.367 5.367 0 0 1-1.917-.338 4.608 4.608 0 0 1-1.539-.945A4.4 4.4 0 0 1 34.763-2.43 4.293 4.293 0 0 1 34.4-4.212a3.926 3.926 0 0 1 .445-1.85 4.241 4.241 0 0 1 1.242-1.444 6.157 6.157 0 0 1 1.9-.931 8.3 8.3 0 0 1 2.43-.338 10.471 10.471 0 0 1 1.85.162 7.533 7.533 0 0 1 1.606.459v-.81a2.836 2.836 0 0 0-.8-2.16 3.312 3.312 0 0 0-2.362-.756 6.257 6.257 0 0 0-2.214.405 10.282 10.282 0 0 0-2.214 1.188l-1.107-2.3a10.445 10.445 0 0 1 5.886-1.809 6.9 6.9 0 0 1 4.738 1.5 5.491 5.491 0 0 1 1.688 4.334v4.4a1.271 1.271 0 0 0 .2.81.887.887 0 0 0 .662.27V0a8.055 8.055 0 0 1-1.593.189A2.412 2.412 0 0 1 45.185-.27 1.973 1.973 0 0 1 44.5-1.485l-.081-.783a6.261 6.261 0 0 1-2.3 1.89A6.59 6.59 0 0 1 39.231.27Zm1.026-2.646A4.713 4.713 0 0 0 42-2.7a3.161 3.161 0 0 0 1.282-.864 1.3 1.3 0 0 0 .594-1.026V-6.21a8.858 8.858 0 0 0-1.4-.392 7.562 7.562 0 0 0-1.458-.148 3.865 3.865 0 0 0-2.3.635 1.905 1.905 0 0 0-.891 1.606 1.933 1.933 0 0 0 .7 1.526A2.548 2.548 0 0 0 40.257-2.376Zm9.72-4.7a7.7 7.7 0 0 1 .513-2.808A6.838 6.838 0 0 1 51.975-12.2 7.228 7.228 0 0 1 54.324-13.8a7.766 7.766 0 0 1 3.1-.594 7.441 7.441 0 0 1 3.955 1 6.381 6.381 0 0 1 2.444 2.619l-3.537 1.08a3.177 3.177 0 0 0-1.215-1.2 3.4 3.4 0 0 0-1.674-.418A3.446 3.446 0 0 0 55.944-11a3.584 3.584 0 0 0-1.174.864A4 4 0 0 0 53.986-8.8 5.044 5.044 0 0 0 53.7-7.074 4.837 4.837 0 0 0 54-5.346 4.356 4.356 0 0 0 54.8-4a3.5 3.5 0 0 0 1.174.878 3.384 3.384 0 0 0 1.431.31 3.47 3.47 0 0 0 1.8-.486 2.733 2.733 0 0 0 1.147-1.188L63.882-3.4a5.946 5.946 0 0 1-2.4 2.646A7.552 7.552 0 0 1 57.456.27a7.766 7.766 0 0 1-3.1-.594A7.123 7.123 0 0 1 52-1.931 7.128 7.128 0 0 1 50.5-4.28 7.556 7.556 0 0 1 49.977-7.074Zm24.6 6.345a16.145 16.145 0 0 1-1.782.648 7.486 7.486 0 0 1-2.214.324A5.139 5.139 0 0 1 69.161.054 3.117 3.117 0 0 1 68-.553a2.967 2.967 0 0 1-.8-1.08 3.909 3.909 0 0 1-.3-1.607v-8.127H65.043v-2.781h1.863v-4.59h3.618v4.59h2.97v2.781h-2.97v6.912a1.286 1.286 0 0 0 .392 1.067 1.494 1.494 0 0 0 .959.31 3.328 3.328 0 0 0 1.107-.189q.54-.189.864-.324ZM128.655 0V-19.17h8.127a5.441 5.441 0 0 1 2.443.554 6.321 6.321 0 0 1 1.93 1.458 6.88 6.88 0 0 1 1.269 2.052 6.172 6.172 0 0 1 .459 2.308 6.653 6.653 0 0 1-.432 2.363A6.56 6.56 0 0 1 141.237-8.4a5.969 5.969 0 0 1-1.89 1.431 5.468 5.468 0 0 1-2.43.54h-4.536V0Zm3.726-9.693h4.32a2.134 2.134 0 0 0 1.714-.837A3.463 3.463 0 0 0 139.1-12.8a3.735 3.735 0 0 0-.216-1.309 3.181 3.181 0 0 0-.567-.985 2.256 2.256 0 0 0-.824-.608 2.413 2.413 0 0 0-.958-.2h-4.158ZM145.1-19.71h3.618V-4.536a1.786 1.786 0 0 0 .378 1.215 1.358 1.358 0 0 0 1.08.432A2.71 2.71 0 0 0 150.89-3a4.84 4.84 0 0 0 .743-.27l.486 2.754a7 7 0 0 1-1.7.54 9.28 9.28 0 0 1-1.755.189 3.623 3.623 0 0 1-2.633-.9 3.429 3.429 0 0 1-.932-2.579ZM157.545.27a5.367 5.367 0 0 1-1.917-.338 4.608 4.608 0 0 1-1.539-.945 4.4 4.4 0 0 1-1.012-1.418 4.293 4.293 0 0 1-.365-1.782 3.926 3.926 0 0 1 .445-1.85A4.241 4.241 0 0 1 154.4-7.506a6.157 6.157 0 0 1 1.9-.931 8.3 8.3 0 0 1 2.43-.338 10.47 10.47 0 0 1 1.85.162 7.533 7.533 0 0 1 1.606.459v-.81a2.836 2.836 0 0 0-.8-2.16 3.312 3.312 0 0 0-2.363-.756 6.257 6.257 0 0 0-2.214.405 10.281 10.281 0 0 0-2.214 1.188l-1.107-2.3a10.445 10.445 0 0 1 5.886-1.809 6.9 6.9 0 0 1 4.739 1.5 5.491 5.491 0 0 1 1.688 4.334v4.4a1.271 1.271 0 0 0 .2.81.887.887 0 0 0 .661.27V0a8.055 8.055 0 0 1-1.593.189A2.412 2.412 0 0 1 163.5-.27a1.973 1.973 0 0 1-.689-1.215l-.081-.783a6.262 6.262 0 0 1-2.295 1.89A6.59 6.59 0 0 1 157.545.27Zm1.026-2.646a4.713 4.713 0 0 0 1.742-.324 3.161 3.161 0 0 0 1.283-.864 1.3 1.3 0 0 0 .594-1.026V-6.21a8.858 8.858 0 0 0-1.4-.392 7.562 7.562 0 0 0-1.458-.148 3.865 3.865 0 0 0-2.295.635 1.905 1.905 0 0 0-.891 1.606 1.933 1.933 0 0 0 .7 1.526A2.548 2.548 0 0 0 158.571-2.376Zm10.557 5.13a6.98 6.98 0 0 0 .891.2 4.855 4.855 0 0 0 .729.068 1.548 1.548 0 0 0 .648-.135 1.388 1.388 0 0 0 .54-.473 4.613 4.613 0 0 0 .486-.931q.243-.594.513-1.485l-5.589-14.148h3.726l3.834 11.016 3.4-11.016h3.4L175.77 2.808a5.066 5.066 0 0 1-1.755 2.43 4.935 4.935 0 0 1-3.078.945 5.852 5.852 0 0 1-.878-.068 5.611 5.611 0 0 1-.932-.229Z' transform='translate(3 33.587)' fill='%23fff'/%3E%3Cg id='Group_5' data-name='Group 5' transform='translate(83.211)'%3E%3Cg id='Group_10' data-name='Group 10'%3E%3Cg id='Ellipse_8' data-name='Ellipse 8' transform='translate(18.197 0) rotate(60)' fill='none' stroke='%2300f2fe' stroke-linecap='round' stroke-width='2.6'%3E%3Cellipse cx='20.579' cy='8.689' rx='20.579' ry='8.689' stroke='none'/%3E%3Cellipse cx='20.579' cy='8.689' rx='19.279' ry='7.389' fill='none'/%3E%3C/g%3E%3Cg id='Ellipse_9' data-name='Ellipse 9' transform='translate(-0.211 13.587)' fill='none' stroke='%2300f2fe' stroke-linecap='round' stroke-width='2.6'%3E%3Cellipse cx='20.5' cy='8.5' rx='20.5' ry='8.5' stroke='none'/%3E%3Cellipse cx='20.5' cy='8.5' rx='19.2' ry='7.2' fill='none'/%3E%3C/g%3E%3Cg id='Ellipse_10' data-name='Ellipse 10' transform='translate(38.776 8.689) rotate(120)' fill='none' stroke='%2300f2fe' stroke-linecap='round' stroke-width='2.6'%3E%3Cellipse cx='20.579' cy='8.689' rx='20.579' ry='8.689' stroke='none'/%3E%3Cellipse cx='20.579' cy='8.689' rx='19.279' ry='7.389' fill='none'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cpath id='Path_1' data-name='Path 1' d='M408.4 30.28l-4.563 7.985 4.563 6.274h7.7l4.706-6.844L416.81 30.28Z' transform='translate(-11.246 -2.736)' fill='%2361dafb'/%3E%3Cpath id='Polygon_2' data-name='Polygon 2' d='M26.2 12.227a2.645 2.645 0 0 1 4.523 2.6l-.018.048a2.645 2.645 0 0 0 2.04 3.529l.087.015a2.645 2.645 0 0 1 0 5.216l-.087.015a2.645 2.645 0 0 0-2.04 3.529l.018.048a2.645 2.645 0 0 1-4.523 2.6h0a2.645 2.645 0 0 0-4.089 0h0a2.645 2.645 0 0 1-4.523-2.6l.018-.048a2.645 2.645 0 0 0-2.04-3.529l-.087-.015a2.645 2.645 0 0 1 0-5.216l.087-.015a2.645 2.645 0 0 0 2.04-3.529l-.018-.048a2.645 2.645 0 0 1 4.523-2.6h0a2.645 2.645 0 0 0 4.089 0Z' transform='translate(390.665 4.291) rotate(30)' fill='%2300f2fe'/%3E%3Cpath id='Polygon_3' data-name='Polygon 3' d='M5.689 1.122a1 1 0 0 1 1.621 0l4.544 6.292A1 1 0 0 1 11.044 9H1.956a1 1 0 0 1-.811-1.585Z' transform='translate(407 27.544) rotate(90)' fill='%23010326'/%3E%3C/g%3E%3C/svg%3E"); */
- background-image: url("../../images/img-logo.svg");
+ /* background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='179.712' height='60.577' viewBox='0 0 179.712 60.577'%3E%3Cg id='Group_12' data-name='Group 12' transform='translate(-301.998 -4.291)'%3E%3Cg id='Group_11' data-name='Group 11' transform='translate(297 12.413)'%3E%3Cpath id='Path_11' data-name='Path 11' d='M2 0V-19.17h8.478a5.441 5.441 0 0 1 2.444.554 6.321 6.321 0 0 1 1.931 1.458 6.88 6.88 0 0 1 1.269 2.052 6.172 6.172 0 0 1 .459 2.308 6.375 6.375 0 0 1-.932 3.389 5.347 5.347 0 0 1-2.524 2.2L17.5 0H13.311L9.4-6.426H5.724V0ZM5.724-9.693H10.4a1.97 1.97 0 0 0 .958-.243 2.452 2.452 0 0 0 .77-.661 3.3 3.3 0 0 0 .513-.985 3.818 3.818 0 0 0 .189-1.215 3.462 3.462 0 0 0-.216-1.242 3.241 3.241 0 0 0-.58-.985 2.625 2.625 0 0 0-.837-.648 2.173 2.173 0 0 0-.959-.23H5.724ZM25.758.27A7.851 7.851 0 0 1 22.68-.311 7.058 7.058 0 0 1 20.331-1.89a7.011 7.011 0 0 1-1.5-2.322 7.452 7.452 0 0 1-.526-2.781 7.88 7.88 0 0 1 .513-2.849A6.952 6.952 0 0 1 20.3-12.191 7.09 7.09 0 0 1 22.667-13.8a7.864 7.864 0 0 1 3.119-.594 7.669 7.669 0 0 1 3.092.594A7.109 7.109 0 0 1 31.2-12.2a6.77 6.77 0 0 1 1.458 2.322 7.733 7.733 0 0 1 .5 2.754q0 .351-.014.675a2.746 2.746 0 0 1-.067.54H22.14a4.2 4.2 0 0 0 .405 1.485 3.67 3.67 0 0 0 .837 1.107 3.645 3.645 0 0 0 1.161.7 3.813 3.813 0 0 0 1.35.243A4.171 4.171 0 0 0 27.932-2.9a2.787 2.787 0 0 0 1.309-1.391l3.1.864a6.312 6.312 0 0 1-2.5 2.66A7.741 7.741 0 0 1 25.758.27ZM29.43-8.262a3.761 3.761 0 0 0-1.175-2.551 3.59 3.59 0 0 0-2.524-.958 3.6 3.6 0 0 0-1.364.256 3.558 3.558 0 0 0-1.12.716 3.708 3.708 0 0 0-.8 1.107 3.9 3.9 0 0 0-.364 1.431ZM39.231.27a5.367 5.367 0 0 1-1.917-.338 4.608 4.608 0 0 1-1.539-.945A4.4 4.4 0 0 1 34.763-2.43 4.293 4.293 0 0 1 34.4-4.212a3.926 3.926 0 0 1 .445-1.85 4.241 4.241 0 0 1 1.242-1.444 6.157 6.157 0 0 1 1.9-.931 8.3 8.3 0 0 1 2.43-.338 10.471 10.471 0 0 1 1.85.162 7.533 7.533 0 0 1 1.606.459v-.81a2.836 2.836 0 0 0-.8-2.16 3.312 3.312 0 0 0-2.362-.756 6.257 6.257 0 0 0-2.214.405 10.282 10.282 0 0 0-2.214 1.188l-1.107-2.3a10.445 10.445 0 0 1 5.886-1.809 6.9 6.9 0 0 1 4.738 1.5 5.491 5.491 0 0 1 1.688 4.334v4.4a1.271 1.271 0 0 0 .2.81.887.887 0 0 0 .662.27V0a8.055 8.055 0 0 1-1.593.189A2.412 2.412 0 0 1 45.185-.27 1.973 1.973 0 0 1 44.5-1.485l-.081-.783a6.261 6.261 0 0 1-2.3 1.89A6.59 6.59 0 0 1 39.231.27Zm1.026-2.646A4.713 4.713 0 0 0 42-2.7a3.161 3.161 0 0 0 1.282-.864 1.3 1.3 0 0 0 .594-1.026V-6.21a8.858 8.858 0 0 0-1.4-.392 7.562 7.562 0 0 0-1.458-.148 3.865 3.865 0 0 0-2.3.635 1.905 1.905 0 0 0-.891 1.606 1.933 1.933 0 0 0 .7 1.526A2.548 2.548 0 0 0 40.257-2.376Zm9.72-4.7a7.7 7.7 0 0 1 .513-2.808A6.838 6.838 0 0 1 51.975-12.2 7.228 7.228 0 0 1 54.324-13.8a7.766 7.766 0 0 1 3.1-.594 7.441 7.441 0 0 1 3.955 1 6.381 6.381 0 0 1 2.444 2.619l-3.537 1.08a3.177 3.177 0 0 0-1.215-1.2 3.4 3.4 0 0 0-1.674-.418A3.446 3.446 0 0 0 55.944-11a3.584 3.584 0 0 0-1.174.864A4 4 0 0 0 53.986-8.8 5.044 5.044 0 0 0 53.7-7.074 4.837 4.837 0 0 0 54-5.346 4.356 4.356 0 0 0 54.8-4a3.5 3.5 0 0 0 1.174.878 3.384 3.384 0 0 0 1.431.31 3.47 3.47 0 0 0 1.8-.486 2.733 2.733 0 0 0 1.147-1.188L63.882-3.4a5.946 5.946 0 0 1-2.4 2.646A7.552 7.552 0 0 1 57.456.27a7.766 7.766 0 0 1-3.1-.594A7.123 7.123 0 0 1 52-1.931 7.128 7.128 0 0 1 50.5-4.28 7.556 7.556 0 0 1 49.977-7.074Zm24.6 6.345a16.145 16.145 0 0 1-1.782.648 7.486 7.486 0 0 1-2.214.324A5.139 5.139 0 0 1 69.161.054 3.117 3.117 0 0 1 68-.553a2.967 2.967 0 0 1-.8-1.08 3.909 3.909 0 0 1-.3-1.607v-8.127H65.043v-2.781h1.863v-4.59h3.618v4.59h2.97v2.781h-2.97v6.912a1.286 1.286 0 0 0 .392 1.067 1.494 1.494 0 0 0 .959.31 3.328 3.328 0 0 0 1.107-.189q.54-.189.864-.324ZM128.655 0V-19.17h8.127a5.441 5.441 0 0 1 2.443.554 6.321 6.321 0 0 1 1.93 1.458 6.88 6.88 0 0 1 1.269 2.052 6.172 6.172 0 0 1 .459 2.308 6.653 6.653 0 0 1-.432 2.363A6.56 6.56 0 0 1 141.237-8.4a5.969 5.969 0 0 1-1.89 1.431 5.468 5.468 0 0 1-2.43.54h-4.536V0Zm3.726-9.693h4.32a2.134 2.134 0 0 0 1.714-.837A3.463 3.463 0 0 0 139.1-12.8a3.735 3.735 0 0 0-.216-1.309 3.181 3.181 0 0 0-.567-.985 2.256 2.256 0 0 0-.824-.608 2.413 2.413 0 0 0-.958-.2h-4.158ZM145.1-19.71h3.618V-4.536a1.786 1.786 0 0 0 .378 1.215 1.358 1.358 0 0 0 1.08.432A2.71 2.71 0 0 0 150.89-3a4.84 4.84 0 0 0 .743-.27l.486 2.754a7 7 0 0 1-1.7.54 9.28 9.28 0 0 1-1.755.189 3.623 3.623 0 0 1-2.633-.9 3.429 3.429 0 0 1-.932-2.579ZM157.545.27a5.367 5.367 0 0 1-1.917-.338 4.608 4.608 0 0 1-1.539-.945 4.4 4.4 0 0 1-1.012-1.418 4.293 4.293 0 0 1-.365-1.782 3.926 3.926 0 0 1 .445-1.85A4.241 4.241 0 0 1 154.4-7.506a6.157 6.157 0 0 1 1.9-.931 8.3 8.3 0 0 1 2.43-.338 10.47 10.47 0 0 1 1.85.162 7.533 7.533 0 0 1 1.606.459v-.81a2.836 2.836 0 0 0-.8-2.16 3.312 3.312 0 0 0-2.363-.756 6.257 6.257 0 0 0-2.214.405 10.281 10.281 0 0 0-2.214 1.188l-1.107-2.3a10.445 10.445 0 0 1 5.886-1.809 6.9 6.9 0 0 1 4.739 1.5 5.491 5.491 0 0 1 1.688 4.334v4.4a1.271 1.271 0 0 0 .2.81.887.887 0 0 0 .661.27V0a8.055 8.055 0 0 1-1.593.189A2.412 2.412 0 0 1 163.5-.27a1.973 1.973 0 0 1-.689-1.215l-.081-.783a6.262 6.262 0 0 1-2.295 1.89A6.59 6.59 0 0 1 157.545.27Zm1.026-2.646a4.713 4.713 0 0 0 1.742-.324 3.161 3.161 0 0 0 1.283-.864 1.3 1.3 0 0 0 .594-1.026V-6.21a8.858 8.858 0 0 0-1.4-.392 7.562 7.562 0 0 0-1.458-.148 3.865 3.865 0 0 0-2.295.635 1.905 1.905 0 0 0-.891 1.606 1.933 1.933 0 0 0 .7 1.526A2.548 2.548 0 0 0 158.571-2.376Zm10.557 5.13a6.98 6.98 0 0 0 .891.2 4.855 4.855 0 0 0 .729.068 1.548 1.548 0 0 0 .648-.135 1.388 1.388 0 0 0 .54-.473 4.613 4.613 0 0 0 .486-.931q.243-.594.513-1.485l-5.589-14.148h3.726l3.834 11.016 3.4-11.016h3.4L175.77 2.808a5.066 5.066 0 0 1-1.755 2.43 4.935 4.935 0 0 1-3.078.945 5.852 5.852 0 0 1-.878-.068 5.611 5.611 0 0 1-.932-.229Z' transform='translate(3 33.587)' fill='%23fff'/%3E%3Cg id='Group_5' data-name='Group 5' transform='translate(83.211)'%3E%3Cg id='Group_10' data-name='Group 10'%3E%3Cg id='Ellipse_8' data-name='Ellipse 8' transform='translate(18.197 0) rotate(60)' fill='none' stroke='%2300f2fe' stroke-linecap='round' stroke-width='2.6'%3E%3Cellipse cx='20.579' cy='8.689' rx='20.579' ry='8.689' stroke='none'/%3E%3Cellipse cx='20.579' cy='8.689' rx='19.279' ry='7.389' fill='none'/%3E%3C/g%3E%3Cg id='Ellipse_9' data-name='Ellipse 9' transform='translate(-0.211 13.587)' fill='none' stroke='%2300f2fe' stroke-linecap='round' stroke-width='2.6'%3E%3Cellipse cx='20.5' cy='8.5' rx='20.5' ry='8.5' stroke='none'/%3E%3Cellipse cx='20.5' cy='8.5' rx='19.2' ry='7.2' fill='none'/%3E%3C/g%3E%3Cg id='Ellipse_10' data-name='Ellipse 10' transform='translate(38.776 8.689) rotate(120)' fill='none' stroke='%2300f2fe' stroke-linecap='round' stroke-width='2.6'%3E%3Cellipse cx='20.579' cy='8.689' rx='20.579' ry='8.689' stroke='none'/%3E%3Cellipse cx='20.579' cy='8.689' rx='19.279' ry='7.389' fill='none'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cpath id='Path_1' data-name='Path 1' d='M408.4 30.28l-4.563 7.985 4.563 6.274h7.7l4.706-6.844L416.81 30.28Z' transform='translate(-11.246 -2.736)' fill='%2361dafb'/%3E%3Cpath id='Polygon_2' data-name='Polygon 2' d='M26.2 12.227a2.645 2.645 0 0 1 4.523 2.6l-.018.048a2.645 2.645 0 0 0 2.04 3.529l.087.015a2.645 2.645 0 0 1 0 5.216l-.087.015a2.645 2.645 0 0 0-2.04 3.529l.018.048a2.645 2.645 0 0 1-4.523 2.6h0a2.645 2.645 0 0 0-4.089 0h0a2.645 2.645 0 0 1-4.523-2.6l.018-.048a2.645 2.645 0 0 0-2.04-3.529l-.087-.015a2.645 2.645 0 0 1 0-5.216l.087-.015a2.645 2.645 0 0 0 2.04-3.529l-.018-.048a2.645 2.645 0 0 1 4.523-2.6h0a2.645 2.645 0 0 0 4.089 0Z' transform='translate(390.665 4.291) rotate(30)' fill='%2300f2fe'/%3E%3Cpath id='Polygon_3' data-name='Polygon 3' d='M5.689 1.122a1 1 0 0 1 1.621 0l4.544 6.292A1 1 0 0 1 11.044 9H1.956a1 1 0 0 1-.811-1.585Z' transform='translate(407 27.544) rotate(90)' fill='%23010326'/%3E%3C/g%3E%3C/svg%3E"); */
+ background-image: url('../../images/img-logo.svg');
background-size: contain;
background-repeat: no-repeat;
transition: all 0.16s ease-in-out;
@@ -41,7 +41,7 @@
width: 58px;
height: 64px;
margin-right: 0;
- background-image: url("../../images/img-logo-sm.svg");
+ background-image: url('../../images/img-logo-sm.svg');
background-position: center center;
}
}
@@ -56,18 +56,18 @@
}
.navbar-toggler {
- padding: 0.5rem 0.5rem;
- font-size: 1.25rem;
- background-color: transparent;
- border-radius: 2rem;
- transition: box-shadow .15s ease-in-out;
- color: var(--color-neutral-20);
- display: inline-flex;
- align-items: center;
- border-color: transparent;
-}
-
-.navbar-toggler .navbar-toggler-icon{
+ padding: 0.5rem 0.5rem;
+ font-size: 1.25rem;
+ background-color: transparent;
+ border-radius: 2rem;
+ transition: box-shadow 0.15s ease-in-out;
+ color: var(--color-neutral-20);
+ display: inline-flex;
+ align-items: center;
+ border-color: transparent;
+}
+
+.navbar-toggler .navbar-toggler-icon {
display: inline-block;
width: 1.5em;
height: 1.5em;
@@ -76,7 +76,7 @@
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
- opacity: .7;
+ opacity: 0.7;
}
.navbar-toggler:hover,
@@ -103,7 +103,7 @@
}
.navbar-collapse.show:before {
- content: "";
+ content: '';
background-color: var(--color-neutral-90);
position: fixed;
top: 0;
@@ -126,7 +126,7 @@
flex-direction: column;
z-index: 1;
align-items: flex-start;
- grid-gap: .6rem;
+ grid-gap: 0.6rem;
}
@media (min-width: 768px) {
@@ -135,8 +135,8 @@
}
.navbar-collapse {
- display: flex!important;
- flex-basis: auto;
+ display: flex !important;
+ flex-basis: auto;
}
}
@@ -213,11 +213,11 @@
}
.navbar-collapse.show .header-links {
- grid-gap: .2rem;
+ grid-gap: 0.2rem;
}
.header-links > li.menu-spacer {
- margin: .4rem 0 1rem 0;
+ margin: 0.4rem 0 1rem 0;
}
.header-links > li > .app-header-btn--default .btn-label {
@@ -281,11 +281,11 @@
}
.navbar-collapse.show .header-links > li > .app-header-btn--default:hover .btn-label,
-.navbar-collapse.show .header-links > li > .app-header-btn--default:focus .btn-label{
+.navbar-collapse.show .header-links > li > .app-header-btn--default:focus .btn-label {
color: var(--color-neutral-90);
}
-.navbar-collapse.show .header-links > li > .app-header-btn--default:hover .icon ,
+.navbar-collapse.show .header-links > li > .app-header-btn--default:hover .icon,
.navbar-collapse.show .header-links > li > .app-header-btn--default:focus .icon {
fill: var(--color-brand-primary-dark);
}
@@ -307,7 +307,7 @@
.menu-closer .navbar-closer {
border: 0;
- padding: .4rem;
+ padding: 0.4rem;
background: transparent;
height: 2rem;
}
@@ -323,8 +323,6 @@
fill: var(--color-neutral-90);
}
-
-
@media screen and (max-width: 768px) {
}
@@ -338,7 +336,6 @@
} */
}
-
/* searchs Modal */
.modal-share {
position: fixed;
@@ -347,20 +344,19 @@
z-index: 100;
display: flex;
flex-direction: column;
-
+
/* Probably need media queries here */
width: 400px;
max-width: 90%;
max-height: 90%;
border-radius: 0.2rem;
-
+
transform: translate(-50%, -50%);
-
- background: white;
- box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
+ background: white;
+ box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
}
.modal-share .modal-share-header {
@@ -391,10 +387,8 @@
margin-bottom: 1rem;
}
-
.modal-share .form-group:last-child {
margin-bottom: 0;
-
}
.modal-share .form-group label {
@@ -426,4 +420,4 @@
}
.social-share-buttons .social-share-button:hover .icon {
fill: var(--color-brand-primary);
-}
\ No newline at end of file
+}
diff --git a/src/common/home/Contributors.jsx b/src/common/home/Contributors.jsx
index 9c904c437f..a1bf065463 100644
--- a/src/common/home/Contributors.jsx
+++ b/src/common/home/Contributors.jsx
@@ -1,4 +1,4 @@
-import useContributors from "common/hooks/useContributors";
+import useContributors from 'common/hooks/useContributors';
const Contributors = () => {
const { data, error, isLoading } = useContributors(true);
diff --git a/src/common/home/Home.jsx b/src/common/home/Home.jsx
index 9c53f7ec96..227a9fc822 100644
--- a/src/common/home/Home.jsx
+++ b/src/common/home/Home.jsx
@@ -1,32 +1,31 @@
-import { useState, useEffect, useContext } from "react";
-import useFetch from "common/hooks/useFetch";
-import { Link } from "react-router-dom";
-import "./home.css";
-import { RiSlideshow4Line } from "react-icons/ri";
-import { BiShareAlt, BiAddToQueue } from "react-icons/bi";
-import { BsGithub } from "react-icons/bs";
-import { FiStar } from "react-icons/fi";
+import { useState, useEffect, useContext } from 'react';
+import useFetch from 'common/hooks/useFetch';
+import { Link } from 'react-router-dom';
+import './home.css';
+import { RiSlideshow4Line } from 'react-icons/ri';
+import { BiShareAlt, BiAddToQueue } from 'react-icons/bi';
+import { BsGithub } from 'react-icons/bs';
+import { FiStar } from 'react-icons/fi';
import { FaLightbulb } from 'react-icons/fa';
-import { ReactComponent as Flower } from "images/icon-flower.svg";
-import { MdManageSearch } from "react-icons/md";
+import { ReactComponent as Flower } from 'images/icon-flower.svg';
+import { MdManageSearch } from 'react-icons/md';
import YoutubeVideoEmbed from 'common/components/YouTubeEmbed';
-import FeaturedPlays from "common/playlists/FeaturedPlays";
-import Contributors from "./Contributors";
-import { SearchContext } from "common/search/search-context";
+import FeaturedPlays from 'common/playlists/FeaturedPlays';
+import Contributors from './Contributors';
+import { SearchContext } from 'common/search/search-context';
const Home = () => {
- const [gitHubStars, setGitHubStars] = useState("...");
- const { data } = useFetch("https://api.github.com/repos/reactplay/react-play");
- const { setSearchTerm, searchTerm, setFilterQuery } =
- useContext(SearchContext);
+ const [gitHubStars, setGitHubStars] = useState('...');
+ const { data } = useFetch('https://api.github.com/repos/reactplay/react-play');
+ const { setSearchTerm, searchTerm, setFilterQuery } = useContext(SearchContext);
useEffect(() => {
setGitHubStars(data.stargazers_count);
- setSearchTerm("");
+ setSearchTerm('');
setFilterQuery({
- level: "",
+ level: '',
tags: [],
- creator: "",
- language: ""
+ creator: '',
+ language: ''
});
}, [data, setSearchTerm, searchTerm, setFilterQuery]);
@@ -44,9 +43,8 @@ const Home = () => {
with ReactPlay
- ReactPlay is an open-source platform to learn, create and share
- ReactJS projects with the developer community. Start by browsing the
- plays or exploring the source code.
+ ReactPlay is an open-source platform to learn, create and share ReactJS projects with
+ the developer community. Start by browsing the plays or exploring the source code.
@@ -61,15 +59,18 @@ const Home = () => {
>
- GitHub{" "}
+ GitHub{' '}
{" "}
+ {' '}
-
+
-
+
@@ -77,17 +78,13 @@ const Home = () => {
-
+
Learn
- Learn how to "Think in React" and build applications inspired by
- several plays(source code & demos). Get to the source code of it,
- find related article, or even a YouTube video. Learn from the
- expert code reviews.
+ Learn how to "Think in React" and build applications inspired by several plays(source
+ code & demos). Get to the source code of it, find related article, or even a YouTube
+ video. Learn from the expert code reviews.
@@ -96,10 +93,9 @@ const Home = () => {
Create
- Create your own plays and own them by following a few simple
- steps. Learned something new? Perfect to present as a play. You
- can also contribute to the existing plays. Your play will be
- reviewed by the experts before being made public.
+ Create your own plays and own them by following a few simple steps. Learned something
+ new? Perfect to present as a play. You can also contribute to the existing plays. Your
+ play will be reviewed by the experts before being made public.
@@ -108,15 +104,14 @@ const Home = () => {
Socialize
- Share your plays with the community. The best way of building in
- public is by sharing the learning. You can share your plays on
- social media platforms like Facebook, Twitter, LinkedIn, to name a
- few, just with a single click.
+ Share your plays with the community. The best way of building in public is by sharing
+ the learning. You can share your plays on social media platforms like Facebook,
+ Twitter, LinkedIn, to name a few, just with a single click.
-
+
Not sure how to get started?
We have got lot of ideas
diff --git a/src/common/home/home.css b/src/common/home/home.css
index f70818998e..06f4a480d3 100644
--- a/src/common/home/home.css
+++ b/src/common/home/home.css
@@ -1,856 +1,865 @@
/* Home Body content */
.app-home-body {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- /* background-color: var(--color-neutral-90); */
- background: rgb(1,4,38);
- background: rgb(1,4,38);
- background: -moz-linear-gradient(180deg, rgba(1,4,38,1) 0%, rgba(76,91,94,1) 100%);
- background: -webkit-linear-gradient(180deg, rgba(1,4,38,1) 0%, rgba(76,91,94,1) 100%);
- background: linear-gradient(180deg, rgba(1,4,38,1) 0%, rgba(76,91,94,1) 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#010426",endColorstr="#4c5b5e",GradientType=1);
- padding: 6rem 0 2rem 0;
- width: 100%;
- overflow-x: hidden;
- min-height: 100vh;
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ /* background-color: var(--color-neutral-90); */
+ background: rgb(1, 4, 38);
+ background: rgb(1, 4, 38);
+ background: -moz-linear-gradient(180deg, rgba(1, 4, 38, 1) 0%, rgba(76, 91, 94, 1) 100%);
+ background: -webkit-linear-gradient(180deg, rgba(1, 4, 38, 1) 0%, rgba(76, 91, 94, 1) 100%);
+ background: linear-gradient(180deg, rgba(1, 4, 38, 1) 0%, rgba(76, 91, 94, 1) 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#010426",endColorstr="#4c5b5e",GradientType=1);
+ padding: 6rem 0 2rem 0;
+ width: 100%;
+ overflow-x: hidden;
+ min-height: 100vh;
}
.app-home-body .app-home-body-content {
- margin-bottom: 4rem;
+ margin-bottom: 4rem;
}
.app-home-body .body-title {
- margin-bottom: 1rem;
- font-family: var(--ff-accent);
- font-size: var(--fs-xxl);
- color: var(--color-neutral-10);
- text-align: center;
- line-height: var(--lh-rg);
+ margin-bottom: 1rem;
+ font-family: var(--ff-accent);
+ font-size: var(--fs-xxl);
+ color: var(--color-neutral-10);
+ text-align: center;
+ line-height: var(--lh-rg);
}
@media screen and (max-width: 768px) {
- .app-home-body {
- min-height: unset;
- }
+ .app-home-body {
+ min-height: unset;
+ }
- .app-home-body .app-home-body-content {
- margin-bottom: 0;
- }
+ .app-home-body .app-home-body-content {
+ margin-bottom: 0;
+ }
- .app-home-body .body-title {
- margin-left: 1rem;
- margin-right: 1rem;
- }
- .app-home-body .body-title br {
- display: none;
- }
+ .app-home-body .body-title {
+ margin-left: 1rem;
+ margin-right: 1rem;
+ }
+ .app-home-body .body-title br {
+ display: none;
+ }
}
.app-home-body .body-title strong {
- font-family: var(--ff-accent);
- position: relative;
- color: var(--color-brand-primary);
- text-align: center;
+ font-family: var(--ff-accent);
+ position: relative;
+ color: var(--color-brand-primary);
+ text-align: center;
}
.app-home-body .body-title strong::after {
- content: "";
- position: absolute;
- height: 2px;
- left: 0;
- bottom: 8px;
- right: 0;
- background-color: var(--color-neutral-10);
+ content: '';
+ position: absolute;
+ height: 2px;
+ left: 0;
+ bottom: 8px;
+ right: 0;
+ background-color: var(--color-neutral-10);
}
@media screen and (max-width: 1200px) {
- .app-home-body .body-title strong::after {
- height: 1px;
- bottom: 3px;
- }
+ .app-home-body .body-title strong::after {
+ height: 1px;
+ bottom: 3px;
+ }
}
.app-home-body .body-desc {
- margin: .4rem auto 2rem auto;
- font-weight: var(--fw-light);
- font-size: var(--fs-md);
- color: var(--color-neutral-40);
- text-align: center;
- width: 80%;
- max-width: var(--screen-lg-max);
+ margin: 0.4rem auto 2rem auto;
+ font-weight: var(--fw-light);
+ font-size: var(--fs-md);
+ color: var(--color-neutral-40);
+ text-align: center;
+ width: 80%;
+ max-width: var(--screen-lg-max);
}
.app-home-body .body-c2a {
- position: relative;
- display: flex;
- flex-direction: row;
- grid-gap: 1rem;
- margin: 1rem auto;
- justify-content: center;
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ grid-gap: 1rem;
+ margin: 1rem auto;
+ justify-content: center;
}
.app-home-body .body-c2a .body-c2a-btn {
- border: solid 1px var(--color-neutral-40);
- border-radius: 2rem;
- display: flex;
- flex-direction: row;
- align-items: center;
- grid-gap: 0.4rem;
- padding: 1rem 2rem;
- font-size: var(--fs-rg)*1.2;
- font-weight: var(--fw-bold);
- text-decoration: none;
- width: unset;
- height: unset;
- transition: all 0.12s ease-in-out;
- color: var(--color-neutral-10);
- cursor: pointer;
+ border: solid 1px var(--color-neutral-40);
+ border-radius: 2rem;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ grid-gap: 0.4rem;
+ padding: 1rem 2rem;
+ font-size: var(--fs-rg) * 1.2;
+ font-weight: var(--fw-bold);
+ text-decoration: none;
+ width: unset;
+ height: unset;
+ transition: all 0.12s ease-in-out;
+ color: var(--color-neutral-10);
+ cursor: pointer;
}
.app-home-body .body-c2a .body-c2a-btn .icon {
- width: var(--navbar-icon-size-rg);
- height: var(--navbar-icon-size-rg);
- fill: var(--color-brand-primary-dark);
- color: var(--color-brand-primary-dark);
+ width: var(--navbar-icon-size-rg);
+ height: var(--navbar-icon-size-rg);
+ fill: var(--color-brand-primary-dark);
+ color: var(--color-brand-primary-dark);
}
.app-home-body .body-c2a .body-c2a-btn:hover,
.app-home-body .body-c2a .body-c2a-btn:focus {
- border-color: var(--color-neutral-20);
- background-color: var(--color-neutral-20);
- color: var(--color-neutral-90);
+ border-color: var(--color-neutral-20);
+ background-color: var(--color-neutral-20);
+ color: var(--color-neutral-90);
}
.app-home-body .body-c2a .body-c2a-btn:hover .icon,
.app-home-body .body-c2a .body-c2a-btn:focus .icon {
- fill: var(--color-brand-primary-dark);
- color: var(--color-brand-primary-dark);
+ fill: var(--color-brand-primary-dark);
+ color: var(--color-brand-primary-dark);
}
.app-home-body .body-c2a .body-c2a-btn .btn-label {
- display: flex;
- align-items: center;
- grid-gap: 1.2rem;
+ display: flex;
+ align-items: center;
+ grid-gap: 1.2rem;
}
.app-home-body .body-c2a .body-c2a-btn .btn-label .label-info-more .more-label {
- line-height: var(--lh-rg);
- font-weight: var(--fw-regular);
- /* font-size: var(--fs-rg); */
- padding-top: 0.06rem;
+ line-height: var(--lh-rg);
+ font-weight: var(--fw-regular);
+ /* font-size: var(--fs-rg); */
+ padding-top: 0.06rem;
}
.app-home-body .body-c2a .body-c2a-btn .btn-label .label-info-more {
- display: flex;
- flex-direction: row;
- align-items: center;
- grid-gap: 0.2rem;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ grid-gap: 0.2rem;
}
.app-home-body .body-c2a .body-c2a-btn--primary {
- border: solid 2px var(--color-brand-primary);
- background-color: var(--color-brand-primary);
- color: var(--color-neutral-80);
+ border: solid 2px var(--color-brand-primary);
+ background-color: var(--color-brand-primary);
+ color: var(--color-neutral-80);
}
.app-home-body .body-c2a .body-c2a-btn--primary .icon {
- fill: var(--color-neutral-90);
+ fill: var(--color-neutral-90);
}
@media screen and (max-width: 576px) {
- .app-home-body .body-c2a {
- flex-direction: column;
- width: 80%;
- }
+ .app-home-body .body-c2a {
+ flex-direction: column;
+ width: 80%;
+ }
}
-
-
/* Video */
.video {
- width: 60%;
- max-width: 720px;
- margin: 6rem auto 0 auto;
- box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
+ width: 60%;
+ max-width: 720px;
+ margin: 6rem auto 0 auto;
+ box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
}
@media screen and (max-width: 1200px) {
- .video {
- width: 60%;
- margin: 4rem auto 4rem auto;
- }
+ .video {
+ width: 60%;
+ margin: 4rem auto 4rem auto;
+ }
}
@media screen and (max-width: 1024px) {
- .video {
- width: 80%;
- margin: 4rem auto 0 auto;
- }
+ .video {
+ width: 80%;
+ margin: 4rem auto 0 auto;
+ }
}
@media screen and (max-width: 768px) {
- .video {
- width: 80%;
- margin: 2rem auto 0 auto;
- }
+ .video {
+ width: 80%;
+ margin: 2rem auto 0 auto;
+ }
}
@media screen and (max-width: 600px) {
- .video {
- width: 90%;
- margin: 4rem auto 0 auto;
- }
+ .video {
+ width: 90%;
+ margin: 4rem auto 0 auto;
+ }
}
.video-wrapper {
- border-radius: 1rem;
- position: relative;
- width: 100%;
- padding-bottom: 56.25%;
- margin-bottom: 48px;
- background-color: #000;
- overflow: hidden;
+ border-radius: 1rem;
+ position: relative;
+ width: 100%;
+ padding-bottom: 56.25%;
+ margin-bottom: 48px;
+ background-color: #000;
+ overflow: hidden;
}
.video-wrapper .video-iframe {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- border: 0;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ border: 0;
}
/* Home Features */
:root {
- --home-features-icon-size: 120px;
+ --home-features-icon-size: 120px;
}
.home-features {
- position: relative;
- padding: 8rem 0;
+ position: relative;
+ padding: 8rem 0;
}
.list-home-features {
- position: relative;
- list-style: none;
- margin: 0 auto;
- padding: 0;
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- grid-gap: 3rem;
- width: 80%;
- max-width: var(--screen-lg-max);
+ position: relative;
+ list-style: none;
+ margin: 0 auto;
+ padding: 0;
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ grid-gap: 3rem;
+ width: 80%;
+ max-width: var(--screen-lg-max);
}
-@media screen and (max-width:1024px) {
- .list-home-features {
- grid-template-columns: repeat(2, 1fr);
- }
+@media screen and (max-width: 1024px) {
+ .list-home-features {
+ grid-template-columns: repeat(2, 1fr);
+ }
}
-@media screen and (max-width:568px) {
- .list-home-features {
- grid-template-columns: repeat(1, 1fr);
- }
+@media screen and (max-width: 568px) {
+ .list-home-features {
+ grid-template-columns: repeat(1, 1fr);
+ }
}
.list-home-features .home-features-item {
- list-style: none;
- color: var(--color-neutral-10);
+ list-style: none;
+ color: var(--color-neutral-10);
}
.list-home-features .home-features-item .item-icon {
- margin: 0 auto;
- display: flex;
- align-items: center;
- justify-content: center;
- width: var(--home-features-icon-size);
- height: var(--home-features-icon-size);
- background-color: var(--color-brand-primary);
- border: solid 2px var(--color-brand-primary);
- border-top-left-radius: calc(var(--home-features-icon-size)/2);
- border-bottom-left-radius: calc(var(--home-features-icon-size)/2);
- border-bottom-right-radius: calc(var(--home-features-icon-size)/2);
- /* box-shadow: 0px -1px 26px 0px rgba(0,14,17,0.59);
+ margin: 0 auto;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: var(--home-features-icon-size);
+ height: var(--home-features-icon-size);
+ background-color: var(--color-brand-primary);
+ border: solid 2px var(--color-brand-primary);
+ border-top-left-radius: calc(var(--home-features-icon-size) / 2);
+ border-bottom-left-radius: calc(var(--home-features-icon-size) / 2);
+ border-bottom-right-radius: calc(var(--home-features-icon-size) / 2);
+ /* box-shadow: 0px -1px 26px 0px rgba(0,14,17,0.59);
-webkit-box-shadow: 0px -1px 26px 0px rgba(0,14,17,0.59);
-moz-box-shadow: 0px -1px 26px 0px rgba(0,14,17,0.59); */
}
.list-home-features .home-features-item .item-icon .icon {
- width: 48px;
- height: 48px;
+ width: 48px;
+ height: 48px;
}
.list-home-features .home-features-item .item-title {
- margin: 1rem 0 0.6rem 0;
- font-family: var(--ff-accent);
- font-size: var(--fs-lg);
- text-align: center;
- letter-spacing: 0.02em;
- color: var(--color-neutral-80);
-
+ margin: 1rem 0 0.6rem 0;
+ font-family: var(--ff-accent);
+ font-size: var(--fs-lg);
+ text-align: center;
+ letter-spacing: 0.02em;
+ color: var(--color-neutral-80);
}
.list-home-features .home-features-item .item-desc {
- margin: 0;
- font-size: var(--fs-rg);
- text-align: center;
- color: var(--color-neutral-60);
-
+ margin: 0;
+ font-size: var(--fs-rg);
+ text-align: center;
+ color: var(--color-neutral-60);
}
/* Home ideas */
.home-ideas {
- max-width: var(--screen-lg-max);
- margin: 4rem auto 0 auto;
- padding: 4rem 0 0 0;
- border-top: solid 1px var(--color-neutral-30);
- text-align: center;
+ max-width: var(--screen-lg-max);
+ margin: 4rem auto 0 auto;
+ padding: 4rem 0 0 0;
+ border-top: solid 1px var(--color-neutral-30);
+ text-align: center;
}
.home-ideas .ideas-title {
- margin: 0 0 3rem 0;
- font-family: var(--ff-accent);
- font-size: var(--fs-xl);
- font-weight: var(--fw-bold);
- color: var(--color-brand-primary);
+ margin: 0 0 3rem 0;
+ font-family: var(--ff-accent);
+ font-size: var(--fs-xl);
+ font-weight: var(--fw-bold);
+ color: var(--color-brand-primary);
}
.home-ideas .ideas-lead {
- margin: 0;
- font-size: var(--fs-md);
- font-weight: var(--fw-regular);
- color: var(--color-neutral-60);
+ margin: 0;
+ font-size: var(--fs-md);
+ font-weight: var(--fw-regular);
+ color: var(--color-neutral-60);
}
/* Home Plays */
.home-plays {
- position: relative;
- padding: 5rem 0 6rem 0;
- background: rgba(var(--color-brand-primary-rgb), 0.1);
+ position: relative;
+ padding: 5rem 0 6rem 0;
+ background: rgba(var(--color-brand-primary-rgb), 0.1);
}
.home-plays:before {
- content: ' ';
- display: block;
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- opacity: 0.5;
- background-image: url("../../images/bg-spikes.webp");
- mix-blend-mode: overlay;
-
+ content: ' ';
+ display: block;
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0.5;
+ background-image: url('../../images/bg-spikes.webp');
+ mix-blend-mode: overlay;
}
.home-plays .plays-title-primary {
- position: relative;
- margin: 0 0 3rem 0;
- font-family: var(--ff-accent);
- font-size: var(--fs-xxl);
- text-align: center;
- color: var(--color-neutral-80);
+ position: relative;
+ margin: 0 0 3rem 0;
+ font-family: var(--ff-accent);
+ font-size: var(--fs-xxl);
+ text-align: center;
+ color: var(--color-neutral-80);
}
.home-plays .plays-title-primary strong {
- font-family: var(--ff-accent);
- position: relative;
- color: var(--color-neutral-90);
+ font-family: var(--ff-accent);
+ position: relative;
+ color: var(--color-neutral-90);
}
-
.home-plays .home-plays-footer {
- margin: 4rem 0 0 0;
- text-align: center;
+ margin: 4rem 0 0 0;
+ text-align: center;
}
-
/* Home Contributors */
.home-contributors {
- position: relative;
- padding: 5rem 0 6rem 0;
- background-color: var(--color-neutral-10);
+ position: relative;
+ padding: 5rem 0 6rem 0;
+ background-color: var(--color-neutral-10);
}
.home-contributors .title-primary {
- position: relative;
- margin: 0 0 3rem 0;
- font-family: var(--ff-accent);
- font-size: var(--fs-xxl);
- text-align: center;
- color: var(--color-neutral-80);
- line-height: 1.2;
+ position: relative;
+ margin: 0 0 3rem 0;
+ font-family: var(--ff-accent);
+ font-size: var(--fs-xxl);
+ text-align: center;
+ color: var(--color-neutral-80);
+ line-height: 1.2;
}
.home-contributors .title-primary strong {
- position: relative;
- font-family: var(--ff-accent);
- position: relative;
+ position: relative;
+ font-family: var(--ff-accent);
+ position: relative;
}
.home-contributors .title-primary strong span {
- position: relative;
- font-family: var(--ff-accent);
+ position: relative;
+ font-family: var(--ff-accent);
}
.home-contributors .title-primary strong:before {
- content:"";
- position: absolute;
- height: 4px;
- background-color: var(--color-brand-primary);
- left: 0;
- right: 0;
- bottom: .4rem;
- z-index: 0;
+ content: '';
+ position: absolute;
+ height: 4px;
+ background-color: var(--color-brand-primary);
+ left: 0;
+ right: 0;
+ bottom: 0.4rem;
+ z-index: 0;
}
.list-contributors {
- list-style: none;
+ list-style: none;
}
-
-
.list-contributors {
- position: relative;
- list-style: none;
- margin: 0 auto;
- padding: 0;
- width: 80%;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: center;
- grid-gap: 3rem;
- width: 80%;
- max-width: var(--screen-lg-max);
+ position: relative;
+ list-style: none;
+ margin: 0 auto;
+ padding: 0;
+ width: 80%;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ justify-content: center;
+ grid-gap: 3rem;
+ width: 80%;
+ max-width: var(--screen-lg-max);
}
-
.list-contributors .contributor-anchor {
- display: block;
- width: 160px;
- height: 160px;
- border-radius: 160px;
- overflow: hidden;
- transition: all 0.16s ease-in-out;
+ display: block;
+ width: 160px;
+ height: 160px;
+ border-radius: 160px;
+ overflow: hidden;
+ transition: all 0.16s ease-in-out;
}
.list-contributors .contributor-anchor:hover,
.list-contributors .contributor-anchor:focus {
- box-shadow: 0px -1px 26px 0px rgba(var(--color-brand-primary-rgb),0.59);
- -webkit-box-shadow: 0px -1px 26px 0px rgba(var(--color-brand-primary-rgb),0.59);
- -moz-box-shadow: 0px -1px 26px 0px rgba(var(--color-brand-primary-rgb),0.59);
- transform: scale(1.2);
+ box-shadow: 0px -1px 26px 0px rgba(var(--color-brand-primary-rgb), 0.59);
+ -webkit-box-shadow: 0px -1px 26px 0px rgba(var(--color-brand-primary-rgb), 0.59);
+ -moz-box-shadow: 0px -1px 26px 0px rgba(var(--color-brand-primary-rgb), 0.59);
+ transform: scale(1.2);
}
.list-contributors .contributor-anchor .contributor-thumb {
- width: 160px;
- height: auto;
- filter: grayscale(100%);
+ width: 160px;
+ height: auto;
+ filter: grayscale(100%);
}
.list-contributors .contributor-anchor:hover .contributor-thumb,
.list-contributors .contributor-anchor:focus .contributor-thumb {
- filter: grayscale(0%);
+ filter: grayscale(0%);
}
-@media screen and (max-width:1024px) {
- .list-contributors {
- grid-gap: 2rem;
- }
+@media screen and (max-width: 1024px) {
+ .list-contributors {
+ grid-gap: 2rem;
+ }
- .list-contributors .contributor-anchor {
- width: 120px;
- height: 120px;
- border-radius: 120px;
- }
+ .list-contributors .contributor-anchor {
+ width: 120px;
+ height: 120px;
+ border-radius: 120px;
+ }
- .list-contributors .contributor-anchor .contributor-thumb {
- width: 120px;
- }
+ .list-contributors .contributor-anchor .contributor-thumb {
+ width: 120px;
+ }
}
-@media screen and (max-width:568px) {
- .list-contributors {
- width: 100%;
- grid-gap: 1rem;
- }
+@media screen and (max-width: 568px) {
+ .list-contributors {
+ width: 100%;
+ grid-gap: 1rem;
+ }
- .list-contributors .contributor-anchor {
- width: 80px;
- height: 80px;
- border-radius: 80px;
- }
+ .list-contributors .contributor-anchor {
+ width: 80px;
+ height: 80px;
+ border-radius: 80px;
+ }
- .list-contributors .contributor-anchor .contributor-thumb {
- width: 80px;
- }
+ .list-contributors .contributor-anchor .contributor-thumb {
+ width: 80px;
+ }
}
/* Pills */
.pills-category {
- margin: 3rem 1rem;
- padding: 0;
- list-style: none;
- display: flex;
- flex-direction: row;
- grid-gap: 1rem;
- justify-content: center;
+ margin: 3rem 1rem;
+ padding: 0;
+ list-style: none;
+ display: flex;
+ flex-direction: row;
+ grid-gap: 1rem;
+ justify-content: center;
}
-@media screen and (max-width:1024px) {
- .pills-category {
- flex-wrap: wrap;
- }
+@media screen and (max-width: 1024px) {
+ .pills-category {
+ flex-wrap: wrap;
+ }
}
.pills-category a {
- display: inline-block;
- padding: 0.6rem 2.4rem;
- border-radius: 3px;
- font-weight: var(--fw-bold);
- text-decoration: none;
- color: rgba(var(--color-neutral-90-rgb), 0.6);
- transition: all 0.16s ease-in-out;
-}
-
-@media screen and (max-width:768px) {
- .pills-category {
- margin: 3rem 1rem 1rem 1rem;
- }
+ display: inline-block;
+ padding: 0.6rem 2.4rem;
+ border-radius: 3px;
+ font-weight: var(--fw-bold);
+ text-decoration: none;
+ color: rgba(var(--color-neutral-90-rgb), 0.6);
+ transition: all 0.16s ease-in-out;
+}
- .pills-category a {
- padding: 0.6rem 1.4rem;
- font-size: var(--fs-sm);
- }
+@media screen and (max-width: 768px) {
+ .pills-category {
+ margin: 3rem 1rem 1rem 1rem;
+ }
+
+ .pills-category a {
+ padding: 0.6rem 1.4rem;
+ font-size: var(--fs-sm);
+ }
}
.pills-category a:hover,
.pills-category a:focus {
- background: rgba(var(--color-brand-primary-rgb), 0.3);
- color: rgb(13,12,34);
+ background: rgba(var(--color-brand-primary-rgb), 0.3);
+ color: rgb(13, 12, 34);
}
.pills-category a.active {
- background: rgba(var(--color-neutral-90-rgb), 0.12);
- color: var(--color-neutral-90);
- font-weight: var(--fw-bold);
+ background: rgba(var(--color-neutral-90-rgb), 0.12);
+ color: var(--color-neutral-90);
+ font-weight: var(--fw-bold);
}
/* Plays List View */
.list-apps {
- display: grid;
- grid-template-columns: repeat(4, minmax(200px, 300px));
- margin: 1rem 3rem;
- padding: 0;
- grid-gap: 2rem;
- justify-content: center;
+ display: grid;
+ grid-template-columns: repeat(4, minmax(200px, 300px));
+ margin: 1rem 3rem;
+ padding: 0;
+ grid-gap: 2rem;
+ justify-content: center;
}
-@media screen and (max-width:1200px) {
- .list-apps {
- grid-template-columns: repeat(3, minmax(200px, 300px));
- }
+@media screen and (max-width: 1200px) {
+ .list-apps {
+ grid-template-columns: repeat(3, minmax(200px, 300px));
+ }
}
-@media screen and (max-width:1024px) {
- .list-apps {
- grid-template-columns: repeat(2, minmax(200px, 300px));
- }
+@media screen and (max-width: 1024px) {
+ .list-apps {
+ grid-template-columns: repeat(2, minmax(200px, 300px));
+ }
}
-@media screen and (max-width:568px) {
- .list-apps {
- margin: 1rem auto;
- grid-template-columns: repeat(1, minmax(240px, 300px));
- }
+@media screen and (max-width: 568px) {
+ .list-apps {
+ margin: 1rem auto;
+ grid-template-columns: repeat(1, minmax(240px, 300px));
+ }
}
.list-apps li {
- display: block;
+ display: block;
}
.list-apps a {
- position: relative;
- display: block;
- border-radius: 6px;
- overflow: hidden;
- background: var(--color-neutral-10);
- padding: 1.6rem;
- height: 220px;
- width: auto;
- box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.12);
- -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.12);
- -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.12);
- transition: all 0.16s ease-in-out;
+ position: relative;
+ display: block;
+ border-radius: 6px;
+ overflow: hidden;
+ background: var(--color-neutral-10);
+ padding: 1.6rem;
+ height: 220px;
+ width: auto;
+ box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.12);
+ -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.12);
+ -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.12);
+ transition: all 0.16s ease-in-out;
}
.list-apps a:hover {
- transform: scale(1.12);
-}
+ transform: scale(1.12);
+}
-@media screen and (max-width:568px) {
- .list-apps a:hover {
- transform: none;
- }
+@media screen and (max-width: 568px) {
+ .list-apps a:hover {
+ transform: none;
+ }
}
.list-apps a * {
- transition: all .16s ease-in-out;
+ transition: all 0.16s ease-in-out;
}
.list-apps a figure {
- margin: 0;
- overflow: hidden;
+ margin: 0;
+ overflow: hidden;
}
.list-apps a img {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
}
.list-apps a:after {
- content: "";
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- background: rgb(0,0,0);
- background: -moz-linear-gradient(180deg, rgba(var(--color-neutral-10-rgb),0.2) 0%, rgba(var(--color-neutral-10-rgb),1) 100%);
- background: -webkit-linear-gradient(180deg, rgba(var(--color-neutral-10-rgb),0.2) 0%, rgba(var(--color-neutral-10-rgb),1) 100%);
- background: linear-gradient(180deg, rgba(var(--color-neutral-10-rgb),0.2) 0%, rgba(var(--color-neutral-10-rgb),1) 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#000000",endColorstr="#000000",GradientType=1);
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ background: rgb(0, 0, 0);
+ background: -moz-linear-gradient(
+ 180deg,
+ rgba(var(--color-neutral-10-rgb), 0.2) 0%,
+ rgba(var(--color-neutral-10-rgb), 1) 100%
+ );
+ background: -webkit-linear-gradient(
+ 180deg,
+ rgba(var(--color-neutral-10-rgb), 0.2) 0%,
+ rgba(var(--color-neutral-10-rgb), 1) 100%
+ );
+ background: linear-gradient(
+ 180deg,
+ rgba(var(--color-neutral-10-rgb), 0.2) 0%,
+ rgba(var(--color-neutral-10-rgb), 1) 100%
+ );
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#000000",endColorstr="#000000",GradientType=1);
}
.list-apps a:hover:after {
- background: rgb(0,0,0);
- background: -moz-linear-gradient(180deg, rgba(var(--color-neutral-90-rgb),1) 0%, rgba(var(--color-neutral-90-rgb),1) 100%);
- background: -webkit-linear-gradient(180deg, rgba(var(--color-neutral-90-rgb),1) 0%, rgba(var(--color-neutral-90-rgb),1) 100%);
- background: linear-gradient(180deg, rgba(var(--color-neutral-90-rgb),1) 0%, rgba(var(--color-neutral-90-rgb),1) 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="var(--color-neutral-90)",endColorstr="var(--color-neutral-90)",GradientType=1);
+ background: rgb(0, 0, 0);
+ background: -moz-linear-gradient(
+ 180deg,
+ rgba(var(--color-neutral-90-rgb), 1) 0%,
+ rgba(var(--color-neutral-90-rgb), 1) 100%
+ );
+ background: -webkit-linear-gradient(
+ 180deg,
+ rgba(var(--color-neutral-90-rgb), 1) 0%,
+ rgba(var(--color-neutral-90-rgb), 1) 100%
+ );
+ background: linear-gradient(
+ 180deg,
+ rgba(var(--color-neutral-90-rgb), 1) 0%,
+ rgba(var(--color-neutral-90-rgb), 1) 100%
+ );
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="var(--color-neutral-90)",endColorstr="var(--color-neutral-90)",GradientType=1);
}
.list-apps a .list-app__title {
- position: absolute;
- top: 100%;
- transform: translateY(-100%);
- padding-bottom: 1.6rem;
- font-weight: var(--fw-bold);
- color: var(--color-neutral-90);
- z-index: 1;
+ position: absolute;
+ top: 100%;
+ transform: translateY(-100%);
+ padding-bottom: 1.6rem;
+ font-weight: var(--fw-bold);
+ color: var(--color-neutral-90);
+ z-index: 1;
}
-.list-apps a:hover .list-app__title {
- position: absolute;
- top: 3rem;
- padding-bottom: 0;
- color: white;
- z-index: 1;
+.list-apps a:hover .list-app__title {
+ position: absolute;
+ top: 3rem;
+ padding-bottom: 0;
+ color: white;
+ z-index: 1;
}
-
.list-apps a .list-app__play {
- position: absolute;
- opacity: 0;
- bottom: 50%;
- padding-left: 42px;
+ position: absolute;
+ opacity: 0;
+ bottom: 50%;
+ padding-left: 42px;
}
.list-apps a:hover .list-app__play {
- opacity: 1;
- bottom: 2rem;
- color: var(--color-brand-primary);
- z-index: 1;
+ opacity: 1;
+ bottom: 2rem;
+ color: var(--color-brand-primary);
+ z-index: 1;
}
.list-apps a .list-app__play:before {
- content: "";
- position: absolute;
- left: 0;
- top: -6px;
- width: 35px;
- height: 35px;
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='35.698' height='35.698' viewBox='0 0 35.698 35.698'%3E%3Cpath id='Icon_awesome-play-circle' data-name='Icon awesome-play-circle' d='M18.411.563A17.849 17.849 0 1 0 36.26 18.411 17.846 17.846 0 0 0 18.411.563Zm8.327 19.576L14.072 27.408A1.73 1.73 0 0 1 11.5 25.9V10.926a1.731 1.731 0 0 1 2.569-1.511l12.667 7.7A1.733 1.733 0 0 1 26.739 20.139Z' transform='translate(-0.563 -0.563)' fill='%2300f2fe'/%3E%3C/svg%3E");
+ content: '';
+ position: absolute;
+ left: 0;
+ top: -6px;
+ width: 35px;
+ height: 35px;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='35.698' height='35.698' viewBox='0 0 35.698 35.698'%3E%3Cpath id='Icon_awesome-play-circle' data-name='Icon awesome-play-circle' d='M18.411.563A17.849 17.849 0 1 0 36.26 18.411 17.846 17.846 0 0 0 18.411.563Zm8.327 19.576L14.072 27.408A1.73 1.73 0 0 1 11.5 25.9V10.926a1.731 1.731 0 0 1 2.569-1.511l12.667 7.7A1.733 1.733 0 0 1 26.739 20.139Z' transform='translate(-0.563 -0.563)' fill='%2300f2fe'/%3E%3C/svg%3E");
}
.home-anchor {
- position: relative;
- font-family: var(--ff-accent);
- font-size: var(--fs-md);
- color: var(--color-neutral-90);
- text-decoration: none;
- padding-right: 1.4rem;
- transition: all 0.12s ease-in-out;
+ position: relative;
+ font-family: var(--ff-accent);
+ font-size: var(--fs-md);
+ color: var(--color-neutral-90);
+ text-decoration: none;
+ padding-right: 1.4rem;
+ transition: all 0.12s ease-in-out;
}
.home-anchor .text {
- position: relative;
- z-index: 1;
- color: var(--color-neutral-80);
- font-family: var(--ff-accent);
+ position: relative;
+ z-index: 1;
+ color: var(--color-neutral-80);
+ font-family: var(--ff-accent);
}
.home-anchor:hover .text,
.home-anchor:focus .text {
- color: var(--color-neutral-90);
+ color: var(--color-neutral-90);
}
.home-anchor:before {
- content: "";
- position: absolute;
- bottom: 0;
- right: 1.6rem;
- left: 0;
- height: 2px;
- background-color: var(--color-brand-primary);
- transition: all 0.12s ease-in-out;
+ content: '';
+ position: absolute;
+ bottom: 0;
+ right: 1.6rem;
+ left: 0;
+ height: 2px;
+ background-color: var(--color-brand-primary);
+ transition: all 0.12s ease-in-out;
}
.home-anchor:hover:before,
.home-anchor:focus:before {
- background-color: var(--color-brand-primary);
- height: 4px;
- bottom: -2px;
+ background-color: var(--color-brand-primary);
+ height: 4px;
+ bottom: -2px;
}
-
-
-.home-anchor:after{
- content: "";
- position: absolute;
- top: 50%;
- right: 0;
- transform: translateY(-50%);
- width: 16px;
- height: 8px;
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16.187' height='7.957' viewBox='0 0 16.187 7.957'%3E%3Cpath id='Icon_awesome-long-arrow-alt-right' data-name='Icon awesome-long-arrow-alt-right' d='M11.343 12.791H.434A.434.434 0 0 0 0 13.225v2.023a.434.434 0 0 0 .434.434h10.91v1.664a.867.867 0 0 0 1.48.613l3.109-3.109a.867.867 0 0 0 0-1.226l-3.109-3.109a.867.867 0 0 0-1.48.613Z' transform='translate(0 -10.258)' fill='%2300f2fe'/%3E%3C/svg%3E");
- background-repeat: no-repeat;
- transition: all 0.12s ease-in-out;
+.home-anchor:after {
+ content: '';
+ position: absolute;
+ top: 50%;
+ right: 0;
+ transform: translateY(-50%);
+ width: 16px;
+ height: 8px;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16.187' height='7.957' viewBox='0 0 16.187 7.957'%3E%3Cpath id='Icon_awesome-long-arrow-alt-right' data-name='Icon awesome-long-arrow-alt-right' d='M11.343 12.791H.434A.434.434 0 0 0 0 13.225v2.023a.434.434 0 0 0 .434.434h10.91v1.664a.867.867 0 0 0 1.48.613l3.109-3.109a.867.867 0 0 0 0-1.226l-3.109-3.109a.867.867 0 0 0-1.48.613Z' transform='translate(0 -10.258)' fill='%2300f2fe'/%3E%3C/svg%3E");
+ background-repeat: no-repeat;
+ transition: all 0.12s ease-in-out;
}
.home-anchor:hover:after,
.home-anchor:focus:after {
- right: -0.4rem;
+ right: -0.4rem;
}
-
/* Home abstract graphics */
.home-bg-graphics {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- overflow: hidden;
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ overflow: hidden;
}
.home-bg-graphics-sm {
- position: absolute;
- top: 5%;
- right: 20%;
- opacity: 0.14;
- transform: rotate(30deg) scale(0.6);
- animation: flowerSpinSm 20s linear 0s infinite normal forwards ;
+ position: absolute;
+ top: 5%;
+ right: 20%;
+ opacity: 0.14;
+ transform: rotate(30deg) scale(0.6);
+ animation: flowerSpinSm 20s linear 0s infinite normal forwards;
}
-.home-bg-graphics-rg {
- position: absolute;
- opacity: 0.08;
- top: 35%;
- transform: rotate(10deg) scale(1.4) translateX(-25%);
- animation: flowerSpinRg 50s linear 0s infinite reverse forwards ;
+.home-bg-graphics-rg {
+ position: absolute;
+ opacity: 0.08;
+ top: 35%;
+ transform: rotate(10deg) scale(1.4) translateX(-25%);
+ animation: flowerSpinRg 50s linear 0s infinite reverse forwards;
}
.home-bg-graphics-lg {
- position: absolute;
- top: 35%;
- right: 0;
- opacity: 0.04;
- animation: flowerSpinLg 100s linear 0s infinite normal forwards ;
+ position: absolute;
+ top: 35%;
+ right: 0;
+ opacity: 0.04;
+ animation: flowerSpinLg 100s linear 0s infinite normal forwards;
}
-
@media screen and (max-width: 768px) {
- .home-bg-graphics-sm {
- top: 0%;
- }
+ .home-bg-graphics-sm {
+ top: 0%;
+ }
- .home-bg-graphics-rg {
- left: -15%;
- top: 35%;
- }
+ .home-bg-graphics-rg {
+ left: -15%;
+ top: 35%;
+ }
- .home-bg-graphics-lg {
- top: 20%;
- right: -15%;
- }
+ .home-bg-graphics-lg {
+ top: 20%;
+ right: -15%;
+ }
}
@keyframes flowerSpinSm {
+ from {
+ transform: rotate(360deg) scale(0.6);
+ }
+ to {
+ transform: rotate(0deg) scale(0.6);
+ }
+}
+
+@media screen and (max-width: 768px) {
+ @keyframes flowerSpinSm {
from {
- transform: rotate(360deg) scale(0.6);
+ transform: rotate(360deg) scale(0.3);
}
to {
- transform: rotate(0deg) scale(0.6);
+ transform: rotate(0deg) scale(0.3);
}
+ }
}
-@media screen and (max-width: 768px) {
- @keyframes flowerSpinSm {
- from {
- transform: rotate(360deg) scale(0.3);
- }
- to {
- transform: rotate(0deg) scale(0.3);
- }
- }
+@keyframes flowerSpinRg {
+ from {
+ transform: rotate(0deg) scale(1.4);
+ }
+ to {
+ transform: rotate(360deg) scale(1.4);
+ }
}
-@keyframes flowerSpinRg {
+@media screen and (max-width: 768px) {
+ @keyframes flowerSpinRg {
from {
- transform: rotate(0deg) scale(1.4);
+ transform: rotate(0deg) scale(1);
}
to {
- transform: rotate(360deg) scale(1.4);
+ transform: rotate(360deg) scale(1);
}
+ }
}
-@media screen and (max-width: 768px) {
- @keyframes flowerSpinRg {
- from {
- transform: rotate(0deg) scale(1);
- }
- to {
- transform: rotate(360deg) scale(1);
- }
- }
+@keyframes flowerSpinLg {
+ from {
+ transform: rotate(0deg) scale(5);
+ }
+ to {
+ transform: rotate(360deg) scale(5);
+ }
}
-@keyframes flowerSpinLg {
+@media screen and (max-width: 768px) {
+ @keyframes flowerSpinLg {
from {
- transform: rotate(0deg) scale(5);
+ transform: rotate(0deg) scale(3);
}
to {
- transform: rotate(360deg) scale(5);
+ transform: rotate(360deg) scale(3);
}
+ }
}
-
-@media screen and (max-width: 768px) {
- @keyframes flowerSpinLg {
- from {
- transform: rotate(0deg) scale(3);
- }
- to {
- transform: rotate(360deg) scale(3);
- }
- }
-}
\ No newline at end of file
diff --git a/src/common/home/index.js b/src/common/home/index.js
index c1d199614b..c2d92a5746 100644
--- a/src/common/home/index.js
+++ b/src/common/home/index.js
@@ -1,2 +1 @@
export { default as Home } from './Home';
-
diff --git a/src/common/hooks/useContributors.js b/src/common/hooks/useContributors.js
index 0a4e4b25c2..9943099823 100644
--- a/src/common/hooks/useContributors.js
+++ b/src/common/hooks/useContributors.js
@@ -1,4 +1,4 @@
-import { useState, useEffect } from "react";
+import { useState, useEffect } from 'react';
const useContributors = (sorted) => {
const [data, setData] = useState();
@@ -15,13 +15,10 @@ const useContributors = (sorted) => {
const responseData = await response.json();
// Remove the bots
- const contributors = responseData.filter(
- (contributor) => contributor.type !== "Bot"
- );
+ const contributors = responseData.filter((contributor) => contributor.type !== 'Bot');
// Sort it by the contributions
- sorted &&
- contributors.sort((a, b) => b.contributions - a.contributions);
+ sorted && contributors.sort((a, b) => b.contributions - a.contributions);
setData(contributors);
setIsLoading(false);
diff --git a/src/common/hooks/useFetch.js b/src/common/hooks/useFetch.js
index 6bfcec3b0d..34b35c1c3b 100644
--- a/src/common/hooks/useFetch.js
+++ b/src/common/hooks/useFetch.js
@@ -1,4 +1,4 @@
-import { useEffect, useState } from "react";
+import { useEffect, useState } from 'react';
const useFetch = (url, options) => {
const [data, setData] = useState([]);
@@ -21,6 +21,6 @@ const useFetch = (url, options) => {
}, [url, options]);
return { data, loading, error };
-}
+};
-export default useFetch;
\ No newline at end of file
+export default useFetch;
diff --git a/src/common/hooks/useGitHub.js b/src/common/hooks/useGitHub.js
index e8aac37c57..b70d578e0a 100644
--- a/src/common/hooks/useGitHub.js
+++ b/src/common/hooks/useGitHub.js
@@ -1,12 +1,10 @@
-
-
import { useState, useEffect } from 'react';
const useGitHub = (github) => {
const [data, setData] = useState();
const [error, setError] = useState();
const [isLoading, setIsLoading] = useState(true);
-
+
useEffect(() => {
const fetchData = async () => {
setIsLoading(true);
@@ -26,4 +24,4 @@ const useGitHub = (github) => {
return { data, error, isLoading };
};
-export default useGitHub;
\ No newline at end of file
+export default useGitHub;
diff --git a/src/common/index.js b/src/common/index.js
index 9f927f1e48..abf878f844 100644
--- a/src/common/index.js
+++ b/src/common/index.js
@@ -1,10 +1,10 @@
-import PageNotFound from "./404/PageNotFound";
-import Footer from "./footer/Footer";
-import Header from "./header/Header";
-import Home from "./home/Home";
-import Modal from "./modal";
-import DefMeta from "meta/DefMeta";
-import PlayMeta from "./playlists/PlayMeta";
-import PlayIdeas from "./playideas/PlayIdeas";
+import DefMeta from 'meta/DefMeta';
+import PageNotFound from './404/PageNotFound';
+import Footer from './footer/Footer';
+import Header from './header/Header';
+import Home from './home/Home';
+import Modal from './modal';
+import PlayMeta from './playlists/PlayMeta';
+import PlayIdeas from './playideas/PlayIdeas';
export { Header, Footer, Home, PageNotFound, Modal, PlayMeta, DefMeta, PlayIdeas };
diff --git a/src/common/modal/index.jsx b/src/common/modal/index.jsx
index 2c654f2366..da1dbcde1a 100644
--- a/src/common/modal/index.jsx
+++ b/src/common/modal/index.jsx
@@ -1,39 +1,43 @@
-import { useEffect } from "react";
-import ReactDOM from "react-dom";
-import { GoCheck, GoX } from "react-icons/go";
+import { useEffect } from 'react';
+import ReactDOM from 'react-dom';
+import { GoCheck, GoX } from 'react-icons/go';
-const Modal =({ title, show, onClose, onSubmit, children, cname })=> {
+const Modal = ({ title, show, onClose, onSubmit, children, cname }) => {
useEffect(() => {
const close = (e) => {
- // e.keyCode is deprecated: developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode. So I've used e.key === 'Escape' instead, for better international keyboard support.
- if(e.key === 'Escape') {
+ // e.keyCode is deprecated: developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode. So I've used e.key === 'Escape' instead, for better international keyboard support.
+ if (e.key === 'Escape') {
onClose();
}
- }
- window.addEventListener('keydown', close)
- return () => window.removeEventListener('keydown', close)
-},[])
+ };
+ window.addEventListener('keydown', close);
+ return () => window.removeEventListener('keydown', close);
+ }, []);
if (!show) return null;
-
return ReactDOM.createPortal(
<>
-
+
-
{ title }
-
-
- { children }
+
{title}
+
{children}
- Cancel
- { onSubmit && Apply }
+
+ Cancel
+
+ {onSubmit && (
+
+ Apply
+
+ )}
-
- >
- ,document.body);
-}
+
+ >,
+ document.body
+ );
+};
-export default Modal;
\ No newline at end of file
+export default Modal;
diff --git a/src/common/playideas/PlayIdeas.jsx b/src/common/playideas/PlayIdeas.jsx
index 5ebdc83e68..d46cdc49d1 100644
--- a/src/common/playideas/PlayIdeas.jsx
+++ b/src/common/playideas/PlayIdeas.jsx
@@ -3,7 +3,7 @@ import data from './ideas.json';
import { IoAddSharp } from 'react-icons/io5';
import { RiChatNewLine } from 'react-icons/ri';
import LevelBadge from 'common/components/LevelBadge';
-import "./playIdeas.css";
+import './playIdeas.css';
const PlayIdeas = () => {
const [ideas, setIdeas] = useState([]);
@@ -35,7 +35,7 @@ const PlayIdeas = () => {
if (filteredLevel === '') {
setFilteredIdeas(data.ideas);
} else {
- const filteredIdeas = ideas.filter(idea => idea.level === filteredLevel);
+ const filteredIdeas = ideas.filter((idea) => idea.level === filteredLevel);
setFilteredIdeas(filteredIdeas);
}
}, [filteredLevel]);
@@ -50,52 +50,85 @@ const PlayIdeas = () => {
const onValueChange = (event) => {
setFilteredLevel(event.target.value);
- }
+ };
return (
-
+
-
- Play Ideas
- {filteredIdeas.length}
-
-
Looking for project ideas to practice React? Great, you
- have landed on the right place. Here are some ideas to get you started.
-
+
+ Play Ideas
+ {filteredIdeas.length}
+
+
+ Looking for project ideas to practice React? Great, you have landed on the right
+ place. Here are some ideas to get you started.
+
-
-
+
{filteredIdeas.map((idea) => (
-
- {idea.title}
- {idea.description}
-
+
+ {idea.title}
+ {idea.description}
+
@@ -127,4 +160,4 @@ const PlayIdeas = () => {
);
};
-export default PlayIdeas;
\ No newline at end of file
+export default PlayIdeas;
diff --git a/src/common/playideas/ideas.json b/src/common/playideas/ideas.json
index 649652cf6f..16506b7d40 100644
--- a/src/common/playideas/ideas.json
+++ b/src/common/playideas/ideas.json
@@ -1,4 +1,4 @@
-{
+{
"ideas": [
{
"id": "idea-01",
@@ -127,4 +127,4 @@
"level": "Advanced"
}
]
-}
\ No newline at end of file
+}
diff --git a/src/common/playideas/playIdeas.css b/src/common/playideas/playIdeas.css
index ae1080250f..cff64c3260 100644
--- a/src/common/playideas/playIdeas.css
+++ b/src/common/playideas/playIdeas.css
@@ -1,309 +1,309 @@
.playideas-container {
- display: flex;
- flex-direction: column;
- height: 100%;
+ display: flex;
+ flex-direction: column;
+ height: 100%;
}
.playideas-header {
- padding: .6rem 1rem;
- border-bottom: solid 1px var(--color-neutral-30);
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- flex-wrap: wrap;
- background-color: var(--color-neutral-10);
+ padding: 0.6rem 1rem;
+ border-bottom: solid 1px var(--color-neutral-30);
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ background-color: var(--color-neutral-10);
}
.playideas-header .header-title {
- margin: 0;
- display: flex;
- flex-direction: row;
- align-items: center;
- grid-gap: 0.4rem;
+ margin: 0;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ grid-gap: 0.4rem;
}
.playideas-header .header-title .header-title-badge {
- background: var(--color-brand-primary);
- font-size: var(--fs-sm);
- font-weight: var(--fw-bold);
- line-height: 1;
- padding: .32rem .4rem;
- border-radius: 1rem;
+ background: var(--color-brand-primary);
+ font-size: var(--fs-sm);
+ font-weight: var(--fw-bold);
+ line-height: 1;
+ padding: 0.32rem 0.4rem;
+ border-radius: 1rem;
}
.playideas-header .header-desc {
- margin: 0 0 .4rem 0;
- font-size: var(--fs-sm);
- color: var(--color-neutral-60);
+ margin: 0 0 0.4rem 0;
+ font-size: var(--fs-sm);
+ color: var(--color-neutral-60);
}
.playideas-header .playideas-levels-pills {
- margin: 0.4rem 0;
- display: flex;
- flex-direction: row;
- align-items: center;
- flex-wrap: wrap;
+ margin: 0.4rem 0;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ flex-wrap: wrap;
}
.playideas-header .playideas-levels-pills .levels-label {
- margin-right: 0.6rem;
- font-size: var(--fs-sm);
- color: var(--color-neutral-70);
+ margin-right: 0.6rem;
+ font-size: var(--fs-sm);
+ color: var(--color-neutral-70);
}
-@media screen and (max-width:768px) {
- .playideas-header .playideas-levels-pills .levels-label {
- display: none;
- }
+@media screen and (max-width: 768px) {
+ .playideas-header .playideas-levels-pills .levels-label {
+ display: none;
+ }
}
.playideas-header .playideas-levels-pills .level-pill .level-pill-label {
- display: block;
- padding: 0.4rem .8rem;
- font-size: var(--fs-sm);
- color: var(--color-neutral-70);
- cursor: pointer;
- background: transparent;
- border-radius: 1rem;
+ display: block;
+ padding: 0.4rem 0.8rem;
+ font-size: var(--fs-sm);
+ color: var(--color-neutral-70);
+ cursor: pointer;
+ background: transparent;
+ border-radius: 1rem;
}
.playideas-header .playideas-levels-pills .level-pill .level-pill-control {
- display: none;
+ display: none;
}
-.playideas-header .playideas-levels-pills .level-pill .level-pill-control:checked + .level-pill-label {
- font-weight: var(--fw-bold);
- color: var(--color-neutral-90);
- background: rgba(var(--color-neutral-90-rgb),0.08);
+.playideas-header
+ .playideas-levels-pills
+ .level-pill
+ .level-pill-control:checked
+ + .level-pill-label {
+ font-weight: var(--fw-bold);
+ color: var(--color-neutral-90);
+ background: rgba(var(--color-neutral-90-rgb), 0.08);
}
.playideas-body {
- flex-grow: 1;
- overflow-y: auto;
+ flex-grow: 1;
+ overflow-y: auto;
}
.list-playideas {
- margin: 1rem 1rem;
- padding: 0;
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- grid-gap: 1rem;
+ margin: 1rem 1rem;
+ padding: 0;
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ grid-gap: 1rem;
}
-@media screen and (max-width:1400px) {
- .list-playideas {
- margin: 1rem 2rem;
- grid-template-columns: repeat(3, 1fr);
- grid-gap: 1rem;
- }
+@media screen and (max-width: 1400px) {
+ .list-playideas {
+ margin: 1rem 2rem;
+ grid-template-columns: repeat(3, 1fr);
+ grid-gap: 1rem;
+ }
}
-@media screen and (max-width:768px) {
- .list-playideas {
- margin: 1rem 2rem;
- grid-template-columns: repeat(2, 1fr);
- grid-gap: 1rem;
- }
+@media screen and (max-width: 768px) {
+ .list-playideas {
+ margin: 1rem 2rem;
+ grid-template-columns: repeat(2, 1fr);
+ grid-gap: 1rem;
+ }
}
-@media screen and (max-width:560px) {
- .list-playideas {
- margin: 1rem 2rem;
- grid-template-columns: 1fr;
- grid-gap: 1rem;
- }
+@media screen and (max-width: 560px) {
+ .list-playideas {
+ margin: 1rem 2rem;
+ grid-template-columns: 1fr;
+ grid-gap: 1rem;
+ }
}
-
-
.list-playideas .list-playideas-item {
- position: relative;
- border-radius: 4px;
- padding: 1.6rem;
- background-color: var(--color-neutral-10);
- box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.03);
- -webkit-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.03);
- -moz-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.03);
- overflow: hidden;
- transition: all 0.16s ease-in-out;
+ position: relative;
+ border-radius: 4px;
+ padding: 1.6rem;
+ background-color: var(--color-neutral-10);
+ box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.03);
+ -webkit-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.03);
+ -moz-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.03);
+ overflow: hidden;
+ transition: all 0.16s ease-in-out;
}
.list-playideas .list-playideas-item:hover {
- box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.12);
- -webkit-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.12);
- -moz-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.12);
+ box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.12);
+ -webkit-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.12);
+ -moz-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.12);
}
.list-playideas .list-playideas-item .idea-title {
- margin: 0 0 0.2rem 0;
- position: relative;
- margin-bottom: 0.3rem;
- font-size: var(--fs-md);
- font-weight: var(--fw-bold);
- color: var(--color-neutral-90);
- z-index: 1;
- line-height: var(--lh-rg);
- transition: all 0.16s ease-in-out;
+ margin: 0 0 0.2rem 0;
+ position: relative;
+ margin-bottom: 0.3rem;
+ font-size: var(--fs-md);
+ font-weight: var(--fw-bold);
+ color: var(--color-neutral-90);
+ z-index: 1;
+ line-height: var(--lh-rg);
+ transition: all 0.16s ease-in-out;
}
.list-playideas .list-playideas-item .idea-desc {
- margin: 0.8rem 0;
- font-size: var(--fs-sm);
- font-weight: var(--fw-light);
- color: var(--color-neutral-50);
+ margin: 0.8rem 0;
+ font-size: var(--fs-sm);
+ font-weight: var(--fw-light);
+ color: var(--color-neutral-50);
}
.list-playideas .list-playideas-item .idea-level {
- margin: 1rem 0 0 0;
+ margin: 1rem 0 0 0;
}
.list-playideas .list-playideas-item:hover,
-.list-playideas .list-playideas-item:focus {
- transform: scale(1.03);
+.list-playideas .list-playideas-item:focus {
+ transform: scale(1.03);
}
.list-playideas .list-playideas-item:hover .idea-actions,
.list-playideas .list-playideas-item:focus .idea-actions {
- opacity: 1;
- align-items: center;
+ opacity: 1;
+ align-items: center;
}
.list-playideas .list-playideas-item .idea-actions {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- opacity: 0;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: flex-start;
- padding: 0 4rem;
- grid-gap: 0.4rem;
- background-color: rgba(var(--color-neutral-90-rgb),0.8);
- z-index: 1;
- transition: all 0.14s ease-in-out;
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ opacity: 0;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: flex-start;
+ padding: 0 4rem;
+ grid-gap: 0.4rem;
+ background-color: rgba(var(--color-neutral-90-rgb), 0.8);
+ z-index: 1;
+ transition: all 0.14s ease-in-out;
}
.list-playideas .list-playideas-item .idea-actions .action-btn {
- position: relative;
- transform: translateX(-100%);
- transition: all 0.1s ease-in-out;
+ position: relative;
+ transform: translateX(-100%);
+ transition: all 0.1s ease-in-out;
}
.list-playideas .list-playideas-item .idea-actions .action-btn:nth-child(2) {
- position: relative;
- transform: translateX(100%);
- transition: all 0.12s ease-in-out;
+ position: relative;
+ transform: translateX(100%);
+ transition: all 0.12s ease-in-out;
}
.list-playideas .list-playideas-item:hover .idea-actions .action-btn:nth-child(2),
.list-playideas .list-playideas-item:focus .idea-actions .action-btn:nth-child(2) {
- transform: translateX(0);
+ transform: translateX(0);
}
.list-playideas .list-playideas-item:hover .idea-actions .action-btn,
.list-playideas .list-playideas-item:focus .idea-actions .action-btn {
- transform: translateX(0);
+ transform: translateX(0);
}
-@media screen and (max-width:1200px) {
- .list-playideas .list-playideas-item .idea-actions {
- padding: 0 2rem;
- }
+@media screen and (max-width: 1200px) {
+ .list-playideas .list-playideas-item .idea-actions {
+ padding: 0 2rem;
+ }
}
-
/* Buttons */
.btn-default {
- border: solid 1px var(--color-neutral-60);
- border-radius: 2rem;
- display: inline-flex;
- flex-direction: row;
- align-items: center;
- grid-gap: 0.4rem;
- padding: .8rem 1.4rem;
- font-size: var(--fs-rg);
- font-weight: var(--fw-bold);
- text-decoration: none;
- width: unset;
- height: unset;
- background: transparent;
- transition: all 0.12s ease-in-out;
- color: var(--color-neutral-10);
- cursor: pointer;
+ border: solid 1px var(--color-neutral-60);
+ border-radius: 2rem;
+ display: inline-flex;
+ flex-direction: row;
+ align-items: center;
+ grid-gap: 0.4rem;
+ padding: 0.8rem 1.4rem;
+ font-size: var(--fs-rg);
+ font-weight: var(--fw-bold);
+ text-decoration: none;
+ width: unset;
+ height: unset;
+ background: transparent;
+ transition: all 0.12s ease-in-out;
+ color: var(--color-neutral-10);
+ cursor: pointer;
}
.btn-default .icon {
- width: var(--navbar-icon-size-rg);
- height: var(--navbar-icon-size-rg);
- fill: var(--color-brand-primary-dark);
- color: var(--color-brand-primary-dark);
+ width: var(--navbar-icon-size-rg);
+ height: var(--navbar-icon-size-rg);
+ fill: var(--color-brand-primary-dark);
+ color: var(--color-brand-primary-dark);
}
.btn-default:hover,
.btn-default:focus {
- border-color: var(--color-neutral-20);
- background-color: var(--color-neutral-20);
- color: var(--color-neutral-90);
+ border-color: var(--color-neutral-20);
+ background-color: var(--color-neutral-20);
+ color: var(--color-neutral-90);
}
.btn-default:hover .icon,
.btn-default:focus .icon {
- fill: var(--color-brand-primary-dark);
- color: var(--color-brand-primary-dark);
+ fill: var(--color-brand-primary-dark);
+ color: var(--color-brand-primary-dark);
}
.btn-default .btn-label {
- display: flex;
- align-items: center;
- grid-gap: 1.2rem;
+ display: flex;
+ align-items: center;
+ grid-gap: 1.2rem;
}
-
.btn-primary {
- border: solid 2px var(--color-brand-primary);
- background-color: var(--color-brand-primary);
- color: var(--color-neutral-80);
-
- border-radius: 2rem;
- display: inline-flex;
- flex-direction: row;
- align-items: center;
- grid-gap: 0.4rem;
- padding: .8rem 1.4rem;
- font-size: var(--fs-rg);
- font-weight: var(--fw-bold);
- text-decoration: none;
- width: unset;
- height: unset;
- transition: all 0.12s ease-in-out;
- cursor: pointer;
-}
-
-.btn-primary .icon {
- width: var(--navbar-icon-size-rg);
- height: var(--navbar-icon-size-rg);
- fill: var(--color-neutral-90);
- color: var(--color-neutral-90);
+ border: solid 2px var(--color-brand-primary);
+ background-color: var(--color-brand-primary);
+ color: var(--color-neutral-80);
+
+ border-radius: 2rem;
+ display: inline-flex;
+ flex-direction: row;
+ align-items: center;
+ grid-gap: 0.4rem;
+ padding: 0.8rem 1.4rem;
+ font-size: var(--fs-rg);
+ font-weight: var(--fw-bold);
+ text-decoration: none;
+ width: unset;
+ height: unset;
+ transition: all 0.12s ease-in-out;
+ cursor: pointer;
+}
+
+.btn-primary .icon {
+ width: var(--navbar-icon-size-rg);
+ height: var(--navbar-icon-size-rg);
+ fill: var(--color-neutral-90);
+ color: var(--color-neutral-90);
}
.btn-primary:hover,
.btn-primary:focus {
- border-color: var(--color-neutral-20);
- background-color: var(--color-neutral-20);
- color: var(--color-neutral-90);
+ border-color: var(--color-neutral-20);
+ background-color: var(--color-neutral-20);
+ color: var(--color-neutral-90);
}
.btn-primary:hover .icon,
.btn-primary:focus .icon {
- fill: var(--color-brand-primary-dark);
- color: var(--color-brand-primary-dark);
+ fill: var(--color-brand-primary-dark);
+ color: var(--color-brand-primary-dark);
}
.btn-primary .btn-label {
- display: flex;
- align-items: center;
- grid-gap: 1.2rem;
-}
\ No newline at end of file
+ display: flex;
+ align-items: center;
+ grid-gap: 1.2rem;
+}
diff --git a/src/common/playlists/FeaturedPlays.jsx b/src/common/playlists/FeaturedPlays.jsx
index 59da898ec5..ce8ca4307d 100644
--- a/src/common/playlists/FeaturedPlays.jsx
+++ b/src/common/playlists/FeaturedPlays.jsx
@@ -1,6 +1,6 @@
-import PlayThumbnail from "./PlayThumbnail";
+import PlayThumbnail from './PlayThumbnail';
-import { getFeaturedPlays } from "meta/play-meta-util";
+import { getFeaturedPlays } from 'meta/play-meta-util';
const FeaturedPlays = () => {
const plays = getFeaturedPlays();
@@ -9,7 +9,7 @@ const FeaturedPlays = () => {
return (
<>
- Trending Plays
+ Trending Plays
{plays.map((play, index) => (
@@ -17,6 +17,7 @@ const FeaturedPlays = () => {
))}
>
- )};
+ );
+};
export default FeaturedPlays;
diff --git a/src/common/playlists/PlayHeader.jsx b/src/common/playlists/PlayHeader.jsx
index 8190868068..3285cc64c6 100644
--- a/src/common/playlists/PlayHeader.jsx
+++ b/src/common/playlists/PlayHeader.jsx
@@ -1,6 +1,6 @@
-import React from "react";
-import PlayHeaderInfo from "./PlayHeaderInfo";
-import PlayHeaderActions from "./PlayHeaderActions";
+import React from 'react';
+import PlayHeaderInfo from './PlayHeaderInfo';
+import PlayHeaderActions from './PlayHeaderActions';
const PlayHeader = ({ play }) => {
return (
diff --git a/src/common/playlists/PlayHeaderActions.jsx b/src/common/playlists/PlayHeaderActions.jsx
index 27bc8b203e..ac6e78a1c3 100644
--- a/src/common/playlists/PlayHeaderActions.jsx
+++ b/src/common/playlists/PlayHeaderActions.jsx
@@ -1,11 +1,11 @@
-import React, { useState } from "react";
-import { BsGithub } from "react-icons/bs";
-import { IoLogoYoutube } from "react-icons/io";
-import { AiOutlineRead } from "react-icons/ai";
-import { BiComment } from "react-icons/bi";
-import { MdClose } from "react-icons/md";
+import React, { useState } from 'react';
+import { BsGithub } from 'react-icons/bs';
+import { IoLogoYoutube } from 'react-icons/io';
+import { AiOutlineRead } from 'react-icons/ai';
+import { BiComment } from 'react-icons/bi';
+import { MdClose } from 'react-icons/md';
-import Comment from "common/components/Comment";
+import Comment from 'common/components/Comment';
const PlayHeaderActions = ({ play }) => {
console.log(play);
@@ -32,23 +32,13 @@ const PlayHeaderActions = ({ play }) => {
)}
{play.blog && (
-
+
Blog
)}
{play.video && (
-
+
Video
@@ -57,10 +47,7 @@ const PlayHeaderActions = ({ play }) => {
Comments
- setShowComment(false)}
- >
+ setShowComment(false)}>
diff --git a/src/common/playlists/PlayHeaderInfo.jsx b/src/common/playlists/PlayHeaderInfo.jsx
index f2dae3eb5b..53d47a2553 100644
--- a/src/common/playlists/PlayHeaderInfo.jsx
+++ b/src/common/playlists/PlayHeaderInfo.jsx
@@ -1,10 +1,10 @@
-import { IoMdArrowBack } from "react-icons/io";
+import { IoMdArrowBack } from 'react-icons/io';
import { Link } from 'react-router-dom';
import useGitHub from 'common/hooks/useGitHub';
import LevelBadge from 'common/components/LevelBadge';
-const Author = ({github}) => {
+const Author = ({ github }) => {
const { data, error, isLoading } = useGitHub(github);
return (
<>
@@ -12,27 +12,27 @@ const Author = ({github}) => {
{error &&
Error: {error.message} }
{data && (
)}
- >
+ >
);
};
-const Tags = ({tags}) => {
+const Tags = ({ tags }) => {
return (
{tags.map((tag, index) => (
-
- {tag}
-
+ {tag}
))}
@@ -40,7 +40,6 @@ const Tags = ({tags}) => {
};
const PlayHeaderInfo = ({ play }) => {
-
return (
@@ -53,12 +52,10 @@ const PlayHeaderInfo = ({ play }) => {
{play.name}
- { play.tags && }
+ {play.tags && }
-
+
);
diff --git a/src/common/playlists/PlayList.jsx b/src/common/playlists/PlayList.jsx
index d77bea17c8..2ab8653d28 100644
--- a/src/common/playlists/PlayList.jsx
+++ b/src/common/playlists/PlayList.jsx
@@ -1,21 +1,19 @@
-import { useSearchFilter } from "common/search/hooks/useSearchFilter";
-import PlayThumbnail from "./PlayThumbnail";
-import { ReactComponent as ImageOops } from "images/img-oops.svg";
+import { useSearchFilter } from 'common/search/hooks/useSearchFilter';
+import PlayThumbnail from './PlayThumbnail';
+import { ReactComponent as ImageOops } from 'images/img-oops.svg';
import { Link } from 'react-router-dom';
-import "./playlist.css";
+import './playlist.css';
const PlayList = () => {
const plays = useSearchFilter();
if (plays.length === 0) {
return (
-
-
-
Play not found
-
- Please change your search or adjust filters to find plays.
-
-
+
+
+
Play not found
+
Please change your search or adjust filters to find plays.
+
);
}
return (
diff --git a/src/common/playlists/PlayMeta.jsx b/src/common/playlists/PlayMeta.jsx
index 72c96e880c..a15764d75a 100644
--- a/src/common/playlists/PlayMeta.jsx
+++ b/src/common/playlists/PlayMeta.jsx
@@ -1,8 +1,8 @@
-import { cloneElement } from "react";
-import { Helmet } from "react-helmet";
+import { cloneElement } from 'react';
+import { Helmet } from 'react-helmet';
function PlayMeta({ id, name, description, path, cover, component }) {
- const playFolder = path.split("/")[2];
+ const playFolder = path.split('/')[2];
let metaImage; // Initialize metaImage variable
if (cover) {
@@ -14,7 +14,7 @@ function PlayMeta({ id, name, description, path, cover, component }) {
// some platforms such as Twitter need full, explicit URL's to display images correctly
} catch {
// If no image is available, cover stays as undefined
- console.log("No cover available.");
+ console.log('No cover available.');
}
}
@@ -24,31 +24,11 @@ function PlayMeta({ id, name, description, path, cover, component }) {
- {metaImage && (
-
- )}
-
+ {metaImage &&
}
+
-
- {metaImage && (
-
- )}
+
+ {metaImage &&
}
{cloneElement(component(), { id })}
>
diff --git a/src/common/playlists/PlayThumbnail.jsx b/src/common/playlists/PlayThumbnail.jsx
index 948ad7b42e..0dd1a148b8 100644
--- a/src/common/playlists/PlayThumbnail.jsx
+++ b/src/common/playlists/PlayThumbnail.jsx
@@ -1,11 +1,11 @@
import { useState, useEffect } from 'react';
-import { Link } from "react-router-dom";
-import { BsPlayCircleFill } from "react-icons/bs";
+import { Link } from 'react-router-dom';
+import { BsPlayCircleFill } from 'react-icons/bs';
import useGitHub from 'common/hooks/useGitHub';
import thumbPlay from 'images/thumb-play.png';
-import Shimmer from "react-shimmer-effect";
+import Shimmer from 'react-shimmer-effect';
-const Author = ({github}) => {
+const Author = ({ github }) => {
const { data, error, isLoading } = useGitHub(github);
const [name, setName] = useState('');
@@ -21,18 +21,19 @@ const Author = ({github}) => {
<>
{isLoading &&
Loading... }
{
-
by
-
{ name }
+
}
- >
+ >
);
};
const PlayThumbnail = ({ play }) => {
const [cover, setCover] = useState(null);
- useEffect(() => {
+ useEffect(() => {
// Set the cover image
// if it is passed as a meta data
if (play.cover) {
@@ -42,30 +43,31 @@ const PlayThumbnail = ({ play }) => {
// check in the play folder for a cover image
// with the name cover.png
const playFolder = play.path.split('/')[2];
- import(`plays/${playFolder}/cover.png`).then(Cover => {
- setCover(Cover.default);
- }).catch(err => {
- // if there is no cover image, set a default image
- console.warn(`Cover image not found for the play ${play.name}`);
- console.info('Setting the default cover image...');
-
- setCover(thumbPlay);
- });
+ import(`plays/${playFolder}/cover.png`)
+ .then((Cover) => {
+ setCover(Cover.default);
+ })
+ .catch((err) => {
+ // if there is no cover image, set a default image
+ console.warn(`Cover image not found for the play ${play.name}`);
+ console.info('Setting the default cover image...');
+
+ setCover(thumbPlay);
+ });
}
-
}, [play]);
return (
-
+
{play.name}
- { play.github &&
}
+ {play.github &&
}
diff --git a/src/common/playlists/playlist.css b/src/common/playlists/playlist.css
index ede8d61687..a8e2032e0e 100644
--- a/src/common/playlists/playlist.css
+++ b/src/common/playlists/playlist.css
@@ -1,141 +1,141 @@
/* List of Plays Available */
.list-plays {
- margin: 0 auto;
- padding: 1.6rem 2rem;
- list-style: none;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- /* display: grid; */
- /* grid-template-columns: repeat(auto-fill, minmax(var(--play-thumb-size-w), var(--play-thumb-size))); */
- /* grid-template-columns: repeat(auto-fill, var(--play-thumb-size-w));
+ margin: 0 auto;
+ padding: 1.6rem 2rem;
+ list-style: none;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ /* display: grid; */
+ /* grid-template-columns: repeat(auto-fill, minmax(var(--play-thumb-size-w), var(--play-thumb-size))); */
+ /* grid-template-columns: repeat(auto-fill, var(--play-thumb-size-w));
grid-auto-rows: var(--play-thumb-size-h)*2; */
- grid-gap: 2rem;
- justify-content: center;
+ grid-gap: 2rem;
+ justify-content: center;
}
.list-plays li a {
- display: block;
- position: relative;
- border-radius: 0.6rem;
- transition: all 0.16s ease-in-out;
- overflow: hidden;
- text-decoration: none;
- box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.03);
- -webkit-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.03);
- -moz-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb),0.03);
+ display: block;
+ position: relative;
+ border-radius: 0.6rem;
+ transition: all 0.16s ease-in-out;
+ overflow: hidden;
+ text-decoration: none;
+ box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.03);
+ -webkit-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.03);
+ -moz-box-shadow: 0px 0 12px 0px rgba(var(--color-neutral-90-rgb), 0.03);
}
.list-plays li a:hover,
.list-plays li a:focus {
- border-radius: 0.6rem;
- transform: scale(1.16);
- box-shadow: 0px 6px 12px 0px rgba(var(--color-neutral-90-rgb),0.20);
- -webkit-box-shadow: 0px 6px 12px 0px rgba(var(--color-neutral-90-rgb),0.20);
- -moz-box-shadow: 0px 6px 12px 0px rgba(var(--color-neutral-90-rgb),0.20);
+ border-radius: 0.6rem;
+ transform: scale(1.16);
+ box-shadow: 0px 6px 12px 0px rgba(var(--color-neutral-90-rgb), 0.2);
+ -webkit-box-shadow: 0px 6px 12px 0px rgba(var(--color-neutral-90-rgb), 0.2);
+ -moz-box-shadow: 0px 6px 12px 0px rgba(var(--color-neutral-90-rgb), 0.2);
}
.list-plays a .play-header {
- padding: 1rem 1.4rem;
- background-color: var(--color-neutral-10);
+ padding: 1rem 1.4rem;
+ background-color: var(--color-neutral-10);
}
.list-plays a .play-header .play-author {
- display: flex;
- flex-direction: row;
- align-items: center;
- grid-gap: 0.2rem;
- font-size: var(--fs-sm);
- font-weight: var(--fw-light);
- color: var(--color-neutral-50);
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ grid-gap: 0.2rem;
+ font-size: var(--fs-sm);
+ font-weight: var(--fw-light);
+ color: var(--color-neutral-50);
}
.list-plays a .play-header .play-author .author-anchor {
- font-weight: var(--fw-regular);
- color: var(--color-neutral-80);
+ font-weight: var(--fw-regular);
+ color: var(--color-neutral-80);
}
.list-plays a .play-header .language {
- position: absolute;
- height: 1rem;
- width: 1rem;
- bottom: 0;
- right:0;
- padding: .8rem;
- background-repeat: no-repeat;
- opacity: 0.2;
+ position: absolute;
+ height: 1rem;
+ width: 1rem;
+ bottom: 0;
+ right: 0;
+ padding: 0.8rem;
+ background-repeat: no-repeat;
+ opacity: 0.2;
}
.list-plays a .play-header .language-ts {
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' data-name='Layer 1' viewBox='6 6 36 36'%3E%3Cpath d='M6,6V42H42V6ZM26.9,25H22.21V38.76h-3V25H14.57V22.46H26.9ZM32.29,39a9.42,9.42,0,0,1-4.41-1l.66-2.46a8.29,8.29,0,0,0,3.94,1c1.9,0,3-.89,3-2.22s-.82-2-2.89-2.71c-2.69-.95-4.41-2.39-4.41-4.73,0-2.67,2.23-4.68,5.77-4.68a8.66,8.66,0,0,1,3.91.81l-.71,2.4a7,7,0,0,0-3.26-.78c-1.89,0-2.69,1-2.69,2,0,1.25.94,1.84,3.11,2.67,2.84,1.08,4.2,2.5,4.2,4.84C38.47,36.74,36.49,39,32.29,39Z'/%3E%3C/svg%3E");
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' data-name='Layer 1' viewBox='6 6 36 36'%3E%3Cpath d='M6,6V42H42V6ZM26.9,25H22.21V38.76h-3V25H14.57V22.46H26.9ZM32.29,39a9.42,9.42,0,0,1-4.41-1l.66-2.46a8.29,8.29,0,0,0,3.94,1c1.9,0,3-.89,3-2.22s-.82-2-2.89-2.71c-2.69-.95-4.41-2.39-4.41-4.73,0-2.67,2.23-4.68,5.77-4.68a8.66,8.66,0,0,1,3.91.81l-.71,2.4a7,7,0,0,0-3.26-.78c-1.89,0-2.69,1-2.69,2,0,1.25.94,1.84,3.11,2.67,2.84,1.08,4.2,2.5,4.2,4.84C38.47,36.74,36.49,39,32.29,39Z'/%3E%3C/svg%3E");
}
.list-plays a .play-header .language-js {
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M379.328 7337.432c-1.745 0-2.873-.832-3.423-1.92l1.53-.886c.403.658.926 1.141 1.853 1.141.778 0 1.275-.389 1.275-.926 0-.808-1.078-1.124-1.839-1.45-1.356-.577-2.256-1.302-2.256-2.833 0-1.409 1.074-2.483 2.753-2.483 1.194 0 2.054.416 2.671 1.503l-1.463.94c-.322-.577-.671-.805-1.208-.805-.551 0-.9.349-.9.805 0 .564.349.792 1.155 1.141 1.689.724 2.967 1.293 2.967 3.155 0 1.692-1.329 2.618-3.115 2.618zm-4.328-2.833c0 1.947-1.199 2.976-2.864 2.976-1.504 0-2.405-.575-2.848-1.575h-.026l1.529-1.069c.295.523.561.894 1.205.894.618 0 1.004-.313 1.004-1.252V7328h2v6.599zM364 7339h20v-20h-20v20z' transform='translate(-364 -7319)'/%3E%3C/svg%3E");
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M379.328 7337.432c-1.745 0-2.873-.832-3.423-1.92l1.53-.886c.403.658.926 1.141 1.853 1.141.778 0 1.275-.389 1.275-.926 0-.808-1.078-1.124-1.839-1.45-1.356-.577-2.256-1.302-2.256-2.833 0-1.409 1.074-2.483 2.753-2.483 1.194 0 2.054.416 2.671 1.503l-1.463.94c-.322-.577-.671-.805-1.208-.805-.551 0-.9.349-.9.805 0 .564.349.792 1.155 1.141 1.689.724 2.967 1.293 2.967 3.155 0 1.692-1.329 2.618-3.115 2.618zm-4.328-2.833c0 1.947-1.199 2.976-2.864 2.976-1.504 0-2.405-.575-2.848-1.575h-.026l1.529-1.069c.295.523.561.894 1.205.894.618 0 1.004-.313 1.004-1.252V7328h2v6.599zM364 7339h20v-20h-20v20z' transform='translate(-364 -7319)'/%3E%3C/svg%3E");
}
.list-plays a .play-title {
- position: relative;
- margin-bottom: 0.3rem;
- font-size: var(--fs-rg);
- font-weight: var(--fw-bold);
- color: var(--color-neutral-90);
- z-index: 1;
- line-height: var(--lh-rg);
- transition: all 0.16s ease-in-out;
+ position: relative;
+ margin-bottom: 0.3rem;
+ font-size: var(--fs-rg);
+ font-weight: var(--fw-bold);
+ color: var(--color-neutral-90);
+ z-index: 1;
+ line-height: var(--lh-rg);
+ transition: all 0.16s ease-in-out;
}
.list-plays a .play-thumb {
- position: relative;
- width: var(--play-thumb-size-w);
- height: var(--play-thumb-size-h);
- border-radius: 0.6rem;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- overflow: hidden;
-}
-.list-plays a .play-thumb-img {
- position: relative;
- width: var(--play-thumb-size-w);
- height: var(--play-thumb-size-h);
- border-radius: 0.6rem;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- background-color: var(--color-neutral-10);
+ position: relative;
+ width: var(--play-thumb-size-w);
+ height: var(--play-thumb-size-h);
+ border-radius: 0.6rem;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ overflow: hidden;
+}
+.list-plays a .play-thumb-img {
+ position: relative;
+ width: var(--play-thumb-size-w);
+ height: var(--play-thumb-size-h);
+ border-radius: 0.6rem;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ background-color: var(--color-neutral-10);
}
.list-plays a .play-thumb:after {
- content: "";
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- background: rgba(0,0,0,0);
- transition: all 0.16s ease-in-out;
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0);
+ transition: all 0.16s ease-in-out;
}
.list-plays a:hover .play-thumb:after {
- background: rgba(var(--color-neutral-90-rgb),0.9);
+ background: rgba(var(--color-neutral-90-rgb), 0.9);
}
.list-plays a .play-status {
- position: absolute;
- display: flex;
- flex-direction: column;
- align-items: center;
- opacity: 0;
- top: 2rem;
- left: 0%;
- transform: translateX(-50%);
- color: var(--color-brand-primary);
- transition: all 0.16s ease-in-out;
- z-index: 1;
- grid-gap: 0.4rem;
+ position: absolute;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ opacity: 0;
+ top: 2rem;
+ left: 0%;
+ transform: translateX(-50%);
+ color: var(--color-brand-primary);
+ transition: all 0.16s ease-in-out;
+ z-index: 1;
+ grid-gap: 0.4rem;
}
.list-plays a:hover .play-status {
- opacity: 1;
- left: 50%;
- transform: translateX(-50%);
+ opacity: 1;
+ left: 50%;
+ transform: translateX(-50%);
}
/*
@@ -185,155 +185,151 @@
}
*/
.list-plays a .play-status .current {
- display: none;
+ display: none;
}
.list-plays .active a .play-status .current {
- display: block;
- font-size: var(--fs-sm);
+ display: block;
+ font-size: var(--fs-sm);
}
/* Play Details */
.play-details {
- display: flex;
- flex-direction: column;
- flex-grow: 1;
- overflow-y: auto;
- border-top: solid 1px var(--color-neutral-30);
+ display: flex;
+ flex-direction: column;
+ flex-grow: 1;
+ overflow-y: auto;
+ border-top: solid 1px var(--color-neutral-30);
}
.play-details .play-details-header {
- position: relative;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: flex-start;
- background-color: var(--color-neutral-10);
- padding: 0.6rem 1.2rem 0.6rem .8rem;
- box-shadow: 0px 4px 10px 0px rgba(var(--color-neutral-90-rgb),0.12);
- -webkit-box-shadow: 0px 4px 10px 0px rgba(var(--color-neutral-90-rgb),0.12);
- -moz-box-shadow: 0px 4px 10px 0px rgba(var(--color-neutral-90-rgb),0.12);
+ position: relative;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: flex-start;
+ background-color: var(--color-neutral-10);
+ padding: 0.6rem 1.2rem 0.6rem 0.8rem;
+ box-shadow: 0px 4px 10px 0px rgba(var(--color-neutral-90-rgb), 0.12);
+ -webkit-box-shadow: 0px 4px 10px 0px rgba(var(--color-neutral-90-rgb), 0.12);
+ -moz-box-shadow: 0px 4px 10px 0px rgba(var(--color-neutral-90-rgb), 0.12);
}
@media screen and (max-width: 480px) {
- .play-details .play-details-header {
- flex-direction: column;
- }
+ .play-details .play-details-header {
+ flex-direction: column;
+ }
}
.play-details .play-details-header .header-leftcol {
- display: flex;
- flex-direction: row;
+ display: flex;
+ flex-direction: row;
}
.play-details .play-details-header .header-leftcol-action {
- padding-top: .3rem;
- padding-right: .3rem;
+ padding-top: 0.3rem;
+ padding-right: 0.3rem;
}
.play-details .play-details-header .header-leftcol-action .action {
- display: block;
+ display: block;
}
.play-details .play-details-header .header-leftcol-action .action .icon {
- fill: rgba(var(--color-neutral-90-rgb), 0.4);
+ fill: rgba(var(--color-neutral-90-rgb), 0.4);
}
.play-details .play-details-header .header-leftcol-action .action:hover .icon,
.play-details .play-details-header .header-leftcol-action .action:focus .icon {
- fill: rgba(var(--color-neutral-90-rgb), 0.8);
+ fill: rgba(var(--color-neutral-90-rgb), 0.8);
}
-.play-details .play-details-header .list-tags{
- flex-wrap: wrap;
+.play-details .play-details-header .list-tags {
+ flex-wrap: wrap;
}
@media screen and (max-width: 1172px) {
- .play-details .play-details-header .header-leftcol-action {
- padding-top: .16rem;
- }
+ .play-details .play-details-header .header-leftcol-action {
+ padding-top: 0.16rem;
+ }
}
@media screen and (max-width: 768px) {
- .play-details .play-details-header .header-leftcol-action {
- padding-top: .06rem;
- }
- .play-details .play-details-header .header-leftcol-action svg {
- width: 20px;
- }
+ .play-details .play-details-header .header-leftcol-action {
+ padding-top: 0.06rem;
+ }
+ .play-details .play-details-header .header-leftcol-action svg {
+ width: 20px;
+ }
}
.play-details .play-details-header .header-leftcol-contents {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- grid-gap: .1rem;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ grid-gap: 0.1rem;
}
@media screen and (max-width: 480px) {
- .play-details .play-details-header .header-leftcol {
- grid-gap: .3rem;
- }
+ .play-details .play-details-header .header-leftcol {
+ grid-gap: 0.3rem;
+ }
- .play-details .play-details-header .header-leftcol-action {
- padding-top: .1rem;
- }
+ .play-details .play-details-header .header-leftcol-action {
+ padding-top: 0.1rem;
+ }
}
.play-details .play-details-header .header-rightcol {
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- grid-gap: .5rem;
- padding-top: 0.4rem;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ grid-gap: 0.5rem;
+ padding-top: 0.4rem;
}
.play-details .play-details-header .header-primary {
- display: flex;
- flex-direction: row;
- align-items: center;
- grid-gap: .2rem .6rem;
- flex-wrap: wrap;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ grid-gap: 0.2rem 0.6rem;
+ flex-wrap: wrap;
}
@media screen and (max-width: 480px) {
- .play-details .play-details-header .header-rightcol {
- flex-direction: row-reverse;
- align-items: flex-start;
- border-top: solid 1px var(--color-neutral-30);
- margin-top: 0.4rem;
- padding-top: 0.4rem;
- }
+ .play-details .play-details-header .header-rightcol {
+ flex-direction: row-reverse;
+ align-items: flex-start;
+ border-top: solid 1px var(--color-neutral-30);
+ margin-top: 0.4rem;
+ padding-top: 0.4rem;
+ }
- .play-details .play-details-header .header-rightcol .header-desc {
- text-align: left;
- margin-right: 1rem;
- line-height: var(--lh-rg);
- }
+ .play-details .play-details-header .header-rightcol .header-desc {
+ text-align: left;
+ margin-right: 1rem;
+ line-height: var(--lh-rg);
+ }
}
-
-
-
-
.play-level {
- display: inline-flex;
- align-items: center;
- grid-gap: 0.2rem;
- line-height: 1;
- border-radius: 0.2rem;
- font-size: var(--fs-xs);
- font-weight: var(--fw-bold);
- text-transform: uppercase;
- background-color: rgba(var(--color-neutral-90-rgb),0.12);
- padding: 0.3rem 0.4rem 0.24rem 0.4rem;
- color: rgba(var(--color-neutral-90-rgb), 0.8);
- text-decoration: none;
- letter-spacing: 0.04rem;
- transition: all 0.12s ease-in-out;
+ display: inline-flex;
+ align-items: center;
+ grid-gap: 0.2rem;
+ line-height: 1;
+ border-radius: 0.2rem;
+ font-size: var(--fs-xs);
+ font-weight: var(--fw-bold);
+ text-transform: uppercase;
+ background-color: rgba(var(--color-neutral-90-rgb), 0.12);
+ padding: 0.3rem 0.4rem 0.24rem 0.4rem;
+ color: rgba(var(--color-neutral-90-rgb), 0.8);
+ text-decoration: none;
+ letter-spacing: 0.04rem;
+ transition: all 0.12s ease-in-out;
}
.play-level.play-level-1 {
- background-color: rgba(var(--color-play-level-1),0.12);
- color: rgba(var(--color-play-level-1), 1);
+ background-color: rgba(var(--color-play-level-1), 0.12);
+ color: rgba(var(--color-play-level-1), 1);
}
/* .play-level.play-level-1:hover,
.play-level.play-level-1:focus {
@@ -342,8 +338,8 @@
} */
.play-level.play-level-2 {
- color: rgba(var(--color-play-level-2), 1);
- background-color: rgba(var(--color-play-level-2),0.12);
+ color: rgba(var(--color-play-level-2), 1);
+ background-color: rgba(var(--color-play-level-2), 0.12);
}
/* .play-level.play-level-2:hover,
.play-level.play-level-2:focus {
@@ -352,8 +348,8 @@
} */
.play-level.play-level-3 {
- color: rgba(var(--color-play-level-3), 1);
- background-color: rgba(var(--color-play-level-3),0.12);
+ color: rgba(var(--color-play-level-3), 1);
+ background-color: rgba(var(--color-play-level-3), 0.12);
}
/* .play-level.play-level-3:hover,
.play-level.play-level-3:focus {
@@ -362,55 +358,55 @@
} */
.play-details .play-details-header .header-secondary .header-author {
- font-size: var(--fs-sm);
+ font-size: var(--fs-sm);
}
.play-details .play-details-header .header-secondary .header-author a {
- color: var(--color-neutral-90);
- text-decoration: none;
+ color: var(--color-neutral-90);
+ text-decoration: none;
}
.play-details .play-details-header .header-secondary .header-author a:hover,
.play-details .play-details-header .header-secondary .header-author a:focus {
- color: var(--color-neutral-100);
- border-bottom: solid 2px var(--color-brand-primary);
+ color: var(--color-neutral-100);
+ border-bottom: solid 2px var(--color-brand-primary);
}
.play-details .play-details-header .header-secondary {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- grid-gap: .2rem .6rem;
- align-items: center;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ grid-gap: 0.2rem 0.6rem;
+ align-items: center;
}
@media screen and (max-width: 768px) {
- .play-details .play-details-header .header-secondary {
- margin-top: .3rem;
- }
+ .play-details .play-details-header .header-secondary {
+ margin-top: 0.3rem;
+ }
}
.play-details .play-details-header .list-tags {
- margin: 0;
- padding: 0;
- list-style: none;
- display: inline-flex;
- grid-gap: .6rem;
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ display: inline-flex;
+ grid-gap: 0.6rem;
}
.play-tag {
- display: inline-flex;
- line-height: 1.1;
- border-radius: 0.2rem;
- font-size: var(--fs-xs);
- font-weight: var(--fw-semibold);
- text-transform: uppercase;
- background-color: rgba(var(--color-neutral-90-rgb),0.08);
- padding: 0.4rem 0.4rem 0.4rem 0.4rem;
- color: var(--color-neutral-60);
- text-decoration: none;
- letter-spacing: 0.01rem;
- transition: all 0.12s ease-in-out;
+ display: inline-flex;
+ line-height: 1.1;
+ border-radius: 0.2rem;
+ font-size: var(--fs-xs);
+ font-weight: var(--fw-semibold);
+ text-transform: uppercase;
+ background-color: rgba(var(--color-neutral-90-rgb), 0.08);
+ padding: 0.4rem 0.4rem 0.4rem 0.4rem;
+ color: var(--color-neutral-60);
+ text-decoration: none;
+ letter-spacing: 0.01rem;
+ transition: all 0.12s ease-in-out;
}
/* .play-tag:hover,
@@ -420,219 +416,216 @@
} */
.play-details .play-details-header .header-title {
- margin: 0;
- font-size: var(--fs-md);
+ margin: 0;
+ font-size: var(--fs-md);
}
.play-details .play-details-header .header-desc {
- margin: 0;
- font-size: var(--fs-xs);
- color: var(--color-neutral-60);
- text-align: right;
+ margin: 0;
+ font-size: var(--fs-xs);
+ color: var(--color-neutral-60);
+ text-align: right;
}
.play-details .play-details-header .header-title-tags {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- align-items: center;
- grid-gap: .6rem;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ align-items: center;
+ grid-gap: 0.6rem;
}
-@media screen and (max-width:768px) {
- .play-details .play-details-header .header-title-tags {
- grid-gap: .3rem;
- }
+@media screen and (max-width: 768px) {
+ .play-details .play-details-header .header-title-tags {
+ grid-gap: 0.3rem;
+ }
}
.play-details .play-details-header .header-actions {
- display: flex;
- flex-direction: row;
- align-items: center;
- grid-gap: 1rem;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ grid-gap: 1rem;
}
.play-details .play-details-body {
- flex-grow: 1;
- padding: 1rem;
- overflow-y: auto;
+ flex-grow: 1;
+ padding: 1rem;
+ overflow-y: auto;
}
.play-details .header-actions .action {
- position: relative;
- width: 24px;
- height: 24px;
- border: 0;
- background: transparent;
-
+ position: relative;
+ width: 24px;
+ height: 24px;
+ border: 0;
+ background: transparent;
}
.play-details .header-actions .action.badged {
- display: flex;
- width: auto;
- height: auto;
- text-decoration: none;
- margin-right: -0.6rem;
+ display: flex;
+ width: auto;
+ height: auto;
+ text-decoration: none;
+ margin-right: -0.6rem;
}
.play-details .header-actions .action.badged .badge-count {
- position: relative;
- top: -0.4rem;
- right: 0;
- margin-left: -0.6rem;
-
- text-decoration: none;
- min-width: 0.6rem;
- min-height: 0.6rem;
- padding: 0.3rem 0.3rem 0.1rem 0.3rem;
- height: 1.4rem;
- font-size: var(--fs-xxs);
- font-weight: var(--fw-semibold);
- line-height: var(--lh-rg);
- color: var(--color-neutral-90);
- border: solid 1px var(--color-neutral-10);
- border-radius: 1rem;
- background-color: var(--color-brand-primary);
+ position: relative;
+ top: -0.4rem;
+ right: 0;
+ margin-left: -0.6rem;
+
+ text-decoration: none;
+ min-width: 0.6rem;
+ min-height: 0.6rem;
+ padding: 0.3rem 0.3rem 0.1rem 0.3rem;
+ height: 1.4rem;
+ font-size: var(--fs-xxs);
+ font-weight: var(--fw-semibold);
+ line-height: var(--lh-rg);
+ color: var(--color-neutral-90);
+ border: solid 1px var(--color-neutral-10);
+ border-radius: 1rem;
+ background-color: var(--color-brand-primary);
}
.play-details .header-actions .action .badge {
- position: absolute;
- top: -2px;
- right: 0;
- width: 0.6rem;
- height: 0.6rem;
- border: solid 1px var(--color-neutral-10);
- border-radius: 1rem;
- background-color: var(--color-brand-primary);
+ position: absolute;
+ top: -2px;
+ right: 0;
+ width: 0.6rem;
+ height: 0.6rem;
+ border: solid 1px var(--color-neutral-10);
+ border-radius: 1rem;
+ background-color: var(--color-brand-primary);
}
.play-details .header-actions .action .icon {
- fill: rgba(var(--color-neutral-90-rgb), 0.4);
+ fill: rgba(var(--color-neutral-90-rgb), 0.4);
}
.play-details .header-actions .action:hover .icon,
.play-details .header-actions .action:focus .icon {
- fill: rgba(var(--color-neutral-90-rgb), 0.8);
+ fill: rgba(var(--color-neutral-90-rgb), 0.8);
}
.play-details .header-actions .action.badged:hover .badge-count {
- background-color: var(--color-neutral-90);
- color: var(--color-neutral-10);
+ background-color: var(--color-neutral-90);
+ color: var(--color-neutral-10);
}
.play-details .header-actions .app-header-btn {
- display: flex;
- flex-direction: row;
- align-items: center;
- border: solid 2px var(--color-neutral-40);
- border-radius: 2rem;
- grid-gap: 0.6rem;
- padding: 0.4rem 1rem;
- text-decoration: none;
- font-size: var(--fs-sm);
- width: unset;
- height: unset;
- color: var(--color-neutral-60);
- transition: all 0.12s ease-in-out;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ border: solid 2px var(--color-neutral-40);
+ border-radius: 2rem;
+ grid-gap: 0.6rem;
+ padding: 0.4rem 1rem;
+ text-decoration: none;
+ font-size: var(--fs-sm);
+ width: unset;
+ height: unset;
+ color: var(--color-neutral-60);
+ transition: all 0.12s ease-in-out;
}
.play-details .header-actions .app-header-btn .icon {
- fill: rgba(var(--color-neutral-90-rgb), 0.4);
+ fill: rgba(var(--color-neutral-90-rgb), 0.4);
}
.play-details .header-actions .app-header-btn:hover .icon,
.play-details .header-actions .app-header-btn:focus .icon {
- fill: rgba(var(--color-neutral-90-rgb), 0.9);
+ fill: rgba(var(--color-neutral-90-rgb), 0.9);
}
.play-details .header-actions .app-header-btn:hover,
.play-details .header-actions .app-header-btn:focus {
- border-color: var(--color-brand-primary);
- color: rgba(var(--color-neutral-90-rgb), 0.9);
+ border-color: var(--color-brand-primary);
+ color: rgba(var(--color-neutral-90-rgb), 0.9);
}
/* Play Comments */
.play-details-comments {
- position: fixed;
- top: 64px;
- right: 0;
- width: 60%;
- max-width: 600px;
- bottom: 0;
- display: flex;
- flex-direction: column;
- background-color: var(--color-neutral-10);
- padding: 1rem 0 0 0;
- box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- overflow: hidden;
- z-index: 100;
+ position: fixed;
+ top: 64px;
+ right: 0;
+ width: 60%;
+ max-width: 600px;
+ bottom: 0;
+ display: flex;
+ flex-direction: column;
+ background-color: var(--color-neutral-10);
+ padding: 1rem 0 0 0;
+ box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ overflow: hidden;
+ z-index: 100;
}
-@media screen and (max-width:768px) {
- .play-details-comments {
- width: 80%;
- }
+@media screen and (max-width: 768px) {
+ .play-details-comments {
+ width: 80%;
+ }
}
.play-details-comments .comments-header {
- padding: 0 2rem;
- border-bottom: solid 1px var(--color-neutral-30);
- display: flex;
- flex-direction: row;
- justify-content: space-between;
+ padding: 0 2rem;
+ border-bottom: solid 1px var(--color-neutral-30);
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
}
.play-details-comments .comments-header .header-action {
- border: 0;
- width: 24px;
- height: 24px;
- background: transparent;
+ border: 0;
+ width: 24px;
+ height: 24px;
+ background: transparent;
}
.play-details-comments .comments-header .header-action .icon {
- fill: rgba(var(--color-neutral-90-rgb), 0.4);
+ fill: rgba(var(--color-neutral-90-rgb), 0.4);
}
.play-details-comments .comments-header .header-action:hover .icon,
.play-details-comments .comments-header .header-action:focus .icon {
- fill: rgba(var(--color-neutral-90-rgb), 0.8);
+ fill: rgba(var(--color-neutral-90-rgb), 0.8);
}
-
.play-details-comments .comments-body {
- padding: 1rem 2rem 0 2rem;
- flex-grow: 1;
- overflow-y: auto;
+ padding: 1rem 2rem 0 2rem;
+ flex-grow: 1;
+ overflow-y: auto;
}
.play-details-comments .comments-header .header-title {
- margin: 0 0 .6rem 0;
- padding: 0;
- font-size: var(--fs-md);
- font-weight: var(--fw-bold);
- color: var(--color-neutral-80);
-
+ margin: 0 0 0.6rem 0;
+ padding: 0;
+ font-size: var(--fs-md);
+ font-weight: var(--fw-bold);
+ color: var(--color-neutral-80);
}
/* Play not found */
.play-not-found {
- min-height: calc(100vh - 100px);
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 0 1rem;
+ min-height: calc(100vh - 100px);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 0 1rem;
}
.play-not-found .play-not-found-image {
- max-width: 100%;
- height: auto;
+ max-width: 100%;
+ height: auto;
}
-@media screen and (max-width:768px) {
- .play-not-found .play-not-found-image {
- max-width: 50%;
- margin-bottom: 2rem;
- }
-}
\ No newline at end of file
+@media screen and (max-width: 768px) {
+ .play-not-found .play-not-found-image {
+ max-width: 50%;
+ margin-bottom: 2rem;
+ }
+}
diff --git a/src/common/routing/RouteDefs.jsx b/src/common/routing/RouteDefs.jsx
index 9e64fb2533..cf265dcd37 100644
--- a/src/common/routing/RouteDefs.jsx
+++ b/src/common/routing/RouteDefs.jsx
@@ -1,8 +1,8 @@
-import App from "App";
-import { Footer, Header, Home, PlayMeta, DefMeta, PageNotFound, PlayIdeas } from "common";
-import PlayList from "common/playlists/PlayList";
-import { getAllPlays } from "meta/play-meta-util";
-import { BrowserRouter, Route, Routes } from "react-router-dom";
+import App from 'App';
+import { Footer, Header, Home, PlayMeta, DefMeta, PageNotFound, PlayIdeas } from 'common';
+import PlayList from 'common/playlists/PlayList';
+import { getAllPlays } from 'meta/play-meta-util';
+import { BrowserRouter, Route, Routes } from 'react-router-dom';
const RouteDefs = () => {
const plays = getAllPlays();
@@ -25,11 +25,10 @@ const RouteDefs = () => {
} />
} />
-
);
};
-export default RouteDefs;
\ No newline at end of file
+export default RouteDefs;
diff --git a/src/common/routing/hooks/useBackListener.js b/src/common/routing/hooks/useBackListener.js
index ba536d25ad..ac7262ac3c 100644
--- a/src/common/routing/hooks/useBackListener.js
+++ b/src/common/routing/hooks/useBackListener.js
@@ -1,17 +1,17 @@
-//the code is inspired from
-//https://stackoverflow.com/questions/71369320/how-to-controling-browser-back-button-with-react-router-dom-v6
+// the code is inspired from
+// https://stackoverflow.com/questions/71369320/how-to-controling-browser-back-button-with-react-router-dom-v6
-import { useContext, useEffect } from "react";
-import { UNSAFE_NavigationContext } from "react-router-dom";
+import { useContext, useEffect } from 'react';
+import { UNSAFE_NavigationContext } from 'react-router-dom';
const useBackListener = (callback) => {
const { navigator } = useContext(UNSAFE_NavigationContext);
useEffect(() => {
const listener = ({ location, action }) => {
- if (action === "POP") {
+ if (action === 'POP') {
callback({ location, action });
}
- if (action === "PUSH") {
+ if (action === 'PUSH') {
callback({ location, action });
}
};
diff --git a/src/common/routing/hooks/useLocationChange.js b/src/common/routing/hooks/useLocationChange.js
index 9bd19f6c36..54e6b3f5d2 100644
--- a/src/common/routing/hooks/useLocationChange.js
+++ b/src/common/routing/hooks/useLocationChange.js
@@ -1,11 +1,11 @@
-
import { useEffect } from 'react';
-import { useLocation } from "react-router-dom";
+import { useLocation } from 'react-router-dom';
const useLocationChange = (action) => {
- const location = useLocation()
- useEffect(() => { action(location) }, [location, action]);
-}
+ const location = useLocation();
+ useEffect(() => {
+ action(location);
+ }, [location, action]);
+};
export { useLocationChange };
-
diff --git a/src/common/search/FilterPlays.jsx b/src/common/search/FilterPlays.jsx
index 406b352160..dba95ec660 100644
--- a/src/common/search/FilterPlays.jsx
+++ b/src/common/search/FilterPlays.jsx
@@ -1,12 +1,12 @@
-import { Modal } from "common";
-import { getAllCreators, getAllLevels, getAllTags, getAllLanguages } from "meta/play-meta-util";
-import { useContext, useState } from "react";
-import { useLocation, useNavigate } from "react-router-dom";
-import { SearchContext } from "./search-context";
-import "./search.css";
+import { Modal } from 'common';
+import { getAllCreators, getAllLevels, getAllTags, getAllLanguages } from 'meta/play-meta-util';
+import { useContext, useState } from 'react';
+import { useLocation, useNavigate } from 'react-router-dom';
+import { SearchContext } from './search-context';
+import './search.css';
-import { RiFilterFill } from "react-icons/ri";
-import useBackListener from "common/routing/hooks/useBackListener";
+import { RiFilterFill } from 'react-icons/ri';
+import useBackListener from 'common/routing/hooks/useBackListener';
const FilterPlaysModalBody = ({ filterQuery, setFilterQuery }) => {
const tags = getAllTags();
@@ -20,9 +20,7 @@ const FilterPlaysModalBody = ({ filterQuery, setFilterQuery }) => {
Level
- setFilterQuery({ ...filterQuery, level: event.target.value })
- }
+ onChange={(event) => setFilterQuery({ ...filterQuery, level: event.target.value })}
value={filterQuery.level}
>
All
@@ -38,7 +36,10 @@ const FilterPlaysModalBody = ({ filterQuery, setFilterQuery }) => {
- setFilterQuery({ ...filterQuery, tags: event.target.value !== "" ? [event.target.value] : [] })
+ setFilterQuery({
+ ...filterQuery,
+ tags: event.target.value !== '' ? [event.target.value] : []
+ })
}
value={filterQuery.tags[0]}
>
@@ -54,9 +55,7 @@ const FilterPlaysModalBody = ({ filterQuery, setFilterQuery }) => {
Creator
- setFilterQuery({ ...filterQuery, creator: event.target.value })
- }
+ onChange={(event) => setFilterQuery({ ...filterQuery, creator: event.target.value })}
value={filterQuery.creator}
>
All
@@ -71,9 +70,7 @@ const FilterPlaysModalBody = ({ filterQuery, setFilterQuery }) => {
Language
- setFilterQuery({ ...filterQuery, language: event.target.value })
- }
+ onChange={(event) => setFilterQuery({ ...filterQuery, language: event.target.value })}
value={filterQuery.language}
>
All
@@ -91,20 +88,13 @@ const FilterPlaysModalBody = ({ filterQuery, setFilterQuery }) => {
const getAppliedFilter = (filterObject) => {
//for single filter to check whether filter has been applied
const noOfLevelsApplied =
- filterObject?.level !== undefined && filterObject.level.trim() !== ""
- ? 1
- : 0;
+ filterObject?.level !== undefined && filterObject.level.trim() !== '' ? 1 : 0;
const noOfcreatorsApplied =
- filterObject.creator !== undefined && filterObject.creator.trim() !== ""
- ? 1
- : 0;
+ filterObject.creator !== undefined && filterObject.creator.trim() !== '' ? 1 : 0;
const noOfLanguageApplied =
- filterObject.language !== undefined && filterObject.language.trim() !== ""
- ? 1 : 0;
- const noOfTagsApplied =
- filterObject?.tags?.length ? filterObject.tags.length : 0
- let totalTags = noOfLevelsApplied +
- noOfcreatorsApplied + noOfLanguageApplied + noOfTagsApplied;
+ filterObject.language !== undefined && filterObject.language.trim() !== '' ? 1 : 0;
+ const noOfTagsApplied = filterObject?.tags?.length ? filterObject.tags.length : 0;
+ let totalTags = noOfLevelsApplied + noOfcreatorsApplied + noOfLanguageApplied + noOfTagsApplied;
return totalTags;
};
@@ -123,8 +113,8 @@ const FilterPlays = () => {
const [noOfAppliedFilter, setnoOfAppliedFilter] = useState(0);
useBackListener(({ action }) => {
- if (action === "POP") {
- console.log("POP");
+ if (action === 'POP') {
+ console.log('POP');
setModifiedFilterQuery({
level: '',
tags: [],
@@ -139,8 +129,8 @@ const FilterPlays = () => {
});
setnoOfAppliedFilter(0);
}
- if (action === "PUSH") {
- console.log("PUSH");
+ if (action === 'PUSH') {
+ console.log('PUSH');
setModifiedFilterQuery({
level: '',
tags: [],
@@ -158,12 +148,12 @@ const FilterPlays = () => {
});
const handleFilter = (event) => {
event.preventDefault();
- console.log("filterQuery", filterQuery);
- console.log("modifiedFilterQuery", modifiedFilterQuery);
+ console.log('filterQuery', filterQuery);
+ console.log('modifiedFilterQuery', modifiedFilterQuery);
setFilterQuery(modifiedFilterQuery);
setnoOfAppliedFilter(getAppliedFilter(modifiedFilterQuery));
- if (location.pathname !== "/plays") {
- navigate("/plays", { replace: true });
+ if (location.pathname !== '/plays') {
+ navigate('/plays', { replace: true });
}
showModal && setShowModal(false);
};
@@ -184,21 +174,10 @@ const FilterPlays = () => {
}
/>
- setShowModal(true)}
- className="btn-filter"
- title="Filter Plays"
- >{
- noOfAppliedFilter === 0 ?
- null
- : {noOfAppliedFilter}
- }
+ setShowModal(true)} className="btn-filter" title="Filter Plays">
+ {noOfAppliedFilter === 0 ? null : {noOfAppliedFilter}
}
-
+
);
diff --git a/src/common/search/SearchPlays.jsx b/src/common/search/SearchPlays.jsx
index b437d75e10..591e33f936 100644
--- a/src/common/search/SearchPlays.jsx
+++ b/src/common/search/SearchPlays.jsx
@@ -1,9 +1,9 @@
-import { useContext, useRef } from "react";
-import { useLocation, useNavigate } from "react-router-dom";
-import { SearchContext } from "./search-context";
-import "./search.css";
-import { BiSearch } from "react-icons/bi";
-import useBackListener from "common/routing/hooks/useBackListener";
+import { useContext, useRef } from 'react';
+import { useLocation, useNavigate } from 'react-router-dom';
+import { SearchContext } from './search-context';
+import './search.css';
+import { BiSearch } from 'react-icons/bi';
+import useBackListener from 'common/routing/hooks/useBackListener';
const SearchPlays = () => {
const location = useLocation();
@@ -11,22 +11,22 @@ const SearchPlays = () => {
const { setSearchTerm } = useContext(SearchContext);
const inputRef = useRef(null);
useBackListener(({ action }) => {
- if (action === "POP") {
- inputRef.current.value = "";
- setSearchTerm("");
+ if (action === 'POP') {
+ inputRef.current.value = '';
+ setSearchTerm('');
}
- if (action === "PUSH") {
- inputRef.current.value = "";
- setSearchTerm("");
+ if (action === 'PUSH') {
+ inputRef.current.value = '';
+ setSearchTerm('');
}
});
const handleSearch = (event) => {
event.preventDefault();
- if (event.key === "Enter") {
+ if (event.key === 'Enter') {
setSearchTerm(event.target.value);
- if (location.pathname !== "/plays") {
- navigate("/plays", { replace: true });
+ if (location.pathname !== '/plays') {
+ navigate('/plays', { replace: true });
}
}
};
diff --git a/src/common/search/hooks/useSearchFilter.js b/src/common/search/hooks/useSearchFilter.js
index 369086935f..e021f0ff8c 100644
--- a/src/common/search/hooks/useSearchFilter.js
+++ b/src/common/search/hooks/useSearchFilter.js
@@ -1,13 +1,13 @@
-import { SearchContext } from "common/search/search-context";
-import { getPlaysOnSearch } from "meta/play-meta-util";
-import { useContext, useEffect, useState } from "react";
+import { SearchContext } from 'common/search/search-context';
+import { getPlaysOnSearch } from 'meta/play-meta-util';
+import { useContext, useEffect, useState } from 'react';
const useSearchFilter = () => {
const { searchTerm, filterQuery } = useContext(SearchContext);
-
+
console.log('searchTerm', searchTerm);
console.log('filterQuery', filterQuery);
-
+
const [plays, setPlays] = useState([]);
useEffect(() => {
@@ -21,29 +21,27 @@ const useSearchFilter = () => {
const filterPlays = (searchTerm, filterQuery) => {
let filteredPlays = [];
const { level, tags, creator, language } = filterQuery;
-
+
const searchedPlays = getPlaysOnSearch(searchTerm);
- filteredPlays = searchedPlays.filter(play => {
- return (play.github === creator || !creator);
+ filteredPlays = searchedPlays.filter((play) => {
+ return play.github === creator || !creator;
});
- filteredPlays = filteredPlays.filter(play => {
- return (play.level === level || !level);
+ filteredPlays = filteredPlays.filter((play) => {
+ return play.level === level || !level;
});
- filteredPlays = filteredPlays.filter(play => {
- return (play.tags.includes(tags[0]) || !tags[0]);
+ filteredPlays = filteredPlays.filter((play) => {
+ return play.tags.includes(tags[0]) || !tags[0];
});
- filteredPlays = filteredPlays.filter(play => {
+ filteredPlays = filteredPlays.filter((play) => {
const lang = play.language || 'js';
- return (lang === language || !language);
+ return lang === language || !language;
});
-
-
+
return filteredPlays;
-}
+};
export { useSearchFilter };
-
diff --git a/src/common/search/search-context.js b/src/common/search/search-context.js
index 048499695c..230ddb1436 100644
--- a/src/common/search/search-context.js
+++ b/src/common/search/search-context.js
@@ -1,4 +1,3 @@
-
import React from 'react';
export const SearchContext = React.createContext({
@@ -8,7 +7,7 @@ export const SearchContext = React.createContext({
tags: [],
creator: '',
language: ''
- },
+ },
setSearchTerm: () => {},
setFilterQuery: () => {}
-});
\ No newline at end of file
+});
diff --git a/src/common/search/search.css b/src/common/search/search.css
index a6caee382a..08be223f93 100644
--- a/src/common/search/search.css
+++ b/src/common/search/search.css
@@ -30,26 +30,29 @@
color: var(--color-neutral-20);
font-family: var(--ff-default);
font-size: var(--fs-rg);
- background-color: rgba(var(--color-brand-primary-rgb), 0.20);
+ background-color: rgba(var(--color-brand-primary-rgb), 0.2);
}
.search-input .search-input-text:focus,
.search-input .search-input-text:focus-visible {
border: solid 1px var(--color-neutral-50);
- box-shadow: 0 0 0 rgba(0,0,0,0);
+ box-shadow: 0 0 0 rgba(0, 0, 0, 0);
outline: none;
}
-.search-input .search-input-text::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
+.search-input .search-input-text::placeholder {
+ /* Chrome, Firefox, Opera, Safari 10.1+ */
color: var(--color-neutral-10);
opacity: 0.5; /* Firefox */
}
-.search-input .search-input-text:-ms-input-placeholder { /* Internet Explorer 10-11 */
+.search-input .search-input-text:-ms-input-placeholder {
+ /* Internet Explorer 10-11 */
color: var(--color-neutral-10);
}
-.search-input .search-input-text::-ms-input-placeholder { /* Microsoft Edge */
+.search-input .search-input-text::-ms-input-placeholder {
+ /* Microsoft Edge */
color: var(--color-neutral-10);
}
@@ -108,7 +111,6 @@
@media screen and (max-width: 576px) {
.btn-filter {
-
}
.btn-filter .icon {
width: 24px;
@@ -124,25 +126,24 @@
z-index: 100;
display: flex;
flex-direction: column;
-
+
/* Probably need media queries here */
width: 400px;
max-width: 90%;
max-height: 90%;
border-radius: 0.2rem;
-
+
transform: translate(-50%, -50%);
-
- background: white;
- box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
- -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb),0.62);
+ background: white;
+ box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ -webkit-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
+ -moz-box-shadow: 0px 0 26px 0px rgba(var(--color-neutral-90-rgb), 0.62);
}
.modal-overlay {
position: fixed;
- background-color: rgba(0,0,0,0.72);
+ background-color: rgba(0, 0, 0, 0.72);
top: 0;
right: 0;
bottom: 0;
@@ -178,10 +179,8 @@
margin-bottom: 1rem;
}
-
.modal-filter .form-group:last-child {
margin-bottom: 0;
-
}
.modal-filter .form-group label {
@@ -205,18 +204,18 @@
display: inline-flex;
align-items: center;
grid-gap: 0.4rem;
- border-radius: 2rem;
+ border-radius: 2rem;
padding: 0.8rem 1.4rem;
font-size: var(--fs-rg);
font-weight: var(--fw-bold);
- background-color: rgba(var(--color-neutral-90-rgb),0.1);
+ background-color: rgba(var(--color-neutral-90-rgb), 0.1);
color: var(--color-neutral-80);
transition: all 0.16s ease-in-out;
}
.btn-default-light:hover,
.btn-default-light:focus {
- background-color: rgba(var(--color-neutral-90-rgb),0.2);
+ background-color: rgba(var(--color-neutral-90-rgb), 0.2);
color: var(--color-neutral-90);
}
@@ -225,7 +224,7 @@
display: inline-flex;
align-items: center;
grid-gap: 0.4rem;
- border-radius: 2rem;
+ border-radius: 2rem;
padding: 0.8rem 1.4rem;
font-size: var(--fs-rg);
font-weight: var(--fw-bold);
@@ -238,4 +237,4 @@
.btn-primary:focus {
color: var(--color-neutral-10);
background-color: var(--color-neutral-90);
-}
\ No newline at end of file
+}
diff --git a/src/index.js b/src/index.js
index f650009342..a0292bfa36 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,17 +1,17 @@
-import RouteDefs from "common/routing/RouteDefs";
-import { SearchContext } from "common/search/search-context";
-import "index.css";
-import React, { useState } from "react";
+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 reportWebVitals from "reportWebVitals";
+import reportWebVitals from 'reportWebVitals';
-const Index = () => {
- const [searchTerm, setSearchTerm] = useState("");
+function Index() {
+ const [searchTerm, setSearchTerm] = useState('');
const [filterQuery, setFilterQuery] = useState({
- level: "",
+ level: '',
tags: [],
- creator: "",
- language: ""
+ creator: '',
+ language: ''
});
const value = { searchTerm, setSearchTerm, filterQuery, setFilterQuery };
@@ -22,8 +22,8 @@ const Index = () => {
);
-};
-const container = document.getElementById("root");
+}
+const container = document.getElementById('root');
createRoot(container).render(
);
// If you want to start measuring performance in your app, pass a function
diff --git a/src/meta/DefMeta.jsx b/src/meta/DefMeta.jsx
index 8717739a3e..93eee8ae6e 100644
--- a/src/meta/DefMeta.jsx
+++ b/src/meta/DefMeta.jsx
@@ -1,4 +1,4 @@
-import { Helmet } from "react-helmet";
+import { Helmet } from 'react-helmet';
function DefMeta() {
return (
@@ -36,11 +36,7 @@ function DefMeta() {
content="Start React Code Arena with ReactPlay"
data-react-helmet="true"
/>
-
+
{
return plays;
};
-const getPlayById = id => {
- return plays.find(play => play.id === id);
+const getPlayById = (id) => {
+ return plays.find((play) => play.id === id);
};
-const getPlaysOnSearch = searchTerm => {
- return plays.filter(play => {
- return (play.name.toLowerCase().includes(searchTerm.toLowerCase())
- || play.description.toLowerCase().includes(searchTerm.toLowerCase()));
+const getPlaysOnSearch = (searchTerm) => {
+ return plays.filter((play) => {
+ return (
+ play.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
+ play.description.toLowerCase().includes(searchTerm.toLowerCase())
+ );
});
-}
+};
-const getPlaysByTags = tags => {
- return plays.filter(play => {
+const getPlaysByTags = (tags) => {
+ return plays.filter((play) => {
return play.tags.includes(tags);
});
-}
+};
-const getPlaysByLevel = level => {
- return plays.filter(play => {
+const getPlaysByLevel = (level) => {
+ return plays.filter((play) => {
return play.level === level;
});
-}
+};
-const getPlaysByCreator = creator => {
- return plays.filter(play => {
+const getPlaysByCreator = (creator) => {
+ return plays.filter((play) => {
return play.github === creator;
});
-}
+};
-const getPlaysByLanguage = language => {
- return plays.filter(play => {
+const getPlaysByLanguage = (language) => {
+ return plays.filter((play) => {
const lang = play.language || 'js';
return lang === language;
});
-}
+};
const getAllTags = () => {
const tags = plays.reduce((acc, play) => {
@@ -47,7 +48,7 @@ const getAllTags = () => {
}, []);
return Array.from(new Set([...tags]));
-}
+};
const getAllCreators = () => {
const creators = plays.reduce((acc, play) => {
@@ -56,7 +57,7 @@ const getAllCreators = () => {
}, []);
return Array.from(new Set([...creators]));
-}
+};
const getAllLevels = () => {
const levels = plays.reduce((acc, play) => {
@@ -64,7 +65,7 @@ const getAllLevels = () => {
}, []);
return Array.from(new Set([...levels]));
-}
+};
const getAllLanguages = () => {
const languages = plays.reduce((acc, play) => {
@@ -73,14 +74,14 @@ const getAllLanguages = () => {
}, []);
return Array.from(new Set([...languages]));
-}
+};
const getFeaturedPlays = () => {
- const featuredPlays = plays.filter(play => {
+ const featuredPlays = plays.filter((play) => {
return play.featured;
});
return featuredPlays;
-}
+};
export {
getAllPlays,
diff --git a/src/meta/play-meta.js b/src/meta/play-meta.js
index b01aa7f1d4..3ba3c0051f 100644
--- a/src/meta/play-meta.js
+++ b/src/meta/play-meta.js
@@ -21,226 +21,222 @@ import {
Calendar,
FunQuiz,
TicTacToeGame,
- DynamicRoutes,
- //import play here
-} from "plays";
+ DynamicRoutes
+ // import play here
+} from 'plays';
export const plays = [
{
- id: "pl-0001",
- name: "Why React",
- description: "A simple application to demonstrate JSX usages",
+ id: 'pl-0001',
+ name: 'Why React',
+ description: 'A simple application to demonstrate JSX usages',
component: () => {
return
;
},
- path: "/plays/why-react",
+ path: '/plays/why-react',
index: true,
- level: "Beginner",
- tags: "JSX",
- github: "atapas",
+ level: 'Beginner',
+ tags: 'JSX',
+ github: 'atapas'
},
{
- id: "pl-0002",
- name: "Clock",
- description:
- "This application shows the current time and it increases every second",
+ id: 'pl-0002',
+ name: 'Clock',
+ description: 'This application shows the current time and it increases every second',
component: () => {
return
;
},
- path: "/plays/clock",
- level: "Beginner",
- tags: "JSX, Schedule",
- github: "atapas",
- blog: "https://blog.greenroots.info",
- video: "https://youtube.com/tapasadhikary",
+ path: '/plays/clock',
+ level: 'Beginner',
+ tags: 'JSX, Schedule',
+ github: 'atapas',
+ blog: 'https://blog.greenroots.info',
+ video: 'https://youtube.com/tapasadhikary'
},
{
- id: "pl-0003",
- name: "Countdown Timer",
- description: "It is a timer that fires every second and decreases the time",
+ id: 'pl-0003',
+ name: 'Countdown Timer',
+ description: 'It is a timer that fires every second and decreases the time',
component: () => {
return
;
},
- path: "/plays/date-time-counter",
- level: "Intermediate",
- tags: "Schedule, Component Structure, Hooks, Custom Hooks",
- github: "atapas",
- blog: "https://blog.greenroots.info/how-to-create-a-countdown-timer-using-react-hooks",
+ path: '/plays/date-time-counter',
+ level: 'Intermediate',
+ tags: 'Schedule, Component Structure, Hooks, Custom Hooks',
+ github: 'atapas',
+ blog: 'https://blog.greenroots.info/how-to-create-a-countdown-timer-using-react-hooks'
},
{
- id: "pl-0004",
- name: "Movies",
- description: "A list of movies from API call.",
+ id: 'pl-0004',
+ name: 'Movies',
+ description: 'A list of movies from API call.',
component: () => {
return
;
},
- path: "/plays/movies",
- level: "Intermediate",
- tags: "Fetch Data, Hooks",
- github: "atapas",
- blog: "https://blog.openreplay.com/understanding-the-container-component-pattern-with-react-hooks",
+ path: '/plays/movies',
+ level: 'Intermediate',
+ tags: 'Fetch Data, Hooks',
+ github: 'atapas',
+ blog: 'https://blog.openreplay.com/understanding-the-container-component-pattern-with-react-hooks'
},
{
- id: "pl-0005",
- name: "Organization Tree",
- description: "A simple org tree",
+ id: 'pl-0005',
+ name: 'Organization Tree',
+ description: 'A simple org tree',
component: () => {
return
;
},
- path: "/plays/org-tree",
- level: "Intermediate",
- tags: "Recursion, Tree",
- github: "green-roots",
- featured: false,
+ path: '/plays/org-tree',
+ level: 'Intermediate',
+ tags: 'Recursion, Tree',
+ github: 'green-roots',
+ featured: false
},
{
- id: "pl-counter",
- name: "Counter",
- description:
- "A simple counter which increments the value upto a certain limit!",
+ id: 'pl-counter',
+ name: 'Counter',
+ description: 'A simple counter which increments the value upto a certain limit!',
component: () => {
return
;
},
- path: "/plays/counter",
- level: "Beginner",
- tags: "JSX, State, Props",
- github: "murtuzaalisurti",
- featured: false,
+ path: '/plays/counter',
+ level: 'Beginner',
+ tags: 'JSX, State, Props',
+ github: 'murtuzaalisurti',
+ featured: false
},
{
- id: "pl-states",
- name: "States",
- description: "States in Functional Components",
+ id: 'pl-states',
+ name: 'States',
+ description: 'States in Functional Components',
component: () => {
return
;
},
- path: "/plays/states",
- level: "Beginner",
- tags: "Hooks,State,JSX",
- github: "Abhishek-90",
- cover: "",
- blog: "https://abhishek-90.github.io/My-Portfolio/",
+ path: '/plays/states',
+ level: 'Beginner',
+ tags: 'Hooks,State,JSX',
+ github: 'Abhishek-90',
+ cover: '',
+ blog: 'https://abhishek-90.github.io/My-Portfolio/'
},
{
- id: "pl-social-card",
- name: "Social Card",
+ id: 'pl-social-card',
+ name: 'Social Card',
description:
- "The Social Card helps you telling who you are using photo, name, and other social footprints.",
+ 'The Social Card helps you telling who you are using photo, name, and other social footprints.',
component: () => {
return
;
},
- path: "/plays/social-card",
- level: "Intermediate",
- tags: "Form,Events,Complex State",
- github: "atapas",
- cover: "",
- blog: "https://blog.greenroots.info/how-to-create-react-form-with-a-single-change-event-handler",
- video: "",
+ path: '/plays/social-card',
+ level: 'Intermediate',
+ tags: 'Form,Events,Complex State',
+ github: 'atapas',
+ cover: '',
+ blog: 'https://blog.greenroots.info/how-to-create-react-form-with-a-single-change-event-handler',
+ video: ''
},
{
- id: "pl-random-meme-generator",
- name: "Random Meme Generator",
+ id: 'pl-random-meme-generator',
+ name: 'Random Meme Generator',
description:
- "A project to demonstrate the use of API to fetch random memes! It also demonstrates how you can do event handling!",
+ 'A project to demonstrate the use of API to fetch random memes! It also demonstrates how you can do event handling!',
component: () => {
return
;
},
- path: "/plays/random-meme-generator",
- level: "Beginner",
- tags: "JSX,Hooks,API,EventHandling",
- github: "murtuzaalisurti",
- cover: "",
- blog: "",
- video: "",
+ path: '/plays/random-meme-generator',
+ level: 'Beginner',
+ tags: 'JSX,Hooks,API,EventHandling',
+ github: 'murtuzaalisurti',
+ cover: '',
+ blog: '',
+ video: ''
},
{
- id: "pl-react-todo-app",
- name: "React Todo App",
- description:
- "It is a simple Todo App which keeps track of your regular work",
+ id: 'pl-react-todo-app',
+ name: 'React Todo App',
+ description: 'It is a simple Todo App which keeps track of your regular work',
component: () => {
return
;
},
- path: "/plays/react-todo-app",
- level: "Beginner",
- tags: "ReactHooks, JavaScript, Css, React State",
- github: "nirban256",
- cover:
- "https://res.cloudinary.com/atapas/image/upload/v1650866465/demos/cover_y20bzk.png",
- blog: "",
- video: "",
+ path: '/plays/react-todo-app',
+ level: 'Beginner',
+ tags: 'ReactHooks, JavaScript, Css, React State',
+ github: 'nirban256',
+ cover: 'https://res.cloudinary.com/atapas/image/upload/v1650866465/demos/cover_y20bzk.png',
+ blog: '',
+ video: ''
},
{
- id: "pl-quote-generator",
- name: "Random Quote Generator",
- description: "Randomly Generate quotes from 3rd Party API",
+ id: 'pl-quote-generator',
+ name: 'Random Quote Generator',
+ description: 'Randomly Generate quotes from 3rd Party API',
component: () => {
return
;
},
- path: "/plays/quote-generator",
- level: "Intermediate",
- tags: "Hooks,API,Async/Await",
- github: "Abhishek-90",
+ path: '/plays/quote-generator',
+ level: 'Intermediate',
+ tags: 'Hooks,API,Async/Await',
+ github: 'Abhishek-90',
cover:
- "https://i0.wp.com/dariusforoux.com/wp-content/uploads/2015/08/motivational-quotes.png?fit=2048%2C1536&ssl=1",
- blog: "",
- video: "",
+ 'https://i0.wp.com/dariusforoux.com/wp-content/uploads/2015/08/motivational-quotes.png?fit=2048%2C1536&ssl=1',
+ blog: '',
+ video: ''
},
{
- id: "pl-keeper",
- name: "Keeper",
- description:
- "Keeper is the clone of google keep where we can save and delete our notes",
+ id: 'pl-keeper',
+ name: 'Keeper',
+ description: 'Keeper is the clone of google keep where we can save and delete our notes',
component: () => {
return
;
},
- path: "/plays/keeper",
- level: "Intermediate",
- tags: "JSX,Hooks,ReactDOM",
- github: "Shivam-Katare",
- cover:
- "https://res.cloudinary.com/dbjmy6wdu/image/upload/v1651678725/keepicon_jsn5bh.png",
- blog: "",
- video: "",
+ path: '/plays/keeper',
+ level: 'Intermediate',
+ tags: 'JSX,Hooks,ReactDOM',
+ github: 'Shivam-Katare',
+ cover: 'https://res.cloudinary.com/dbjmy6wdu/image/upload/v1651678725/keepicon_jsn5bh.png',
+ blog: '',
+ video: ''
},
{
- id: "pl-expanding-cards",
- name: "Expanding-Cards",
+ id: 'pl-expanding-cards',
+ name: 'Expanding-Cards',
description:
- "this project shows bunch of striped cards on screen if you want to show the card. you just have to click to expand it",
+ 'this project shows bunch of striped cards on screen if you want to show the card. you just have to click to expand it',
component: () => {
return
;
},
- path: "/plays/expanding-cards",
- level: "Beginner",
- tags: "Jsx, useState, hooks, toggle, React, css-transitions",
- github: "Deepak8717",
+ path: '/plays/expanding-cards',
+ level: 'Beginner',
+ tags: 'Jsx, useState, hooks, toggle, React, css-transitions',
+ github: 'Deepak8717',
featured: false,
- cover: "",
- blog: "",
- video: "",
+ cover: '',
+ blog: '',
+ video: ''
},
{
- id: "pl-analog-clock",
- name: "Analog-Clock",
- description: "A beautiful wall clock",
+ id: 'pl-analog-clock',
+ name: 'Analog-Clock',
+ description: 'A beautiful wall clock',
component: () => {
return
;
},
- path: "/plays/analog-clock",
- level: "Beginner",
- tags: "useState, useEffect, Date, setInterval",
- github: "Deepak8717",
- cover: "",
- blog: "",
- video: "",
- featured: true,
-
- }, {
- id: 'pl-quizeo',
- name: 'Quizeo',
+ path: '/plays/analog-clock',
+ level: 'Beginner',
+ tags: 'useState, useEffect, Date, setInterval',
+ github: 'Deepak8717',
+ cover: '',
+ blog: '',
+ video: '',
+ featured: true
+ },
+ {
+ id: 'pl-quizeo',
+ name: 'Quizeo',
description: 'Quizeo is a react app to play quiz about your favourite movies and series.',
- component: () => {return
},
+ component: () => {
+ return
;
+ },
path: '/plays/quizeo',
level: 'Advanced',
tags: 'React-router,Hooks,react-redux,reselect',
@@ -250,142 +246,138 @@ export const plays = [
video: '',
language: 'js'
},
- {
- id: "pl-password-generator",
- name: "Password Generator",
+ {
+ id: 'pl-password-generator',
+ name: 'Password Generator',
description:
- "Its a simple password generator built in react using what user can generate password and customize their requirements in choosing characters and number while generating a medium or strong level password.",
+ 'Its a simple password generator built in react using what user can generate password and customize their requirements in choosing characters and number while generating a medium or strong level password.',
component: () => {
return
;
},
- path: "/plays/password-generator",
- level: "Beginner",
- tags: "PasswordGenerator",
- github: "Angryman18",
+ path: '/plays/password-generator',
+ level: 'Beginner',
+ tags: 'PasswordGenerator',
+ github: 'Angryman18',
cover:
- "https://securityintelligence.com/wp-content/uploads/2018/10/si-eight-character-password-feature.jpg",
- blog: "",
- video: "",
- featured: true,
+ 'https://securityintelligence.com/wp-content/uploads/2018/10/si-eight-character-password-feature.jpg',
+ blog: '',
+ video: '',
+ featured: true
},
{
- id: "pl-why-typescript",
- name: "Why Typescript",
- description:
- "A simplistic way of understanding the existence of TypeScript",
+ id: 'pl-why-typescript',
+ name: 'Why Typescript',
+ description: 'A simplistic way of understanding the existence of TypeScript',
component: () => {
return
;
},
- path: "/plays/why-typescript",
- level: "Intermediate",
- tags: "TSX,TypeScript,Learning,KnowWhat",
- github: "koustov",
- cover:
- "https://res.cloudinary.com/dgtdljyul/image/upload/v1651923177/ts_why_adazpf.png",
- blog: "",
- video: "",
- language: "ts",
- featured: true,
+ path: '/plays/why-typescript',
+ level: 'Intermediate',
+ tags: 'TSX,TypeScript,Learning,KnowWhat',
+ github: 'koustov',
+ cover: 'https://res.cloudinary.com/dgtdljyul/image/upload/v1651923177/ts_why_adazpf.png',
+ blog: '',
+ video: '',
+ language: 'ts',
+ featured: true
},
{
- id: "pl-memory-game",
- name: "Memory Game",
- description: "simple memory game or memory testing game build with ReactJS",
+ id: 'pl-memory-game',
+ name: 'Memory Game',
+ description: 'simple memory game or memory testing game build with ReactJS',
component: () => {
return
;
},
- path: "/plays/memory-game",
- level: "Advanced",
- tags: "MemoryGame, CardGame, ReactJS",
- github: "Angryman18",
- cover:
- "https://cdn.pixabay.com/photo/2017/01/03/16/42/klee-1949946_960_720.jpg",
- blog: "",
- video: "",
- language: "js",
- featured: true,
+ path: '/plays/memory-game',
+ level: 'Advanced',
+ tags: 'MemoryGame, CardGame, ReactJS',
+ github: 'Angryman18',
+ cover: 'https://cdn.pixabay.com/photo/2017/01/03/16/42/klee-1949946_960_720.jpg',
+ blog: '',
+ video: '',
+ language: 'js',
+ featured: true
},
{
- id: "pl-registration-form",
- name: "Registration-Form",
- description: "Registration form with form validation without any library",
+ id: 'pl-registration-form',
+ name: 'Registration-Form',
+ description: 'Registration form with form validation without any library',
component: () => {
return
;
},
- path: "/plays/registration-form",
- level: "Beginner",
- tags: "JSX,useState,Objects,map",
- github: "Deepak8717",
- cover: "",
- blog: "",
- video: "",
- language: "js",
+ path: '/plays/registration-form',
+ level: 'Beginner',
+ tags: 'JSX,useState,Objects,map',
+ github: 'Deepak8717',
+ cover: '',
+ blog: '',
+ video: '',
+ language: 'js'
},
{
- id: "pl-calendar",
- name: "Calendar",
- description: "Simple calendar app to manage events",
+ id: 'pl-calendar',
+ name: 'Calendar',
+ description: 'Simple calendar app to manage events',
component: () => {
return
;
},
- path: "/plays/calendar",
- level: "Intermediate",
- tags: "JSX,Hooks,Typescript",
- github: "vincentBCP",
- cover: "",
- blog: "",
- video: "",
- language: "ts",
+ path: '/plays/calendar',
+ level: 'Intermediate',
+ tags: 'JSX,Hooks,Typescript',
+ github: 'vincentBCP',
+ cover: '',
+ blog: '',
+ video: '',
+ language: 'ts'
},
{
- id: "pl-fun-quiz",
- name: "Fun Quiz",
+ id: 'pl-fun-quiz',
+ name: 'Fun Quiz',
description:
- "Its a Fun Quiz app which lets player to choose desirable category to answer 20 unique question with 4 options and pick the correct one.",
+ 'Its a Fun Quiz app which lets player to choose desirable category to answer 20 unique question with 4 options and pick the correct one.',
component: () => {
return
;
},
- path: "/plays/fun-quiz",
- level: "Intermediate",
- tags: "QuizApp,FunQuiz,API",
- github: "Angryman18",
- cover:
- "https://cdn.pixabay.com/photo/2019/05/22/22/28/brainstorm-4222728_960_720.jpg",
- blog: "https://hashnode.com/@imsmahanta",
- video: "",
- language: "js",
+ path: '/plays/fun-quiz',
+ level: 'Intermediate',
+ tags: 'QuizApp,FunQuiz,API',
+ github: 'Angryman18',
+ cover: 'https://cdn.pixabay.com/photo/2019/05/22/22/28/brainstorm-4222728_960_720.jpg',
+ blog: 'https://hashnode.com/@imsmahanta',
+ video: '',
+ language: 'js'
},
{
- id: "pl-tic-tac-toe-game",
- name: "Tic Tac Toe Game",
- description: "This game is coded in ReactJS and VanillaCSS",
+ id: 'pl-tic-tac-toe-game',
+ name: 'Tic Tac Toe Game',
+ description: 'This game is coded in ReactJS and VanillaCSS',
component: () => {
return
;
},
- path: "/plays/tic-tac-toe-game",
- level: "Beginner",
- tags: "Hooks,JSX,Functions,ResetState,CSS",
- github: "tejinder-sharma",
- cover: "",
- blog: "",
- video: "",
- language: "js",
+ path: '/plays/tic-tac-toe-game',
+ level: 'Beginner',
+ tags: 'Hooks,JSX,Functions,ResetState,CSS',
+ github: 'tejinder-sharma',
+ cover: '',
+ blog: '',
+ video: '',
+ language: 'js'
},
{
- id: "pl-dynamic-routes",
- name: "Dynamic-Routes",
+ id: 'pl-dynamic-routes',
+ name: 'Dynamic-Routes',
description:
- "We will learn how to pass dynamic route/input in url and based on url the output on the screen changes",
+ 'We will learn how to pass dynamic route/input in url and based on url the output on the screen changes',
component: () => {
return
;
},
- path: "/plays/dynamic-routes/:menu",
- level: "Beginner",
- tags: "react-router-v6,dynamic-routing,useParam-hook",
- github: "Deepak8717",
- cover: "",
- blog: "",
- video: "",
- language: "js",
- }, //replace new play item here
+ path: '/plays/dynamic-routes/:menu',
+ level: 'Beginner',
+ tags: 'react-router-v6,dynamic-routing,useParam-hook',
+ github: 'Deepak8717',
+ cover: '',
+ blog: '',
+ video: '',
+ language: 'js'
+ } // replace new play item here
];
diff --git a/src/plays/analog-clock/AnalogClock.css b/src/plays/analog-clock/AnalogClock.css
index 59a703ad35..d807300e3b 100644
--- a/src/plays/analog-clock/AnalogClock.css
+++ b/src/plays/analog-clock/AnalogClock.css
@@ -9,11 +9,11 @@
border-radius: 50%;
position: relative;
background-color: #3d3d3d;
- box-shadow: inset 0px 6px 0px 2px #646262, -4px 4px 1px 0px #959393,
- 0px 0px 1px 2px #959393, -4px 4px 7px 1px #434343;
+ box-shadow: inset 0px 6px 0px 2px #646262, -4px 4px 1px 0px #959393, 0px 0px 1px 2px #959393,
+ -4px 4px 7px 1px #434343;
}
.clock::after {
- content: "";
+ content: '';
width: 15px;
height: 15px;
background: #fff;
diff --git a/src/plays/analog-clock/AnalogClock.jsx b/src/plays/analog-clock/AnalogClock.jsx
index 9454f597da..4fa4ea8d6d 100644
--- a/src/plays/analog-clock/AnalogClock.jsx
+++ b/src/plays/analog-clock/AnalogClock.jsx
@@ -1,9 +1,9 @@
-import { getPlayById } from "meta/play-meta-util";
-import "./AnalogClock.css";
+import { getPlayById } from 'meta/play-meta-util';
+import './AnalogClock.css';
-import PlayHeader from "common/playlists/PlayHeader";
-import { useState } from "react";
-import { useEffect } from "react";
+import PlayHeader from 'common/playlists/PlayHeader';
+import { useState } from 'react';
+import { useEffect } from 'react';
function AnalogClock(props) {
// Do not remove the below lines.
@@ -36,19 +36,19 @@ function AnalogClock(props) {
diff --git a/src/plays/calendar/Calendar.scss b/src/plays/calendar/Calendar.scss
index f5c574c686..31092ba973 100644
--- a/src/plays/calendar/Calendar.scss
+++ b/src/plays/calendar/Calendar.scss
@@ -1,13 +1,13 @@
-$calendar-play-box-shadow-dark:rgba(0,0,0,0.1);
+$calendar-play-box-shadow-dark: rgba(0, 0, 0, 0.1);
$calendar-play-box-shadow: 0px 0px 10px 5px $calendar-play-box-shadow-dark;
-$calendar-play-blue-500: #3182CE;
-$calendar-play-blue-400: #4299E1;
-$calendar-play-blue-300: #63B3ED;
+$calendar-play-blue-500: #3182ce;
+$calendar-play-blue-400: #4299e1;
+$calendar-play-blue-300: #63b3ed;
-$calendar-play-red-500: #E53E3E;
-$calendar-play-red-200: #FEB2B2;
-$calendar-play-red-100: #FED7D7;
+$calendar-play-red-500: #e53e3e;
+$calendar-play-red-200: #feb2b2;
+$calendar-play-red-100: #fed7d7;
.calendar-play {
background-color: white;
@@ -50,9 +50,9 @@ $calendar-play-red-100: #FED7D7;
button,
.calendar-play-navigation-arrow {
&:hover {
- background-color: rgba(0,0,0,0.05);
+ background-color: rgba(0, 0, 0, 0.05);
}
-
+
&:active {
background-color: darkgray;
}
@@ -113,7 +113,7 @@ $calendar-play-red-100: #FED7D7;
height: 100%;
padding-top: 120px;
z-index: 999;
- background-color: rgba(0,0,0,0.5);
+ background-color: rgba(0, 0, 0, 0.5);
.calendar-play-modal-content {
width: 500px;
@@ -128,7 +128,7 @@ $calendar-play-red-100: #FED7D7;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
-
+
span:last-of-type {
cursor: pointer;
margin-left: auto;
@@ -137,7 +137,7 @@ $calendar-play-red-100: #FED7D7;
@media (max-width: 768px) {
max-width: 90%;
- }
+ }
}
}
@@ -213,11 +213,11 @@ $calendar-play-red-100: #FED7D7;
background-color: transparent;
&:hover {
- background-color: rgba(0,0,0,0.05);
+ background-color: rgba(0, 0, 0, 0.05);
}
-
+
&:active {
- background-color: rgba(0,0,0,0.2);
+ background-color: rgba(0, 0, 0, 0.2);
}
}
@@ -255,11 +255,11 @@ $calendar-play-red-100: #FED7D7;
transition-duration: 0.3s;
&:hover {
- background-color: rgba(0,0,0,0.1);
+ background-color: rgba(0, 0, 0, 0.1);
}
&:active {
- background-color: rgba(0,0,0,0.2);
+ background-color: rgba(0, 0, 0, 0.2);
}
}
}
@@ -275,9 +275,9 @@ $calendar-play-red-100: #FED7D7;
display: block;
cursor: pointer;
position: relative;
-
+
&:hover {
- background-color: rgba(0,0,0,0.05);
+ background-color: rgba(0, 0, 0, 0.05);
}
& > span {
@@ -342,7 +342,7 @@ $calendar-play-red-100: #FED7D7;
transition-duration: 0.3s;
&:hover {
- background-color: rgba(0,0,0,0.05);
+ background-color: rgba(0, 0, 0, 0.05);
}
div {
@@ -370,4 +370,4 @@ $calendar-play-red-100: #FED7D7;
font-size: 10px;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/plays/calendar/Calendar.tsx b/src/plays/calendar/Calendar.tsx
index d2e2039467..d3a80ab355 100644
--- a/src/plays/calendar/Calendar.tsx
+++ b/src/plays/calendar/Calendar.tsx
@@ -2,14 +2,14 @@ import * as React from 'react';
import { getPlayById } from 'meta/play-meta-util';
import PlayHeader from 'common/playlists/PlayHeader';
-import CalendarGrid from './CalendarGrid'
+import CalendarGrid from './CalendarGrid';
import { ContextProvider } from './Context';
-import './Calendar.scss'
+import './Calendar.scss';
import ModalContainer from './ModalContainer';
-function Calendar(props:any) {
- // Do not remove the below lines.
+function Calendar(props: any) {
+ // Do not remove the below lines.
// The following code is to fetch the current play from the URL
const { id } = props;
const play = getPlayById(id);
@@ -31,4 +31,4 @@ function Calendar(props:any) {
);
}
-export default Calendar;
\ No newline at end of file
+export default Calendar;
diff --git a/src/plays/calendar/CalendarDayTile.tsx b/src/plays/calendar/CalendarDayTile.tsx
index d836f86229..58744b1d23 100644
--- a/src/plays/calendar/CalendarDayTile.tsx
+++ b/src/plays/calendar/CalendarDayTile.tsx
@@ -1,43 +1,32 @@
-import React, { useContext } from 'react'
-import { format } from 'date-fns'
-import CalendarEvents from './CalendarEvents'
-import CalendarEventForm from './CalendarEventForm'
-import { Context } from './Context'
+import React, { useContext } from 'react';
+import { format } from 'date-fns';
+import CalendarEvents from './CalendarEvents';
+import CalendarEventForm from './CalendarEventForm';
+import { Context } from './Context';
interface Props {
- date: Date,
- showWeek?: boolean,
- isToday?: boolean
+ date: Date;
+ showWeek?: boolean;
+ isToday?: boolean;
}
const CalendarDayTile = ({ date, showWeek, isToday }: Props) => {
- const context = useContext(Context)
- const { showModal, hideModal } = context
-
+ const context = useContext(Context);
+ const { showModal, hideModal } = context;
+
const handleClick = () => {
- showModal(
-
,
- format(date, 'ccc, MMMM dd')
- )
- }
+ showModal(
, format(date, 'ccc, MMMM dd'));
+ };
return (
-
- {showWeek && (
-
{format(date, "EEE")}
- )}
+
+ {showWeek && {format(date, 'EEE')} }
- {format(date, date.getDate() === 1 && !isToday ? "MMM d" : "d")}
+ {format(date, date.getDate() === 1 && !isToday ? 'MMM d' : 'd')}
);
-}
+};
-export default CalendarDayTile
\ No newline at end of file
+export default CalendarDayTile;
diff --git a/src/plays/calendar/CalendarEvent.tsx b/src/plays/calendar/CalendarEvent.tsx
index 2a5ed36b4f..f381e66a5c 100644
--- a/src/plays/calendar/CalendarEvent.tsx
+++ b/src/plays/calendar/CalendarEvent.tsx
@@ -1,38 +1,31 @@
-import React, { useContext } from 'react'
-import { format } from 'date-fns'
-import CalendarEventForm from './CalendarEventForm'
-import { Context } from './Context'
-import EventType from './EventType'
+import React, { useContext } from 'react';
+import { format } from 'date-fns';
+import CalendarEventForm from './CalendarEventForm';
+import { Context } from './Context';
+import EventType from './EventType';
interface Props {
- event: EventType
+ event: EventType;
}
const CalendarEvent = ({ event }: Props) => {
- const context = useContext(Context)
- const { showModal, hideModal } = context
-
+ const context = useContext(Context);
+ const { showModal, hideModal } = context;
+
const handleClick = () => {
showModal(
-
,
+
,
format(new Date(event.date), 'ccc, MMMM dd')
- )
- }
-
+ );
+ };
+
return (
-
+
{format(new Date(`1990-01-01 ${event.startTime}`), 'h:mm aaa')}
{event.title}
- )
-}
+ );
+};
-export default CalendarEvent
\ No newline at end of file
+export default CalendarEvent;
diff --git a/src/plays/calendar/CalendarEventForm.tsx b/src/plays/calendar/CalendarEventForm.tsx
index 233ee7fc6e..c7eed85d22 100644
--- a/src/plays/calendar/CalendarEventForm.tsx
+++ b/src/plays/calendar/CalendarEventForm.tsx
@@ -1,30 +1,30 @@
-import { isBefore } from 'date-fns'
-import { format } from 'date-fns/esm'
-import { isEqual } from 'lodash'
-import React, { useState, useContext, useEffect } from 'react'
-import CalendarEventInfo from './CalendarEventInfo'
-import { Context } from './Context'
-import EventType from './EventType'
+import { isBefore } from 'date-fns';
+import { format } from 'date-fns/esm';
+import { isEqual } from 'lodash';
+import React, { useState, useContext, useEffect } from 'react';
+import CalendarEventInfo from './CalendarEventInfo';
+import { Context } from './Context';
+import EventType from './EventType';
interface Props {
- date: Date,
- event?: EventType,
- onCancel: VoidFunction
+ date: Date;
+ event?: EventType;
+ onCancel: VoidFunction;
}
const CalendarEventForm = ({ date, event, onCancel }: Props) => {
- const [calendarEvent, setCalendarEvent] = useState
()
- const [data, setData] = useState()
- const [editable, setEditable] = useState(false)
- const context = useContext(Context)
- const { addEvent, updateEvent, deleteEvent } = context
+ const [calendarEvent, setCalendarEvent] = useState();
+ const [data, setData] = useState();
+ const [editable, setEditable] = useState(false);
+ const context = useContext(Context);
+ const { addEvent, updateEvent, deleteEvent } = context;
useEffect(() => {
if (event) {
- setData({...event})
- setCalendarEvent({...event})
- setEditable(false)
- return
+ setData({ ...event });
+ setCalendarEvent({ ...event });
+ setEditable(false);
+ return;
}
setData({
@@ -32,79 +32,71 @@ const CalendarEventForm = ({ date, event, onCancel }: Props) => {
title: '',
startTime: '',
endTime: ''
- })
- setEditable(true)
- }, [date, event])
+ });
+ setEditable(true);
+ }, [date, event]);
const handleSave = () => {
if (!data.title) {
- alert('Please provide title')
- return
+ alert('Please provide title');
+ return;
}
if (!data.startTime) {
- alert('Please provide start time')
- return
+ alert('Please provide start time');
+ return;
}
if (!data.endTime) {
- alert('Please provide end time')
- return
+ alert('Please provide end time');
+ return;
}
- const start = new Date(`1990-01-01 ${data.startTime}`)
- const end = new Date(`1990-01-01 ${data.endTime}`)
+ const start = new Date(`1990-01-01 ${data.startTime}`);
+ const end = new Date(`1990-01-01 ${data.endTime}`);
if (isEqual(start, end) || isBefore(end, start)) {
- alert('Invalid time values')
- return
+ alert('Invalid time values');
+ return;
}
if (event) {
- updateEvent(data)
- setCalendarEvent({...data})
- setEditable(false)
- return
+ updateEvent(data);
+ setCalendarEvent({ ...data });
+ setEditable(false);
+ return;
}
-
- addEvent(data)
- onCancel()
- }
+
+ addEvent(data);
+ onCancel();
+ };
const handleDelete = () => {
- deleteEvent(event)
- onCancel()
- }
+ deleteEvent(event);
+ onCancel();
+ };
const handleCancel = () => {
if (event) {
- setEditable(false)
- return
+ setEditable(false);
+ return;
}
- onCancel()
- }
+ onCancel();
+ };
const handleEdit = () => {
- setData({...calendarEvent})
- setEditable(true)
- }
+ setData({ ...calendarEvent });
+ setEditable(true);
+ };
- if (!data) return null
+ if (!data) return null;
if (calendarEvent && !editable) {
- return (
-
- )
+ return ;
}
return (
- ev.stopPropagation()}
- >
+
ev.stopPropagation()}>
{
name="startTime"
type="time"
value={data.startTime || ''}
- onChange={(ev) =>
- setData({ ...data, startTime: ev.target.value })
- }
+ onChange={(ev) => setData({ ...data, startTime: ev.target.value })}
/>
@@ -148,7 +138,7 @@ const CalendarEventForm = ({ date, event, onCancel }: Props) => {
- )
-}
+ );
+};
-export default CalendarEventForm
\ No newline at end of file
+export default CalendarEventForm;
diff --git a/src/plays/calendar/CalendarEventInfo.tsx b/src/plays/calendar/CalendarEventInfo.tsx
index 0301cd6a97..a449579a19 100644
--- a/src/plays/calendar/CalendarEventInfo.tsx
+++ b/src/plays/calendar/CalendarEventInfo.tsx
@@ -1,24 +1,25 @@
-import { format } from 'date-fns'
-import React from 'react'
-import EventType from './EventType'
+import { format } from 'date-fns';
+import React from 'react';
+import EventType from './EventType';
interface Props {
- event: EventType,
- onEdit: VoidFunction
+ event: EventType;
+ onEdit: VoidFunction;
}
const CalendarEventInfo = ({ event, onEdit }: Props) => {
return (
-
+
{event.title}
-
{format(new Date(`1990-01-01 ${event.startTime}`), 'h:mm a')} - {format(new Date(`1990-01-01 ${event.endTime}`), 'h:mm a')}
+
+ {format(new Date(`1990-01-01 ${event.startTime}`), 'h:mm a')} -{' '}
+ {format(new Date(`1990-01-01 ${event.endTime}`), 'h:mm a')}
+
-
- Edit
-
+ Edit
- )
-}
+ );
+};
-export default CalendarEventInfo
\ No newline at end of file
+export default CalendarEventInfo;
diff --git a/src/plays/calendar/CalendarEvents.tsx b/src/plays/calendar/CalendarEvents.tsx
index 826fa67d1c..5144a99e5e 100644
--- a/src/plays/calendar/CalendarEvents.tsx
+++ b/src/plays/calendar/CalendarEvents.tsx
@@ -1,41 +1,39 @@
-import React, { useState, useContext, useEffect } from 'react'
-import CalendarEvent from './CalendarEvent'
-import CalendarEventsMore from './CalendarEventsMore'
-import { Context } from './Context'
-import EventType from './EventType'
+import React, { useState, useContext, useEffect } from 'react';
+import CalendarEvent from './CalendarEvent';
+import CalendarEventsMore from './CalendarEventsMore';
+import { Context } from './Context';
+import EventType from './EventType';
interface Props {
- date: Date
+ date: Date;
}
-const MAX_VISIBLE_ITEMS = 3
+const MAX_VISIBLE_ITEMS = 3;
const CalendarEvents = ({ date }: Props) => {
- const [events, setEvents] = useState
([])
- const context = useContext(Context)
- const { getEvents } = context
+ const [events, setEvents] = useState([]);
+ const context = useContext(Context);
+ const { getEvents } = context;
useEffect(() => {
- setEvents(getEvents(date))
- }, [date, getEvents])
+ setEvents(getEvents(date));
+ }, [date, getEvents]);
return (
ev.stopPropagation()}>
{events
.filter((e, index) => index < MAX_VISIBLE_ITEMS)
- .map(event => (
+ .map((event) => (
))}
{events.length > MAX_VISIBLE_ITEMS && (
index >= MAX_VISIBLE_ITEMS
- )}
+ events={events.filter((e, index) => index >= MAX_VISIBLE_ITEMS)}
/>
)}
);
-}
+};
-export default CalendarEvents
\ No newline at end of file
+export default CalendarEvents;
diff --git a/src/plays/calendar/CalendarEventsMore.tsx b/src/plays/calendar/CalendarEventsMore.tsx
index f92dbb78ab..9dd547a080 100644
--- a/src/plays/calendar/CalendarEventsMore.tsx
+++ b/src/plays/calendar/CalendarEventsMore.tsx
@@ -1,11 +1,11 @@
-import React from 'react'
-import { format } from 'date-fns'
-import CalendarEvent from './CalendarEvent'
-import EventType from './EventType'
+import React from 'react';
+import { format } from 'date-fns';
+import CalendarEvent from './CalendarEvent';
+import EventType from './EventType';
interface Props {
- date: Date,
- events: EventType[]
+ date: Date;
+ events: EventType[];
}
const CalendarEventsMore = ({ date, events }: Props) => {
@@ -14,17 +14,17 @@ const CalendarEventsMore = ({ date, events }: Props) => {
{events.length} more
- {format(date, "ccc")}
- {format(date, "dd")}
+ {format(date, 'ccc')}
+ {format(date, 'dd')}
- {events.map(event => (
+ {events.map((event) => (
))}
);
-}
+};
-export default CalendarEventsMore
\ No newline at end of file
+export default CalendarEventsMore;
diff --git a/src/plays/calendar/CalendarGrid.tsx b/src/plays/calendar/CalendarGrid.tsx
index 5acfab9195..99f9a9ee06 100644
--- a/src/plays/calendar/CalendarGrid.tsx
+++ b/src/plays/calendar/CalendarGrid.tsx
@@ -1,21 +1,21 @@
-import React, { useState } from 'react'
-import CalendarNavigation from './CalendarNavigation'
-import CalendarDayTile from './CalendarDayTile'
-import { endOfMonth, format, startOfMonth, startOfWeek } from 'date-fns'
-import { addDays, endOfWeek } from 'date-fns/esm'
+import React, { useState } from 'react';
+import CalendarNavigation from './CalendarNavigation';
+import CalendarDayTile from './CalendarDayTile';
+import { endOfMonth, format, startOfMonth, startOfWeek } from 'date-fns';
+import { addDays, endOfWeek } from 'date-fns/esm';
-const WEEK_STARTS_ON = 0 // Sunday
+const WEEK_STARTS_ON = 0; // Sunday
const CalendarGrid = () => {
- const [currentDate, setCurrentDate] = useState(new Date())
+ const [currentDate, setCurrentDate] = useState(new Date());
const generateTiles = () => {
- const startDate = startOfWeek(startOfMonth(currentDate), { weekStartsOn: WEEK_STARTS_ON })
- const endDate = endOfWeek(endOfMonth(currentDate), { weekStartsOn: WEEK_STARTS_ON })
+ const startDate = startOfWeek(startOfMonth(currentDate), { weekStartsOn: WEEK_STARTS_ON });
+ const endDate = endOfWeek(endOfMonth(currentDate), { weekStartsOn: WEEK_STARTS_ON });
- let curDate = startDate
+ let curDate = startDate;
- const tiles: React.ReactNode[] = []
+ const tiles: React.ReactNode[] = [];
do {
tiles.push(
@@ -23,34 +23,24 @@ const CalendarGrid = () => {
key={format(curDate, 'yyyy-MM-dd')}
date={curDate}
showWeek={tiles.length < 7}
- isToday={format(new Date(), "yyyy-MM-dd") === format(curDate, "yyyy-MM-dd")}
+ isToday={format(new Date(), 'yyyy-MM-dd') === format(curDate, 'yyyy-MM-dd')}
/>
- )
+ );
- curDate = addDays(curDate, 1)
- } while(format(curDate, 'yyyy-MM-dd') !== format(endDate, 'yyyy-MM-dd'))
+ curDate = addDays(curDate, 1);
+ } while (format(curDate, 'yyyy-MM-dd') !== format(endDate, 'yyyy-MM-dd'));
- tiles.push(
-
- )
+ tiles.push( );
- return tiles
- }
+ return tiles;
+ };
return (
-
-
setCurrentDate(date)}
- />
-
- { generateTiles() }
-
+
+
setCurrentDate(date)} />
+ {generateTiles()}
- )
-}
+ );
+};
-export default CalendarGrid
\ No newline at end of file
+export default CalendarGrid;
diff --git a/src/plays/calendar/CalendarNavigation.tsx b/src/plays/calendar/CalendarNavigation.tsx
index 06a60dea44..7d9a1dcfe6 100644
--- a/src/plays/calendar/CalendarNavigation.tsx
+++ b/src/plays/calendar/CalendarNavigation.tsx
@@ -1,9 +1,9 @@
-import { addMonths, format } from 'date-fns'
-import React from 'react'
+import { addMonths, format } from 'date-fns';
+import React from 'react';
interface Props {
- currentDate: Date,
- onDateChange: (date: Date) => void
+ currentDate: Date;
+ onDateChange: (date: Date) => void;
}
const CalendarNavigation = ({ currentDate, onDateChange }: Props) => {
@@ -15,35 +15,27 @@ const CalendarNavigation = ({ currentDate, onDateChange }: Props) => {
*/
if (direction === 0) {
- onDateChange(new Date())
- return
+ onDateChange(new Date());
+ return;
}
- onDateChange(addMonths(currentDate, direction))
- }
+ onDateChange(addMonths(currentDate, direction));
+ };
return (
-
-
navigateTo(0)}>
- Today
-
-
navigateTo(-1)}
- >
+
+ navigateTo(0)}>Today
+ navigateTo(-1)}>
<
- navigateTo(1)}
- >
+ navigateTo(1)}>
>
-
+
{format(currentDate, 'MMMM yyyy')}
- )
-}
+ );
+};
-export default CalendarNavigation
\ No newline at end of file
+export default CalendarNavigation;
diff --git a/src/plays/calendar/Context.tsx b/src/plays/calendar/Context.tsx
index d765771600..3c0beea9dd 100644
--- a/src/plays/calendar/Context.tsx
+++ b/src/plays/calendar/Context.tsx
@@ -1,8 +1,8 @@
-import { format } from "date-fns";
-import React, { useCallback, useState } from "react";
-import { orderBy } from 'lodash'
-import { getDummyEvents } from "./utils";
-import EventType from "./EventType";
+import { format } from 'date-fns';
+import React, { useCallback, useState } from 'react';
+import { orderBy } from 'lodash';
+import { getDummyEvents } from './utils';
+import EventType from './EventType';
export const Context = React.createContext({
modalTitle: '',
@@ -13,58 +13,64 @@ export const Context = React.createContext({
deleteEvent: (event: EventType) => {},
showModal: (content: React.ReactNode, title?: '') => {},
hideModal: () => {}
-})
+});
export const ContextProvider = ({ children }: any) => {
- const [events, setEvents] = useState(getDummyEvents())
- const [modalTitle, setModalTitle] = useState('')
- const [modalContent, setModalContent] = useState(undefined)
+ const [events, setEvents] = useState(getDummyEvents());
+ const [modalTitle, setModalTitle] = useState('');
+ const [modalContent, setModalContent] = useState(undefined);
- const getEvents = useCallback((date: Date) => {
- return orderBy(events.filter(e => e.date === format(date, 'yyyy-MM-dd')), ['startTime'])
- }, [events])
+ const getEvents = useCallback(
+ (date: Date) => {
+ return orderBy(
+ events.filter((e) => e.date === format(date, 'yyyy-MM-dd')),
+ ['startTime']
+ );
+ },
+ [events]
+ );
const addEvent = (event: EventType) => {
- event.id = (new Date()).getTime().toString()
- setEvents(oldValue => ([...oldValue, event]))
- }
+ event.id = new Date().getTime().toString();
+ setEvents((oldValue) => [...oldValue, event]);
+ };
const updateEvent = (event: EventType) => {
- setEvents(oldValue => {
- const newEvents = [...oldValue]
- const index = newEvents.findIndex(e => e.id === event.id)
+ setEvents((oldValue) => {
+ const newEvents = [...oldValue];
+ const index = newEvents.findIndex((e) => e.id === event.id);
- if (index === -1) return newEvents
+ if (index === -1) return newEvents;
- newEvents[index] = event
+ newEvents[index] = event;
- return newEvents
- })
- }
+ return newEvents;
+ });
+ };
const deleteEvent = (event: EventType) => {
- setEvents(oldValue => {
- const newEvents = [...oldValue]
- const index = newEvents.findIndex(e => e.id === event.id)
+ setEvents((oldValue) => {
+ const newEvents = [...oldValue];
+ const index = newEvents.findIndex((e) => e.id === event.id);
- if (index === -1) return newEvents
+ if (index === -1) return newEvents;
- newEvents.splice(index, 1)
+ newEvents.splice(index, 1);
- return newEvents
- })
- }
+ return newEvents;
+ });
+ };
const showModal = (content: React.ReactNode, title?: '') => {
- setModalTitle(title || '')
- setModalContent(content)
- }
-
+ setModalTitle(title || '');
+ setModalContent(content);
+ };
+
const hideModal = () => {
- setModalTitle('')
- setModalContent(undefined)
- }
-
+ setModalTitle('');
+ setModalContent(undefined);
+ };
+
return (
{
>
{children}
- )
-}
-
+ );
+};
diff --git a/src/plays/calendar/EventType.ts b/src/plays/calendar/EventType.ts
index 9c81d2e4ba..8b3ddbaea0 100644
--- a/src/plays/calendar/EventType.ts
+++ b/src/plays/calendar/EventType.ts
@@ -1,9 +1,9 @@
type EventType = {
- id: string,
- date: string,
- title: string,
- startTime: string,
- endTime: string
-}
+ id: string;
+ date: string;
+ title: string;
+ startTime: string;
+ endTime: string;
+};
-export default EventType
\ No newline at end of file
+export default EventType;
diff --git a/src/plays/calendar/ModalContainer.tsx b/src/plays/calendar/ModalContainer.tsx
index e8e3b033ea..ede509c0bc 100644
--- a/src/plays/calendar/ModalContainer.tsx
+++ b/src/plays/calendar/ModalContainer.tsx
@@ -1,28 +1,23 @@
-import React, { useContext } from 'react'
-import { Context } from './Context'
+import React, { useContext } from 'react';
+import { Context } from './Context';
const ModalContainer = () => {
- const context = useContext(Context)
- const { modalContent, modalTitle, hideModal } = context
-
- if (!modalContent) return null
+ const context = useContext(Context);
+ const { modalContent, modalTitle, hideModal } = context;
+
+ if (!modalContent) return null;
return (
-
ev.stopPropagation()}
- >
+
ev.stopPropagation()}>
- {Boolean(modalTitle) && (
- {modalTitle}
- )}
+ {Boolean(modalTitle) && {modalTitle} }
✕
{modalContent}
);
-}
+};
-export default ModalContainer
\ No newline at end of file
+export default ModalContainer;
diff --git a/src/plays/calendar/Readme.md b/src/plays/calendar/Readme.md
index 97561fba67..37170a50df 100644
--- a/src/plays/calendar/Readme.md
+++ b/src/plays/calendar/Readme.md
@@ -9,4 +9,4 @@ A simple calendar to add, update, and delete events.
- How to use `Context` to manage application state.
- How to use `date-fns` to manipulate date using its cool functions.
- How to pass `props` from parent component to child component.
-- How to slice your app into smaller components for re-usability and easier management.
\ No newline at end of file
+- How to slice your app into smaller components for re-usability and easier management.
diff --git a/src/plays/calendar/utils.tsx b/src/plays/calendar/utils.tsx
index 26c12f8bae..27c3f483f9 100644
--- a/src/plays/calendar/utils.tsx
+++ b/src/plays/calendar/utils.tsx
@@ -6,9 +6,9 @@ import {
getWeekOfMonth,
isWeekend,
startOfMonth,
- startOfWeek,
-} from "date-fns";
-import EventType from "./EventType";
+ startOfWeek
+} from 'date-fns';
+import EventType from './EventType';
export const getDummyEvents = (): EventType[] => {
// create fake events
@@ -25,20 +25,20 @@ export const getDummyEvents = (): EventType[] => {
if (isWeekend(date)) return;
events.push({
- id: format(date, "yyyy-MM-dd"),
- date: format(date, "yyyy-MM-dd"),
- title: "Daily stand up",
- startTime: "09:30",
- endTime: "10:00",
+ id: format(date, 'yyyy-MM-dd'),
+ date: format(date, 'yyyy-MM-dd'),
+ title: 'Daily stand up',
+ startTime: '09:30',
+ endTime: '10:00'
});
if (getWeekOfMonth(date) % 2 === 0 && date.getDay() === 2) {
events.push({
- id: `${format(date, "yyyy-MM-dd")}-key`,
- date: format(date, "yyyy-MM-dd"),
- title: "Sprint Planning",
- startTime: "15:00",
- endTime: "17:00",
+ id: `${format(date, 'yyyy-MM-dd')}-key`,
+ date: format(date, 'yyyy-MM-dd'),
+ title: 'Sprint Planning',
+ startTime: '15:00',
+ endTime: '17:00'
});
}
};
@@ -46,39 +46,39 @@ export const getDummyEvents = (): EventType[] => {
do {
addEvent(curDate);
curDate = addDays(curDate, 1);
- } while (format(curDate, "yyyy-MM-dd") !== format(endDate, "yyyy-MM-dd"));
+ } while (format(curDate, 'yyyy-MM-dd') !== format(endDate, 'yyyy-MM-dd'));
addEvent(curDate);
events = events.concat([
{
- id: "1",
- date: format(new Date(), "yyyy-MM") + "-13",
- title: "Lorem ipsum dolor sit amet",
- startTime: "07:30",
- endTime: "08:30",
+ id: '1',
+ date: format(new Date(), 'yyyy-MM') + '-13',
+ title: 'Lorem ipsum dolor sit amet',
+ startTime: '07:30',
+ endTime: '08:30'
},
{
- id: "2",
- date: format(new Date(), "yyyy-MM") + "-13",
- title: "Lorem ipsum dolor sit amet",
- startTime: "10:00",
- endTime: "11:00",
+ id: '2',
+ date: format(new Date(), 'yyyy-MM') + '-13',
+ title: 'Lorem ipsum dolor sit amet',
+ startTime: '10:00',
+ endTime: '11:00'
},
{
- id: "3",
- date: format(new Date(), "yyyy-MM") + "-13",
- title: "Lorem ipsum dolor sit amet",
- startTime: "12:30",
- endTime: "13:30",
+ id: '3',
+ date: format(new Date(), 'yyyy-MM') + '-13',
+ title: 'Lorem ipsum dolor sit amet',
+ startTime: '12:30',
+ endTime: '13:30'
},
{
- id: "4",
- date: format(new Date(), "yyyy-MM") + "-13",
- title: "Lorem ipsum dolor sit amet",
- startTime: "14:00",
- endTime: "14:30",
- },
+ id: '4',
+ date: format(new Date(), 'yyyy-MM') + '-13',
+ title: 'Lorem ipsum dolor sit amet',
+ startTime: '14:00',
+ endTime: '14:30'
+ }
]);
return events;
diff --git a/src/plays/clock/CurrentTimer.jsx b/src/plays/clock/CurrentTimer.jsx
index bbf3bfc15b..7efb8fb409 100644
--- a/src/plays/clock/CurrentTimer.jsx
+++ b/src/plays/clock/CurrentTimer.jsx
@@ -1,9 +1,8 @@
-
import PlayHeader from 'common/playlists/PlayHeader';
import { useEffect, useState } from 'react';
import { getPlayById } from 'meta/play-meta-util';
-import "./clock.css";
+import './clock.css';
const CurrentTimer = (props) => {
// The following code is to fetch the current play from the URL
@@ -17,11 +16,11 @@ const CurrentTimer = (props) => {
const interval = setInterval(() => {
setDate(new Date());
}, 1000);
-
+
return () => clearInterval(interval);
}, []);
- return(
+ return (
<>
@@ -36,6 +35,6 @@ const CurrentTimer = (props) => {
>
);
-}
+};
-export default CurrentTimer;
\ No newline at end of file
+export default CurrentTimer;
diff --git a/src/plays/clock/clock.css b/src/plays/clock/clock.css
index 077264a57b..0980180d0a 100644
--- a/src/plays/clock/clock.css
+++ b/src/plays/clock/clock.css
@@ -1,8 +1,8 @@
.counter .value {
- background: linear-gradient(0deg, #b9740b,rgb(173, 134, 16));
+ background: linear-gradient(0deg, #b9740b, rgb(173, 134, 16));
color: #ddd;
width: 280px;
- padding: .5rem;
+ padding: 0.5rem;
letter-spacing: 1px;
font-weight: bolder;
font-size: 2.5rem;
@@ -14,8 +14,8 @@
justify-content: center;
}
-@media (min-width: 550px){
- .counter .value {
+@media (min-width: 550px) {
+ .counter .value {
width: 450px;
padding: 1rem;
letter-spacing: 2px;
@@ -26,7 +26,6 @@
}
}
-.counter .value span{
+.counter .value span {
font-family: monospace;
-
}
diff --git a/src/plays/counter/Counter.jsx b/src/plays/counter/Counter.jsx
index 7b07eeba62..ea9d7c67b5 100644
--- a/src/plays/counter/Counter.jsx
+++ b/src/plays/counter/Counter.jsx
@@ -1,28 +1,31 @@
-import { useState } from "react";
+import { useState } from 'react';
const Counter = (props) => {
+ const [times, setTimes] = useState(0);
- const [times, setTimes] = useState(0);
+ function increase() {
+ setTimes((prev) => {
+ if (prev === props.times) {
+ return 0;
+ } else {
+ return prev + 1;
+ }
+ });
+ }
- function increase() {
- setTimes((prev) => {
- if (prev === props.times) {
- return 0;
- } else {
- return prev + 1;
- }
- })
- }
+ function reset() {
+ setTimes(0);
+ }
- function reset(){
- setTimes(0);
- }
-
- return (
-
- {times}
- Reset
-
- )
-}
-export default Counter;
\ No newline at end of file
+ return (
+
+
+ {times}
+
+
+ Reset
+
+
+ );
+};
+export default Counter;
diff --git a/src/plays/counter/CounterApp.jsx b/src/plays/counter/CounterApp.jsx
index 029f484e7f..89d3eab351 100644
--- a/src/plays/counter/CounterApp.jsx
+++ b/src/plays/counter/CounterApp.jsx
@@ -1,21 +1,21 @@
-import PlayHeader from "common/playlists/PlayHeader";
+import PlayHeader from 'common/playlists/PlayHeader';
import { useState } from 'react';
import { getPlayById } from 'meta/play-meta-util';
-import Counter from "./Counter";
-import "./counter.css";
+import Counter from './Counter';
+import './counter.css';
function CounterApp(props) {
// The following code is to fetch the current play from the URL
const { id } = props;
const play = getPlayById(id);
-
- const [input, setInput] = useState("");
+
+ const [input, setInput] = useState('');
const [times, setTimes] = useState(33);
function register() {
let no_times = Number(input);
console.log(no_times);
setTimes(no_times);
- setInput("");
+ setInput('');
}
return (
<>
@@ -26,9 +26,8 @@ function CounterApp(props) {
Counter
A simple counter
- Specify the limit and click the circle below to increment the
- value until the limit has been reached. After that it will reset
- to zero.
+ Specify the limit and click the circle below to increment the value until the limit
+ has been reached. After that it will reset to zero.
{
// The following code is to fetch the current play from the URL
@@ -12,9 +12,7 @@ const CdTimerComp = (props) => {
const NOW_IN_MS = new Date().getTime();
const dateTimeAfterThreeDays = NOW_IN_MS + THREE_DAYS_IN_MS;
- const [targetDate, setTargetDate] = useState(
- new Date(dateTimeAfterThreeDays)
- );
+ const [targetDate, setTargetDate] = useState(new Date(dateTimeAfterThreeDays));
const handleChange = (event) => {
event.preventDefault();
@@ -32,9 +30,7 @@ const CdTimerComp = (props) => {
-
Select a date and time in the past, present, and future
- to see how the countdown timer will display.
+
+ Select a date and time in the past, present, and future to see how the countdown timer
+ will display.
+
diff --git a/src/plays/date-time-counter/CountDownTimer.jsx b/src/plays/date-time-counter/CountDownTimer.jsx
index f3eb96a056..4ce2ee68ee 100644
--- a/src/plays/date-time-counter/CountDownTimer.jsx
+++ b/src/plays/date-time-counter/CountDownTimer.jsx
@@ -1,6 +1,6 @@
-import "./datetime.css";
-import DateTimeDisplay from "./DateTimeDisplay";
-import useCountDown from "./hooks/useCountDown";
+import './datetime.css';
+import DateTimeDisplay from './DateTimeDisplay';
+import useCountDown from './hooks/useCountDown';
const ExpiredNotice = () => {
return (
@@ -20,13 +20,13 @@ const ShowCounter = ({ days, hours, minutes, seconds }) => {
rel="noopener noreferrer"
className="countdown-link"
>
-
+
:
-
+
:
-
+
:
-
+
);
@@ -38,14 +38,7 @@ const CountDownTimer = ({ targetDate }) => {
if (days + hours + minutes + seconds <= 0) {
return
;
} else {
- return (
-
- );
+ return
;
}
};
diff --git a/src/plays/date-time-counter/DateTimeDisplay.jsx b/src/plays/date-time-counter/DateTimeDisplay.jsx
index 1312c65ff4..74e965b903 100644
--- a/src/plays/date-time-counter/DateTimeDisplay.jsx
+++ b/src/plays/date-time-counter/DateTimeDisplay.jsx
@@ -1,4 +1,4 @@
-const DateTimeDisplay = ({value, type, isDanger}) => {
+const DateTimeDisplay = ({ value, type, isDanger }) => {
return (
{value}
diff --git a/src/plays/date-time-counter/datetime.css b/src/plays/date-time-counter/datetime.css
index 2469e48b07..911faf071f 100644
--- a/src/plays/date-time-counter/datetime.css
+++ b/src/plays/date-time-counter/datetime.css
@@ -4,7 +4,7 @@
align-content: center;
justify-content: center;
align-items: center;
- margin: 0.5rem
+ margin: 0.5rem;
}
.countdown-container > form {
@@ -74,7 +74,7 @@
.show-counter .countdown > span {
text-transform: uppercase;
- font-size: 1.50rem;
+ font-size: 1.5rem;
line-height: 2rem;
}
@@ -84,7 +84,7 @@
line-height: 1rem;
}
- .show-counter .countdown-link {
+ .show-counter .countdown-link {
font-size: 1.5rem;
}
-}
\ No newline at end of file
+}
diff --git a/src/plays/date-time-counter/hooks/useCountDown.js b/src/plays/date-time-counter/hooks/useCountDown.js
index f47d8a8609..c4af1be436 100644
--- a/src/plays/date-time-counter/hooks/useCountDown.js
+++ b/src/plays/date-time-counter/hooks/useCountDown.js
@@ -1,13 +1,9 @@
-
-import { useEffect, useState } from "react";
-
+import { useEffect, useState } from 'react';
const useCountDown = (targetDate) => {
const countDownDate = new Date(targetDate).getTime();
- const [countDown, setCountDown] = useState(
- countDownDate - new Date().getTime()
- );
+ const [countDown, setCountDown] = useState(countDownDate - new Date().getTime());
useEffect(() => {
const interval = setInterval(() => {
@@ -23,13 +19,11 @@ const useCountDown = (targetDate) => {
const getReturnValues = (countDown) => {
// calculate time left
const days = Math.floor(countDown / (1000 * 60 * 60 * 24));
- const hours = Math.floor(
- (countDown % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
- );
+ const hours = Math.floor((countDown % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((countDown % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((countDown % (1000 * 60)) / 1000);
return [days, hours, minutes, seconds];
};
-export default useCountDown;
\ No newline at end of file
+export default useCountDown;
diff --git a/src/plays/dynamic-routes/Data.js b/src/plays/dynamic-routes/Data.js
index 40b85b09f1..e8d3ea320e 100644
--- a/src/plays/dynamic-routes/Data.js
+++ b/src/plays/dynamic-routes/Data.js
@@ -1,45 +1,42 @@
const data = [
{
- name: "Omelette",
- mealtype: "breakfast",
+ name: 'Omelette',
+ mealtype: 'breakfast',
image:
- "https://www.indianhealthyrecipes.com/wp-content/uploads/2021/06/cheese-omelette-mozarella-omelette.jpg",
+ 'https://www.indianhealthyrecipes.com/wp-content/uploads/2021/06/cheese-omelette-mozarella-omelette.jpg'
},
{
- name: "Stir Fried Tofu with Rice",
- mealtype: "lunch",
- image:
- "https://www.myweekendkitchen.in/wp-content/uploads/2018/10/tofu_stir_fry_tofu_pulao.jpg",
+ name: 'Stir Fried Tofu with Rice',
+ mealtype: 'lunch',
+ image: 'https://www.myweekendkitchen.in/wp-content/uploads/2018/10/tofu_stir_fry_tofu_pulao.jpg'
},
{
- name: "Roasted Cauliflower",
- mealtype: "dinner",
+ name: 'Roasted Cauliflower',
+ mealtype: 'dinner',
image:
- "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSilH81ideZ64mi8r1FO-75OHrJt93wgIw55w&usqp=CAU",
+ 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSilH81ideZ64mi8r1FO-75OHrJt93wgIw55w&usqp=CAU'
},
{
- name: "toast butter",
- mealtype: "breakfast",
- image:
- "https://thumbs.dreamstime.com/b/toast-jam-black-background-5588967.jpg",
+ name: 'toast butter',
+ mealtype: 'breakfast',
+ image: 'https://thumbs.dreamstime.com/b/toast-jam-black-background-5588967.jpg'
},
{
- name: "Baked Oatmeal",
- mealtype: "breakfast",
- image:
- "https://fitfoodiefinds.com/wp-content/uploads/2015/10/classic-oatmeal.jpg",
+ name: 'Baked Oatmeal',
+ mealtype: 'breakfast',
+ image: 'https://fitfoodiefinds.com/wp-content/uploads/2015/10/classic-oatmeal.jpg'
},
{
- name: "Tawa Pulao",
- mealtype: "lunch",
- image: "https://www.masala.tv/wp-content/uploads/2017/06/1-16.jpg",
+ name: 'Tawa Pulao',
+ mealtype: 'lunch',
+ image: 'https://www.masala.tv/wp-content/uploads/2017/06/1-16.jpg'
},
{
- name: "channa masala",
- mealtype: "dinner",
+ name: 'channa masala',
+ mealtype: 'dinner',
image:
- "https://www.indianveggiedelight.com/wp-content/uploads/2019/05/chana-masala-instant-pot-feature-image.jpg",
- },
+ 'https://www.indianveggiedelight.com/wp-content/uploads/2019/05/chana-masala-instant-pot-feature-image.jpg'
+ }
];
export default data;
diff --git a/src/plays/dynamic-routes/DynamicRoutes.jsx b/src/plays/dynamic-routes/DynamicRoutes.jsx
index ad08a513a6..a9dc610ef6 100644
--- a/src/plays/dynamic-routes/DynamicRoutes.jsx
+++ b/src/plays/dynamic-routes/DynamicRoutes.jsx
@@ -1,10 +1,10 @@
-import { getPlayById } from "meta/play-meta-util";
-import PlayHeader from "common/playlists/PlayHeader";
-import { useParams } from "react-router-dom";
-import Navbar from "./Navbar";
-import "./dynamicRoutes.css";
-import data from "./Data";
-import { useState } from "react";
+import { getPlayById } from 'meta/play-meta-util';
+import PlayHeader from 'common/playlists/PlayHeader';
+import { useParams } from 'react-router-dom';
+import Navbar from './Navbar';
+import './dynamicRoutes.css';
+import data from './Data';
+import { useState } from 'react';
function DynamicRoutes(props) {
// Do not remove the below lines.
@@ -15,7 +15,7 @@ function DynamicRoutes(props) {
// Your Code Start below.
let { menu } = useParams(); // return the parameter of url
const [activeMenu, setActiveMenu] = useState(
- menu === ":menu" ? "breakfast" : menu
+ menu === ':menu' ? 'breakfast' : menu
//we take url input and set to our activeMenu state so we can fetch recipes based on active menu
//if its first laod then url parameter is ":menu" so we change the active menu to "breakfast" as default category
);
@@ -55,7 +55,7 @@ function DynamicRoutes(props) {
- {activeRecipes.length <= 0 ? <>Sorry, check the url> : ""}
+ {activeRecipes.length <= 0 ? <>Sorry, check the url> : ''}
{activeRecipes.map((recipe, index) => {
//render the recipes based on active menu
@@ -64,14 +64,8 @@ function DynamicRoutes(props) {
{recipe.name}
-
-
- {recipe.mealtype}
-
+
+
{recipe.mealtype}
);
})}
diff --git a/src/plays/dynamic-routes/Navbar.jsx b/src/plays/dynamic-routes/Navbar.jsx
index 939b9314b3..020e103194 100644
--- a/src/plays/dynamic-routes/Navbar.jsx
+++ b/src/plays/dynamic-routes/Navbar.jsx
@@ -1,5 +1,5 @@
-import React from "react";
-import { NavLink } from "react-router-dom";
+import React from 'react';
+import { NavLink } from 'react-router-dom';
function Navbar(props) {
const [mealTypes, activeMealHandler, activeMenu] = Object.values(props);
@@ -10,7 +10,7 @@ function Navbar(props) {
activeMealHandler(mealtype)}
>
{mealtype}
diff --git a/src/plays/expanding-cards/Expanding-Card-Images.jsx b/src/plays/expanding-cards/Expanding-Card-Images.jsx
index 4218bd2548..0926ca6aa6 100644
--- a/src/plays/expanding-cards/Expanding-Card-Images.jsx
+++ b/src/plays/expanding-cards/Expanding-Card-Images.jsx
@@ -1,31 +1,31 @@
-import titleOne from "./images/photo-1511028931355-082bb4781053.jpg";
-import titleTwo from "./images/photo-1559511331-7649f05944e3.jpg";
-import titleThree from "./images/photo-1608822246990-be7bc0d9b2d7.jpg";
-import titleFour from "./images/photo-1611773951628-0d5b4c2507fb.jpg";
-import titleFive from "./images/photo-1567117439290-a8b5ef5bab89.jpg";
+import titleOne from './images/photo-1511028931355-082bb4781053.jpg';
+import titleTwo from './images/photo-1559511331-7649f05944e3.jpg';
+import titleThree from './images/photo-1608822246990-be7bc0d9b2d7.jpg';
+import titleFour from './images/photo-1611773951628-0d5b4c2507fb.jpg';
+import titleFive from './images/photo-1567117439290-a8b5ef5bab89.jpg';
const data = [
{
- title: "Title One",
- url: titleOne,
+ title: 'Title One',
+ url: titleOne
},
{
- title: "Title Two",
- url: titleTwo,
+ title: 'Title Two',
+ url: titleTwo
},
{
- title: "Title Three",
- url: titleThree,
+ title: 'Title Three',
+ url: titleThree
},
{
- title: "Title Four",
- url: titleFour,
+ title: 'Title Four',
+ url: titleFour
},
{
- title: "Title Five",
- url: titleFive,
- },
+ title: 'Title Five',
+ url: titleFive
+ }
];
export default data;
diff --git a/src/plays/expanding-cards/ExpandingCards.jsx b/src/plays/expanding-cards/ExpandingCards.jsx
index ac4cc7c0e8..22d317c60c 100644
--- a/src/plays/expanding-cards/ExpandingCards.jsx
+++ b/src/plays/expanding-cards/ExpandingCards.jsx
@@ -1,9 +1,9 @@
-import { getPlayById } from "meta/play-meta-util";
+import { getPlayById } from 'meta/play-meta-util';
-import PlayHeader from "common/playlists/PlayHeader";
-import "./ExpandingCards.css";
-import { useState } from "react";
-import data from "./Expanding-Card-Images";
+import PlayHeader from 'common/playlists/PlayHeader';
+import './ExpandingCards.css';
+import { useState } from 'react';
+import data from './Expanding-Card-Images';
function ExpandingCards(props) {
// Do not remove the below lines.
@@ -33,19 +33,11 @@ function ExpandingCards(props) {
return (
toggle(i)}
>
{item.title}
-
+
);
})}
diff --git a/src/plays/fun-quiz/EndScreen.jsx b/src/plays/fun-quiz/EndScreen.jsx
index f8fdaf908c..1fd28d020a 100644
--- a/src/plays/fun-quiz/EndScreen.jsx
+++ b/src/plays/fun-quiz/EndScreen.jsx
@@ -1,8 +1,8 @@
// vendors
-import { Fragment, useState } from "react";
+import { Fragment, useState } from 'react';
//css
-import "./FrontScreen.scss";
+import './FrontScreen.scss';
const EndScreen = ({ quizSummary, redirectHome }) => {
const { correctAnswers, cheatedAnswers, wrongAnswers, result } = quizSummary;
@@ -11,25 +11,21 @@ const EndScreen = ({ quizSummary, redirectHome }) => {
const ShowCurrentQuestionDetails = ({ currentQuestion }) => {
if (!Object.keys(currentQuestion).length) return false;
return (
-
-
Question: {currentQuestion?.qNo}
+
+
Question: {currentQuestion?.qNo}
Ans : ${currentQuestion?.correct_answer}
`,
+ __html: `
Ans : ${currentQuestion?.correct_answer}
`
}}
/>
Your Answer: ${currentQuestion?.your_answer}`,
+ __html: `Your Answer : ${currentQuestion?.your_answer}`
}}
/>
@@ -38,43 +34,37 @@ const EndScreen = ({ quizSummary, redirectHome }) => {
return (
-
-
+
+
Quiz Summary
{!cheatedAnswers ? (
-
Congratulations!
+
Congratulations!
) : (
-
You Cheated!
+
You Cheated!
)}
-
+
{correctAnswers}
Correct Answers
- {!!cheatedAnswers && (
- ({cheatedAnswers} cheated)
- )}
+ {!!cheatedAnswers && ({cheatedAnswers} cheated) }
{wrongAnswers}
Wrong Answers
-
+
Home
-
+
{result.map((item, index) => {
return (
- setCurrentQuestion({ ...item, qNo: index + 1 })
- }
+ className={item.correct ? 'circle-correct' : 'circle-incorrect'}
+ onClick={() => setCurrentQuestion({ ...item, qNo: index + 1 })}
>
{index + 1}
diff --git a/src/plays/fun-quiz/FrontScreen.jsx b/src/plays/fun-quiz/FrontScreen.jsx
index 6f9d091502..bff1cf0321 100644
--- a/src/plays/fun-quiz/FrontScreen.jsx
+++ b/src/plays/fun-quiz/FrontScreen.jsx
@@ -1,14 +1,14 @@
-import { useState } from "react";
+import { useState } from 'react';
// css
-import "./FrontScreen.scss";
-import options from './options.json'
+import './FrontScreen.scss';
+import options from './options.json';
-const CATEGORY_SELECTION = "CATEGORY_SELECTION";
-const RULES_DISPLAY = "RULES_DISPLAY";
+const CATEGORY_SELECTION = 'CATEGORY_SELECTION';
+const RULES_DISPLAY = 'RULES_DISPLAY';
const QuizSelectionScreen = ({ getSelectedCategory }) => {
- const [selectedOption, setSelectedOption] = useState("");
+ const [selectedOption, setSelectedOption] = useState('');
const [view, setView] = useState(CATEGORY_SELECTION);
const letMeInHandler = () => {
@@ -21,33 +21,26 @@ const QuizSelectionScreen = ({ getSelectedCategory }) => {
<>
1. There will be 20 Unique Questions.
2. Every Question will have 4 multiple choices to chooose.
+
3. Among 4 options only one option will be correct answer of the Question.
- 3. Among 4 options only one option will be correct answer of the
- Question.
+ 4. Answer selection isn't mandatory. You can skip choosing any answer and it will be
+ counted as incorrect answer.
- 4. Answer selection isn't mandatory. You can skip choosing any answer
- and it will be counted as incorrect answer.
+ 5. After answer confirmation you cannot go back to previous question or donot refresh the
+ page otherwise you will lose you progress.
- 5. After answer confirmation you cannot go back to previous question
- or donot refresh the page otherwise you will lose you progress.
-
-
- 6. You will be given 30 seconds to answer each question and timeup is
- considered as an incorrect answer and next question will be displayed.
-
-
- 7. After selecting an option you can click on selected option to unselect it.
+ 6. You will be given 30 seconds to answer each question and timeup is considered as an
+ incorrect answer and next question will be displayed.
+
7. After selecting an option you can click on selected option to unselect it.
8. You can use cheats to cheat the answer.
-
-
getSelectedCategory(selectedOption)}>
- Yes, Lets Start!
-
+
+ getSelectedCategory(selectedOption)}>Yes, Lets Start!
- setView(CATEGORY_SELECTION)}>
+ setView(CATEGORY_SELECTION)}>
« Back
@@ -59,25 +52,23 @@ const QuizSelectionScreen = ({ getSelectedCategory }) => {
return (
<>
- The Quiz app requires to have a specefic category in order to start
- with. Select one of the below options in which you have expertise in.
+ The Quiz app requires to have a specefic category in order to start with. Select one of
+ the below options in which you have expertise in.
-
+
{options.map((option) => {
return (
setSelectedOption(option.id)}
- className={`single-selection ${
- selectedOption === option.id && "active-selected"
- }`}
+ className={`single-selection ${selectedOption === option.id && 'active-selected'}`}
>
{option.name}
);
})}
-
+
Let me in
>
@@ -87,9 +78,9 @@ const QuizSelectionScreen = ({ getSelectedCategory }) => {
const renderView = view === CATEGORY_SELECTION;
return (
-
-
-
{!renderView ? "Quiz Rules" : "Quiz App"}
+
+
+
{!renderView ? 'Quiz Rules' : 'Quiz App'}
{renderView && }
{!renderView && }
diff --git a/src/plays/fun-quiz/FrontScreen.scss b/src/plays/fun-quiz/FrontScreen.scss
index 8a5c3dd1bc..bdcb69e449 100644
--- a/src/plays/fun-quiz/FrontScreen.scss
+++ b/src/plays/fun-quiz/FrontScreen.scss
@@ -1,4 +1,3 @@
-
@import './variables';
.fun-quiz-main {
@@ -73,7 +72,7 @@
margin-bottom: 40px;
&::after {
- content: "";
+ content: '';
display: block;
width: 100%;
margin-top: 5px;
@@ -177,7 +176,6 @@
place-items: center;
cursor: pointer;
}
-
}
.display-question {
@@ -217,7 +215,6 @@
color: $quiz-app-deep-blue;
cursor: pointer;
}
-
}
@media screen and (max-width: 600px) {
@@ -226,4 +223,3 @@
}
}
}
-
diff --git a/src/plays/fun-quiz/FunQuiz.jsx b/src/plays/fun-quiz/FunQuiz.jsx
index fd2467f71b..81e36fadf6 100644
--- a/src/plays/fun-quiz/FunQuiz.jsx
+++ b/src/plays/fun-quiz/FunQuiz.jsx
@@ -1,13 +1,13 @@
-import { getPlayById } from "meta/play-meta-util";
-import { useState } from "react";
+import { getPlayById } from 'meta/play-meta-util';
+import { useState } from 'react';
-import PlayHeader from "common/playlists/PlayHeader";
-import QuizScreen from "./QuizScreen";
-import QuizSelectionScreen from "./FrontScreen";
-import EndScreen from "./EndScreen";
+import PlayHeader from 'common/playlists/PlayHeader';
+import QuizScreen from './QuizScreen';
+import QuizSelectionScreen from './FrontScreen';
+import EndScreen from './EndScreen';
// css
-import './FunQuiz.scss'
+import './FunQuiz.scss';
function FunQuiz(props) {
// Do not remove the below lines.
@@ -16,7 +16,7 @@ function FunQuiz(props) {
const play = getPlayById(id);
// Your Code Start below.
- const [category, setCategory] = useState("");
+ const [category, setCategory] = useState('');
const [quizCompleted, setQuizCompleted] = useState(false);
const [quizSummary, setQuizSummary] = useState({});
@@ -29,14 +29,14 @@ function FunQuiz(props) {
const getQuizSummary = (result = []) => {
if (result.length === 20) {
setQuizCompleted(true);
- const correctAnswers = calculateBooleanValues(result, "correct");
- const cheatedAnswers = calculateBooleanValues(result, "cheated");
+ const correctAnswers = calculateBooleanValues(result, 'correct');
+ const cheatedAnswers = calculateBooleanValues(result, 'cheated');
const wrongAnswers = 20 - correctAnswers;
return setQuizSummary({
correctAnswers,
cheatedAnswers,
wrongAnswers,
- result,
+ result
});
}
return;
@@ -44,26 +44,22 @@ function FunQuiz(props) {
const redirectHome = () => {
setQuizCompleted(false);
- setCategory("");
+ setCategory('');
};
if (maintenance) return
This Page is under Maintenance ;
return (
<>
-
+
-
+
{/* Your Code Starts Here */}
- {!category && !quizCompleted && (
-
- )}
+ {!category && !quizCompleted && }
{category && !quizCompleted && (
)}
- {quizCompleted && (
-
- )}
+ {quizCompleted && }
{/* Your Code Ends Here */}
diff --git a/src/plays/fun-quiz/FunQuiz.scss b/src/plays/fun-quiz/FunQuiz.scss
index 49cfd474cc..2bf873cf6a 100644
--- a/src/plays/fun-quiz/FunQuiz.scss
+++ b/src/plays/fun-quiz/FunQuiz.scss
@@ -1,6 +1,4 @@
-
-
.fun-quiz {
- width: 100%;
- overflow: hidden;
-}
\ No newline at end of file
+ width: 100%;
+ overflow: hidden;
+}
diff --git a/src/plays/fun-quiz/QuizScreen.jsx b/src/plays/fun-quiz/QuizScreen.jsx
index 0289ab5c72..0328e06fdd 100644
--- a/src/plays/fun-quiz/QuizScreen.jsx
+++ b/src/plays/fun-quiz/QuizScreen.jsx
@@ -1,14 +1,14 @@
-import { useEffect, useState, useCallback } from "react";
+import { useEffect, useState, useCallback } from 'react';
-import "./QuizScreen.scss";
+import './QuizScreen.scss';
// assets
-import confuseIcon from "./confuse.gif";
+import confuseIcon from './confuse.gif';
const answerState = {
- answer: "",
+ answer: '',
cheat: false,
- cheated: false,
+ cheated: false
};
function QuizScreen({ category, getQuizSummary }) {
@@ -18,7 +18,7 @@ function QuizScreen({ category, getQuizSummary }) {
const [questionNumber, setQuestionNumber] = useState(0);
const [timer, setTimer] = useState(30);
- const formatCategoryText = category === "all" ? "" : `&category=${category}`;
+ const formatCategoryText = category === 'all' ? '' : `&category=${category}`;
const currentQuestion = quizData?.data?.[questionNumber];
useEffect(() => {
@@ -30,15 +30,11 @@ function QuizScreen({ category, getQuizSummary }) {
);
const { results } = await response.json();
// if there is no data coming from api but status 200 is returned then we want to end up in catch block
- if (!results.length) throw new Error();
+ if (!results.length) throw new Error();
const createOptions = results.map((result) => {
const { incorrect_answers, correct_answer } = result;
const options = [...incorrect_answers];
- options?.splice(
- Math.floor(Math.random() * (options.length + 1)),
- 0,
- correct_answer
- );
+ options?.splice(Math.floor(Math.random() * (options.length + 1)), 0, correct_answer);
return { ...result, options };
});
return setQuizData({ data: createOptions, loading: false, error: false });
@@ -50,18 +46,14 @@ function QuizScreen({ category, getQuizSummary }) {
// select and deselect the answer
const handleAnswerClick = (val) => (e) => {
- setAnswer(
- !!answer.answer && answer.answer === val
- ? answerState
- : { ...answer, answer: val }
- );
+ setAnswer(!!answer.answer && answer.answer === val ? answerState : { ...answer, answer: val });
};
// handling the confirm button click
const handleConfirm = useCallback(
(skipped = false) => {
const updateResult = () => {
- const manageSkippedAnswer = !skipped ? answer.answer : "";
+ const manageSkippedAnswer = !skipped ? answer.answer : '';
setResult((pre) => [
...pre,
{
@@ -69,8 +61,8 @@ function QuizScreen({ category, getQuizSummary }) {
correct: currentQuestion.correct_answer === manageSkippedAnswer,
your_answer: manageSkippedAnswer,
correct_answer: currentQuestion.correct_answer,
- cheated: answer.cheated,
- },
+ cheated: answer.cheated
+ }
]);
};
@@ -83,8 +75,8 @@ function QuizScreen({ category, getQuizSummary }) {
correct: currentQuestion.correct_answer === answer.answer,
your_answer: answer.answer,
correct_answer: currentQuestion.correct_answer,
- cheated: answer.cheated,
- },
+ cheated: answer.cheated
+ }
]);
}
updateResult();
@@ -102,7 +94,7 @@ function QuizScreen({ category, getQuizSummary }) {
}, 1000);
return () => clearInterval(setTiming);
} else if (!!quizData.data.length) {
- setAnswer('')
+ setAnswer('');
handleConfirm(true);
}
}, [timer, handleConfirm, quizData.data]);
@@ -111,7 +103,7 @@ function QuizScreen({ category, getQuizSummary }) {
setAnswer({
cheat: true,
cheated: true,
- answer: currentQuestion.correct_answer,
+ answer: currentQuestion.correct_answer
});
const showCheat = setTimeout(() => {
setAnswer({ ...answerState, cheated: true });
@@ -120,38 +112,34 @@ function QuizScreen({ category, getQuizSummary }) {
};
const itemClassDisplayController = (option) => {
- if (answer.cheat && answer.answer === option)
- return "option-button blinking-options";
- if (answer.answer === option && !answer.cheat)
- return "option-button active-option";
- return "option-button";
+ if (answer.cheat && answer.answer === option) return 'option-button blinking-options';
+ if (answer.answer === option && !answer.cheat) return 'option-button active-option';
+ return 'option-button';
};
// if there is an no data we display this message.
if (quizData?.error) {
- return (
We Apologize! Something Error Occured!
)
+ return
We Apologize! Something Error Occured!
;
}
return (
-
+
{quizData.loading && (
-
-
+
+
)}
{!quizData.loading && (
-
-
{timer}
-
Question: {questionNumber + 1}
-
-
+
+
{timer}
+
Question: {questionNumber + 1}
+
+
-
+
{currentQuestion?.options?.map((option, index) => {
return (
-
+
-
-
handleConfirm(true)}>
+
+
handleConfirm(true)}>
Skip
{answer.answer && !answer.cheat && (
-
handleConfirm()} className='confirm-button'>
- {questionNumber === 19 ? "Submit" : "Confirm"}
+ handleConfirm()} className="confirm-button">
+ {questionNumber === 19 ? 'Submit' : 'Confirm'}
)}
{!answer.answer && (
-
+
I want to Cheat
)}
diff --git a/src/plays/fun-quiz/QuizScreen.scss b/src/plays/fun-quiz/QuizScreen.scss
index 2970cc4225..bf404449d9 100644
--- a/src/plays/fun-quiz/QuizScreen.scss
+++ b/src/plays/fun-quiz/QuizScreen.scss
@@ -1,6 +1,5 @@
@import './variables';
-
.fun-quiz {
&-screen {
margin-top: 4rem;
@@ -21,7 +20,6 @@
display: flex;
justify-content: center;
align-items: center;
-
}
.timer {
@@ -31,7 +29,7 @@
aspect-ratio: 1/1;
display: grid;
place-items: center;
- font-family: "Russo One", sans-serif;
+ font-family: 'Russo One', sans-serif;
font-size: 3rem;
color: $quiz-app-black-color;
margin-bottom: 2rem;
@@ -75,7 +73,6 @@
border-radius: 20px;
border: 1px solid $quiz-app-border-color;
-
h1 {
margin: 0.5rem 2rem;
color: $quiz-app-text-color;
@@ -106,7 +103,7 @@
min-height: 60px;
font-size: 1rem;
padding: 0.5rem 1.5rem;
- background-color: rgba(234,227,227,1);
+ background-color: rgba(234, 227, 227, 1);
border-radius: 40px;
transition: 100ms ease-in-out;
text-align: left;
@@ -196,8 +193,6 @@
justify-content: space-between;
align-items: center;
-
-
.link {
outline: none;
border: none;
diff --git a/src/plays/fun-quiz/Readme.md b/src/plays/fun-quiz/Readme.md
index 18e406382f..aa6f517916 100644
--- a/src/plays/fun-quiz/Readme.md
+++ b/src/plays/fun-quiz/Readme.md
@@ -2,7 +2,6 @@
The `Fun Quiz` is a very fun play build with ReactJS & moreover its a quiz game where you will be asked 20 unique question and player have to choose one answer out of 4 options.
-
There is some key things we can also learn from projects are
- Handling complex logics in ReactJS.
diff --git a/src/plays/fun-quiz/_variables.scss b/src/plays/fun-quiz/_variables.scss
index 820dcc28eb..6ef6894ede 100644
--- a/src/plays/fun-quiz/_variables.scss
+++ b/src/plays/fun-quiz/_variables.scss
@@ -1,5 +1,4 @@
-@import url("https://fonts.googleapis.com/css2?family=Russo+One&display=swap"); // russo one
-
+@import url('https://fonts.googleapis.com/css2?family=Russo+One&display=swap'); // russo one
$quiz-app-green-color2: rgba(0, 154, 49, 1);
$quiz-app-text-color: rgba(32, 73, 105, 1);
@@ -19,9 +18,9 @@ $quiz-app-transparent-black: rgba(0, 0, 0, 0.1);
$quiz-app-deep-blue: #0a66c2;
$quiz-app-deep-blue2: #16437e;
-$quiz-app-light-red: rgba(242,49,127,1);
-$quiz-app-light-red2: rgba(246,0,60,1);
+$quiz-app-light-red: rgba(242, 49, 127, 1);
+$quiz-app-light-red2: rgba(246, 0, 60, 1);
$quiz-app-raw-green: green;
$quiz-app-raw-red: red;
-$quiz-app-raw-black: black;
\ No newline at end of file
+$quiz-app-raw-black: black;
diff --git a/src/plays/index.js b/src/plays/index.js
index a938ad840c..7a70dac244 100644
--- a/src/plays/index.js
+++ b/src/plays/index.js
@@ -1,26 +1,26 @@
-export { default as PageNotFound } from "common/404/PageNotFound";
-export { default as Home } from "common/home/Home";
-export { default as CurrentTimer } from "plays/clock/CurrentTimer";
-export { default as CdTimerComp } from "plays/date-time-counter/CdTimerComp";
-export { default as BasicTree } from "plays/org-tree/BasicTree";
-export { default as MovieContainer } from "plays/movies/MovieContainer";
-export { default as WhyReact } from "plays/why-react/WhyReact";
-export { default as CounterApp } from "plays/counter/CounterApp";
-export { default as States } from "plays/states/States";
-export { default as SocialCard } from "plays/social-card/SocialCard";
-export { default as RandomMemeGenerator } from "plays/random-meme-generator/RandomMemeGenerator";
-export { default as Keeper } from "plays/keeper/Keeper";
-export { default as ReactTodoApp } from "plays/react-todo-app/ReactTodoApp";
-export { default as QuoteGenerator } from "plays/quote-generator/QuoteGenerator";
-export { default as ExpandingCards } from "plays/expanding-cards/ExpandingCards";
-export { default as AnalogClock } from "plays/analog-clock/AnalogClock";
-export { default as PasswordGenerator } from "plays/password-generator/PasswordGenerator";
-export { default as WhyTypescript } from "plays/why-typescript/WhyTypescript";
-export { default as NetlifyCardGame } from "plays/memory-game/NetlifyCardGame";
-export { default as RegistrationForm } from "plays/registration-form/RegistrationForm";
-export { default as Calendar } from "plays/calendar/Calendar";
-export { default as FunQuiz } from "plays/fun-quiz/FunQuiz";
-export { default as TicTacToeGame } from "plays/tic-tac-toe-game/TicTacToeGame";
-export { default as DynamicRoutes } from "plays/dynamic-routes/DynamicRoutes";
-export { default as Quizeo } from "plays/quizeo/src/Quizeo";
-//add export here
+export { default as PageNotFound } from 'common/404/PageNotFound';
+export { default as Home } from 'common/home/Home';
+export { default as CurrentTimer } from 'plays/clock/CurrentTimer';
+export { default as CdTimerComp } from 'plays/date-time-counter/CdTimerComp';
+export { default as BasicTree } from 'plays/org-tree/BasicTree';
+export { default as MovieContainer } from 'plays/movies/MovieContainer';
+export { default as WhyReact } from 'plays/why-react/WhyReact';
+export { default as CounterApp } from 'plays/counter/CounterApp';
+export { default as States } from 'plays/states/States';
+export { default as SocialCard } from 'plays/social-card/SocialCard';
+export { default as RandomMemeGenerator } from 'plays/random-meme-generator/RandomMemeGenerator';
+export { default as Keeper } from 'plays/keeper/Keeper';
+export { default as ReactTodoApp } from 'plays/react-todo-app/ReactTodoApp';
+export { default as QuoteGenerator } from 'plays/quote-generator/QuoteGenerator';
+export { default as ExpandingCards } from 'plays/expanding-cards/ExpandingCards';
+export { default as AnalogClock } from 'plays/analog-clock/AnalogClock';
+export { default as PasswordGenerator } from 'plays/password-generator/PasswordGenerator';
+export { default as WhyTypescript } from 'plays/why-typescript/WhyTypescript';
+export { default as NetlifyCardGame } from 'plays/memory-game/NetlifyCardGame';
+export { default as RegistrationForm } from 'plays/registration-form/RegistrationForm';
+export { default as Calendar } from 'plays/calendar/Calendar';
+export { default as FunQuiz } from 'plays/fun-quiz/FunQuiz';
+export { default as TicTacToeGame } from 'plays/tic-tac-toe-game/TicTacToeGame';
+export { default as DynamicRoutes } from 'plays/dynamic-routes/DynamicRoutes';
+export { default as Quizeo } from 'plays/quizeo/src/Quizeo';
+// add export here
diff --git a/src/plays/keeper/CreateArea.jsx b/src/plays/keeper/CreateArea.jsx
index e6cd70ed5a..5488af1e3d 100644
--- a/src/plays/keeper/CreateArea.jsx
+++ b/src/plays/keeper/CreateArea.jsx
@@ -1,14 +1,14 @@
-import React, { useState } from "react";
+import React, { useState } from 'react';
import { FaPlusCircle } from 'react-icons/fa';
function CreateArea(props) {
const [note, setNote] = useState({
- title: "",
- content: ""
+ title: '',
+ content: ''
});
function handleChange(event) {
const { name, value } = event.target;
- setNote(prevNote => {
+ setNote((prevNote) => {
return {
...prevNote,
[name]: value
@@ -18,15 +18,15 @@ function CreateArea(props) {
function submitNote(event) {
props.onAdd(note);
setNote({
- title: "",
- content: ""
+ title: '',
+ content: ''
});
event.preventDefault();
}
return (
);
diff --git a/src/plays/keeper/Header.jsx b/src/plays/keeper/Header.jsx
index 0fe0a07d7e..ddeac6526e 100644
--- a/src/plays/keeper/Header.jsx
+++ b/src/plays/keeper/Header.jsx
@@ -1,10 +1,15 @@
-import React from "react";
+import React from 'react';
import { FaMedapps } from 'react-icons/fa';
function Header() {
- return <>
-
+ return (
+ <>
+
+
+ {' '}
+ KEEPER{' '}
+
+
>
+ );
}
-export default Header;
\ No newline at end of file
+export default Header;
diff --git a/src/plays/keeper/Hooks/useLocalStorage.js b/src/plays/keeper/Hooks/useLocalStorage.js
index da842b6fb8..13f85d3aab 100644
--- a/src/plays/keeper/Hooks/useLocalStorage.js
+++ b/src/plays/keeper/Hooks/useLocalStorage.js
@@ -1,4 +1,4 @@
-import { useState } from "react";
+import { useState } from 'react';
function useLocalStorage(key, initialValue) {
// State to store our value
@@ -19,8 +19,7 @@ function useLocalStorage(key, initialValue) {
const setValue = (value) => {
try {
// Allow value to be a function so we have same API as useState
- const valueToStore =
- value instanceof Function ? value(storedValue) : value;
+ const valueToStore = value instanceof Function ? value(storedValue) : value;
// Save state
setStoredValue(valueToStore);
// Save to local storage
@@ -32,4 +31,4 @@ function useLocalStorage(key, initialValue) {
};
return [storedValue, setValue];
}
-export default useLocalStorage;
\ No newline at end of file
+export default useLocalStorage;
diff --git a/src/plays/keeper/Keeper.css b/src/plays/keeper/Keeper.css
index 47f4ec4dc1..73dbceecda 100644
--- a/src/plays/keeper/Keeper.css
+++ b/src/plays/keeper/Keeper.css
@@ -85,37 +85,37 @@
/* Media Query */
-@media(max-width: 514px) {
+@media (max-width: 514px) {
.create-note {
width: 21rem;
}
}
-@media(max-width: 358px) {
+@media (max-width: 358px) {
.create-note {
width: 13rem;
}
}
-@media(max-width: 304px) {
+@media (max-width: 304px) {
.create-note {
width: 12rem;
}
- .note{
- width:205px;
+ .note {
+ width: 205px;
}
}
-@media(max-width: 269px) {
+@media (max-width: 269px) {
.create-note {
width: 11rem;
}
- .note{
- width:182px;
+ .note {
+ width: 182px;
}
}
-@media(max-width: 269px) {
+@media (max-width: 269px) {
.create-note {
width: 9rem;
}
- .note{
- width:170px;
+ .note {
+ width: 170px;
}
}
diff --git a/src/plays/keeper/Keeper.jsx b/src/plays/keeper/Keeper.jsx
index b63b58203d..9a6069cf49 100644
--- a/src/plays/keeper/Keeper.jsx
+++ b/src/plays/keeper/Keeper.jsx
@@ -1,22 +1,22 @@
import { getPlayById } from 'meta/play-meta-util';
import PlayHeader from 'common/playlists/PlayHeader';
-import './Keeper.css'
+import './Keeper.css';
import Header from './Header';
import CreateArea from './CreateArea';
import Note from './Notes';
import useLocalStorage from './Hooks/useLocalStorage';
function Keeper(props) {
- // Do not remove the below lines.
+ // Do not remove the below lines.
// The following code is to fetch the current play from the URL
const { id } = props;
const play = getPlayById(id);
//code starts here
- const [notes, setNotes] = useLocalStorage("notes", [
+ const [notes, setNotes] = useLocalStorage('notes', [
{
id: 0,
- title: "Write Your Title",
- content: "And, content here. :)"
+ title: 'Write Your Title',
+ content: 'And, content here. :)'
}
]); //notes array
//adding notes
@@ -27,11 +27,11 @@ function Keeper(props) {
}
//deleting notes
function deleteNote(id) {
- setNotes(prevNotes => {
+ setNotes((prevNotes) => {
return prevNotes.filter((noteItem, index) => {
return index !== id;
- })
- })
+ });
+ });
}
return (
<>
@@ -42,13 +42,15 @@ function Keeper(props) {
{notes.map((noteItem, index) => {
- return
+ return (
+
+ );
})}
@@ -56,4 +58,4 @@ function Keeper(props) {
>
);
}
-export default Keeper;
\ No newline at end of file
+export default Keeper;
diff --git a/src/plays/keeper/Notes.jsx b/src/plays/keeper/Notes.jsx
index 6dc383f76d..cd537837d9 100644
--- a/src/plays/keeper/Notes.jsx
+++ b/src/plays/keeper/Notes.jsx
@@ -1,14 +1,18 @@
import { FaTrashAlt } from 'react-icons/fa';
function Note(props) {
- function handleClick() {
- props.onDelete(props.id);
- }
- return <>
-
-
{props.title}
-
{props.content}
-
-
+ function handleClick() {
+ props.onDelete(props.id);
+ }
+ return (
+ <>
+
+
{props.title}
+
{props.content}
+
+
+
+
>
+ );
}
-export default Note;
\ No newline at end of file
+export default Note;
diff --git a/src/plays/keeper/README.md b/src/plays/keeper/README.md
index e7cd6a1cc2..888732a167 100644
--- a/src/plays/keeper/README.md
+++ b/src/plays/keeper/README.md
@@ -1,8 +1,9 @@
The `Keeper` demonstrates the following concepts in React:
+
1. State & State Management in functional components.
2. useState Hook
3. useEffect Hook
-3. React DOM
-4. JSX
+4. React DOM
+5. JSX
This play has two input fields, one for `Title`, and another one for `Description`. After writing your notes you can click on the `add` button, and your notes will be added and will be save too until you `delete` them.
diff --git a/src/plays/memory-game/NetlifyCardGame.jsx b/src/plays/memory-game/NetlifyCardGame.jsx
index 7cd08d2e50..b0326a6a60 100644
--- a/src/plays/memory-game/NetlifyCardGame.jsx
+++ b/src/plays/memory-game/NetlifyCardGame.jsx
@@ -1,29 +1,29 @@
-import { getPlayById } from "meta/play-meta-util";
+import { getPlayById } from 'meta/play-meta-util';
-import PlayHeader from "common/playlists/PlayHeader";
-import { useState, useEffect, useRef } from "react";
+import PlayHeader from 'common/playlists/PlayHeader';
+import { useState, useEffect, useRef } from 'react';
// css
-import "./NetlifyCardGame.scss";
+import './NetlifyCardGame.scss';
// components
-import Modal from "./modal";
+import Modal from './modal';
-import q1 from "./icons/q1.png";
-import q2 from "./icons/q2.png";
-import q3 from "./icons/q3.png";
-import q4 from "./icons/q4.png";
-import q5 from "./icons/q5.png";
-import q6 from "./icons/q6.png";
-import q7 from "./icons/q7.png";
-import q8 from "./icons/q8.png";
+import q1 from './icons/q1.png';
+import q2 from './icons/q2.png';
+import q3 from './icons/q3.png';
+import q4 from './icons/q4.png';
+import q5 from './icons/q5.png';
+import q6 from './icons/q6.png';
+import q7 from './icons/q7.png';
+import q8 from './icons/q8.png';
const imgArr = [q1, q2, q3, q4, q5, q6, q7, q8];
const initialState = {
moves: 0,
time: 0,
- elapsedTime: 0,
+ elapsedTime: 0
};
function NetlifyCardGame(props) {
@@ -67,7 +67,7 @@ function NetlifyCardGame(props) {
return shuffledArray.map((item, index) => ({
img: item,
id: index,
- show: false,
+ show: false
}));
};
@@ -99,9 +99,7 @@ function NetlifyCardGame(props) {
const boxClickHandler =
({ id, img }) =>
() => {
- const currentlyShownItem = duplicateImgArray.current.find(
- (i) => i.show === true
- ); // if false means no active item
+ const currentlyShownItem = duplicateImgArray.current.find((i) => i.show === true); // if false means no active item
if (currentlyShownItem?.id === id) return; // if same item clicked again
if (matchedItems.some((i) => i.img === img)) return;
@@ -109,16 +107,14 @@ function NetlifyCardGame(props) {
setBoardStats({
...boardStats,
time: boardStats?.moves === 0 ? new Date() : boardStats.time,
- moves: boardStats.moves + 1,
+ moves: boardStats.moves + 1
});
// clicked item image pair
const imageItems = newImgArray.filter((i) => i.img === img);
if (currentlyShownItem) {
// checking if clicked item img is same as active item img
- const findPair = imageItems.find(
- (i) => i.img === currentlyShownItem.img
- );
+ const findPair = imageItems.find((i) => i.img === currentlyShownItem.img);
if (!findPair) {
// if not same, then find the item from the main array
const findClickedItem = imageItems.find((i) => i.id === id);
@@ -132,16 +128,10 @@ function NetlifyCardGame(props) {
} else {
// if user clicks the same imgage of the active image then we find which one is clicked specefically by id this time
disableClick.current = true; // disable the click
- const otherPair = imageItems.find(
- (i) => i.id !== currentlyShownItem.id
- ); // searching for same image other object
+ const otherPair = imageItems.find((i) => i.id !== currentlyShownItem.id); // searching for same image other object
otherPair.show = true; // have to render it
- const updatedItemList = newImgArray.map((i) =>
- i.id === otherPair.id ? otherPair : i
- ); // updated array maintaining the index
- duplicateImgArray.current = updatedItemList.filter(
- (i) => i.show === false
- ); // updating the duplicate array
+ const updatedItemList = newImgArray.map((i) => (i.id === otherPair.id ? otherPair : i)); // updated array maintaining the index
+ duplicateImgArray.current = updatedItemList.filter((i) => i.show === false); // updating the duplicate array
setNewImgArray(updatedItemList); // updating the main object
setMatchedItems([...matchedItems, findPair]);
disableClick.current = false;
@@ -187,57 +177,47 @@ function NetlifyCardGame(props) {
const calculateMerit = () => {
const time = Math.floor(boardStats?.elapsedTime);
if (time <= 40) {
- return "Execelent";
+ return 'Execelent';
} else if (time > 40 && time <= 60) {
- return "Good";
+ return 'Good';
} else {
- return "Average";
+ return 'Average';
}
};
return (
<>
-
+
-
+
{/* Your Code Starts Here */}
-
+
How to Play?
-
-
+
+
{newImgArray.map((item, idx) => {
return (
-
-
+
+
);
})}
-
+
Moves: {boardStats.moves}
-
- Elapsed Time: {Math.floor(boardStats.elapsedTime)} Seconds
-
+
Elapsed Time: {Math.floor(boardStats.elapsedTime)} Seconds
{matchedItems.length === 8 && (
-
+
Congrats! {calculateMerit()} Performance
)}
-
+
Reset
diff --git a/src/plays/memory-game/NetlifyCardGame.scss b/src/plays/memory-game/NetlifyCardGame.scss
index 823fb39fdd..06f766d363 100644
--- a/src/plays/memory-game/NetlifyCardGame.scss
+++ b/src/plays/memory-game/NetlifyCardGame.scss
@@ -1,10 +1,10 @@
$memory-game-box-width: 50%;
-$memory-game-single-item-img: url("./question.png");
+$memory-game-single-item-img: url('./question.png');
$memory-game-single-item-bg: rgb(241, 239, 239);
$memory-game-single-item-hover: rgba(59, 154, 156, 1);
-$memory-game-single-item-hover-bg: url("./question1.png");
+$memory-game-single-item-hover-bg: url('./question1.png');
.memory-game .container {
display: flex;
diff --git a/src/plays/memory-game/Readme.md b/src/plays/memory-game/Readme.md
index 31b4c65d1e..4c5aa55b00 100644
--- a/src/plays/memory-game/Readme.md
+++ b/src/plays/memory-game/Readme.md
@@ -2,7 +2,6 @@
The `Memory Game` is a very fun play build with ReactJS & moreover its a memory test game which is actually to uncover cards and memorize them for next move.
-
There is some key things we can also learn from projects are
- Handling complex logics in ReactJS.
diff --git a/src/plays/memory-game/modal.js b/src/plays/memory-game/modal.js
index 87f991dec6..ffa1b50841 100644
--- a/src/plays/memory-game/modal.js
+++ b/src/plays/memory-game/modal.js
@@ -1,35 +1,35 @@
-import { Fragment, useState, useEffect } from "react";
+import { Fragment, useState, useEffect } from 'react';
// css
-import "./modal.scss";
+import './modal.scss';
// assets
-import s1 from "./guideimages/s1.png";
-import s2 from "./guideimages/s2.png";
-import s3 from "./guideimages/s3.png";
-import s4 from "./guideimages/s4.png";
-import close from './close.png'
+import s1 from './guideimages/s1.png';
+import s2 from './guideimages/s2.png';
+import s3 from './guideimages/s3.png';
+import s4 from './guideimages/s4.png';
+import close from './close.png';
-const Modal = ({ showModal, toggle }) => {
+function Modal({ showModal, toggle }) {
const [currState, setCurrentState] = useState(0);
const structuringData = [
{
- info: "Click any of the box to unvail the the hidden image.",
- image: s1,
+ info: 'Click any of the box to unvail the the hidden image.',
+ image: s1
},
{
- info: "Now Click another box to unvail another image. if its not the same the both of them will be hidden again.",
- image: s2,
+ info: 'Now Click another box to unvail another image. if its not the same the both of them will be hidden again.',
+ image: s2
},
{
- info: "If the both images are matched they will stay visible and you want to uncover other images and also find their pair",
- image: s3,
+ info: 'If the both images are matched they will stay visible and you want to uncover other images and also find their pair',
+ image: s3
},
{
info: "Lastly images position will be different on every 'reset' button click any you can keep continue memorise the glimpse of the images and find their pair. ",
- image: s4,
- },
+ image: s4
+ }
];
useEffect(() => {
@@ -43,28 +43,24 @@ const Modal = ({ showModal, toggle }) => {
if (!showModal) return false;
return (
-
-
-
-
-
How to Play!
+ <>
+
+
+
+
{'How to Play!'}
{structuringData[currState].info}
-
-
- {currState > 0 ?
Prev :
}
+
+
+ {currState > 0 ?
{'Prev'} :
}
- {currState === 3 ? "Done" : "Next"}
+ {currState === 3 ? 'Done' : 'Next'}
-
-
+
+ >
);
-};
+}
export default Modal;
diff --git a/src/plays/movies/Movie.jsx b/src/plays/movies/Movie.jsx
index 63d484f340..08781ad507 100644
--- a/src/plays/movies/Movie.jsx
+++ b/src/plays/movies/Movie.jsx
@@ -1,19 +1,15 @@
-
-const Movie = ({movie}) => {
- const {
- title,
- year,
- poster,
- rating,
- director} = movie;
+const Movie = ({ movie }) => {
+ const { title, year, poster, rating, director } = movie;
return (
- {title} by {director} was released on {year}
+
+ {title} by {director} was released on {year}
+
Rating: {rating}
);
-}
+};
-export default Movie;
\ No newline at end of file
+export default Movie;
diff --git a/src/plays/movies/MovieContainer.jsx b/src/plays/movies/MovieContainer.jsx
index a6292ab597..75ef9889be 100644
--- a/src/plays/movies/MovieContainer.jsx
+++ b/src/plays/movies/MovieContainer.jsx
@@ -1,11 +1,11 @@
-import PlayHeader from "common/playlists/PlayHeader";
-import { useEffect, useState } from "react";
-import { getPlayById } from "meta/play-meta-util";
-import Movie from "./Movie";
+import PlayHeader from 'common/playlists/PlayHeader';
+import { useEffect, useState } from 'react';
+import { getPlayById } from 'meta/play-meta-util';
+import Movie from './Movie';
-import useFetch from "common/hooks/useFetch";
+import useFetch from 'common/hooks/useFetch';
-import "./movies.css";
+import './movies.css';
const MovieContainer = (props) => {
// The following code is to fetch the current play from the URL
@@ -15,7 +15,7 @@ const MovieContainer = (props) => {
const MOVIE_API_URI = 'https://json-faker.onrender.com/movies';
const { data, loading, error } = useFetch(MOVIE_API_URI);
- console.log("data", data);
+ console.log('data', data);
const [movies, setMovies] = useState([]);
@@ -31,12 +31,13 @@ const MovieContainer = (props) => {
{loading &&
Loading...
}
{error &&
Error: {error.message}
}
- {movies && (
- {movies.map((movie) => (
-
- ))}
- )
- }
+ {movies && (
+
+ {movies.map((movie) => (
+
+ ))}
+
+ )}
diff --git a/src/plays/movies/movies.css b/src/plays/movies/movies.css
index 3cc0461e85..5d2ae5a0f2 100644
--- a/src/plays/movies/movies.css
+++ b/src/plays/movies/movies.css
@@ -31,7 +31,5 @@ li {
}
.movie img {
- align-self: center;
+ align-self: center;
}
-
-
diff --git a/src/plays/org-tree/BasicTree.jsx b/src/plays/org-tree/BasicTree.jsx
index f24ad67d8b..7110765b94 100644
--- a/src/plays/org-tree/BasicTree.jsx
+++ b/src/plays/org-tree/BasicTree.jsx
@@ -1,10 +1,10 @@
-import PlayHeader from "common/playlists/PlayHeader";
-import { getPlayById } from "meta/play-meta-util";
-import { org } from "./org";
-import React, { Fragment } from "react";
-import { Tree, TreeNode } from "react-organizational-chart";
+import PlayHeader from 'common/playlists/PlayHeader';
+import { getPlayById } from 'meta/play-meta-util';
+import { org } from './org';
+import React, { Fragment } from 'react';
+import { Tree, TreeNode } from 'react-organizational-chart';
-import "./basic-tree.css";
+import './basic-tree.css';
const Card = (props) => {
return (
@@ -24,7 +24,7 @@ const BasicTree = (props) => {
// The following code is to fetch the current play from the URL
const { id } = props;
const play = getPlayById(id);
-
+
return (
<>
@@ -33,22 +33,22 @@ const BasicTree = (props) => {
Castro - Organization Tree
- It is a basic organization tree shows the relationship between the
- employee's roles. The tree is a hierarchical data structure. The
- children of each node are shown in the below of the node.
+ It is a basic organization tree shows the relationship between the employee's roles.
+ The tree is a hierarchical data structure. The children of each node are shown in the
+ below of the node.
- The tree structure is created using the
- {' '}
-
- React Organizational Chart
- library. Please check the org.js file for the data.
+ The tree structure is created using the{' '}
+
+ React Organizational Chart
+ {' '}
+ library. Please check the org.js file for the data.
-
{org.name} }>
+
{org.name} }>
diff --git a/src/plays/org-tree/basic-tree.css b/src/plays/org-tree/basic-tree.css
index 07ffbe4eb8..22f4e62e15 100644
--- a/src/plays/org-tree/basic-tree.css
+++ b/src/plays/org-tree/basic-tree.css
@@ -16,4 +16,4 @@
.org-tree .node {
font-size: 0.5rem;
}
-}
\ No newline at end of file
+}
diff --git a/src/plays/org-tree/org.js b/src/plays/org-tree/org.js
index b63df67b85..e026fc4aef 100644
--- a/src/plays/org-tree/org.js
+++ b/src/plays/org-tree/org.js
@@ -1,32 +1,32 @@
export const org = {
- name: "👴 CEO",
+ name: '👴 CEO',
children: [
{
- name: "🧔 Dir. Finance",
+ name: '🧔 Dir. Finance',
children: [
{
- name: "🧑 Finance Exec",
- },
- ],
+ name: '🧑 Finance Exec'
+ }
+ ]
},
{
- name: "👩🦱 Dir. Engineering",
+ name: '👩🦱 Dir. Engineering',
children: [
{
- name: "👩 Team Lead",
+ name: '👩 Team Lead',
children: [
{
- name: "👱 Frond-End(ReactJS)",
+ name: '👱 Frond-End(ReactJS)'
},
{
- name: "👩🦳 Back-End(Node.js)",
- },
- ],
- },
- ],
+ name: '👩🦳 Back-End(Node.js)'
+ }
+ ]
+ }
+ ]
},
{
- name: "👱♀️ Dir. HR",
- },
- ],
+ name: '👱♀️ Dir. HR'
+ }
+ ]
};
diff --git a/src/plays/password-generator/PasswordGenerator.jsx b/src/plays/password-generator/PasswordGenerator.jsx
index 3cf6d9ced4..6eab843373 100644
--- a/src/plays/password-generator/PasswordGenerator.jsx
+++ b/src/plays/password-generator/PasswordGenerator.jsx
@@ -1,17 +1,17 @@
-import { getPlayById } from "meta/play-meta-util";
+import { getPlayById } from 'meta/play-meta-util';
-import PlayHeader from "common/playlists/PlayHeader";
-import { useEffect, useState } from "react";
+import PlayHeader from 'common/playlists/PlayHeader';
+import { useEffect, useState } from 'react';
-import "./password-generator-style.css";
-import data from "./data.json";
+import './password-generator-style.css';
+import data from './data.json';
const config = {
length: 12,
numbers: true,
special: true,
uppercase: true,
- lowercase: true,
+ lowercase: true
};
function PasswordGenerator(props) {
@@ -21,7 +21,7 @@ function PasswordGenerator(props) {
const play = getPlayById(id);
// Your Code Start below.
- const [password, setPassword] = useState({ status: false, password: "" });
+ const [password, setPassword] = useState({ status: false, password: '' });
const [passwordConfig, setPasswordConfig] = useState({ ...config });
const [error, setError] = useState(false);
@@ -48,10 +48,10 @@ function PasswordGenerator(props) {
};
const concated = [
- ...parseData(numbers, "numbers"),
- ...parseData(special, "special"),
- ...parseData(uppercase, "uppercase"),
- ...parseData(lowercase, "lowercase"),
+ ...parseData(numbers, 'numbers'),
+ ...parseData(special, 'special'),
+ ...parseData(uppercase, 'uppercase'),
+ ...parseData(lowercase, 'lowercase')
];
return concated;
};
@@ -60,7 +60,7 @@ function PasswordGenerator(props) {
const generatePassword = () => {
setError(false);
const concated = arrangeData();
- let finalPassword = "";
+ let finalPassword = '';
for (let i = 0; i < passwordConfig.length; i++) {
finalPassword += concated[randomNumberGenerator(concated.length)];
}
@@ -99,48 +99,48 @@ function PasswordGenerator(props) {
}, []);
const ErrorBox = () => {
- return You cannot Uncheck All At Once.
;
+ return You cannot Uncheck All At Once.
;
};
return (
-
+
-
+
{/* Your Code Starts Here */}
-
-
Password Generator
-
+
+
Password Generator
+
{error && }
-
+
Length
handleCheckedItem("length", e.target.value)}
+ className="select"
+ onChange={(e) => handleCheckedItem('length', e.target.value)}
value={passwordConfig.length}
>
{[12, 14, 16, 20].map((num) => {
@@ -155,23 +155,21 @@ function PasswordGenerator(props) {
- {password?.status ? "Copied" : "Copy"}
+ {password?.status ? 'Copied' : 'Copy'}
-
+
Generate Password
@@ -189,14 +187,14 @@ const CheckBox = ({ name, checked, getCheckedItem, id }) => {
};
return (
-
+
{name}
);
diff --git a/src/plays/password-generator/Readme.md b/src/plays/password-generator/Readme.md
index e7de99062c..34f6aaf981 100644
--- a/src/plays/password-generator/Readme.md
+++ b/src/plays/password-generator/Readme.md
@@ -1,4 +1,5 @@
# Password Generator
+
The `Password Generator` project is a fun project which shows the usecase of some concept in ReactJS.
- Multiple Checkbox Handling.
@@ -13,4 +14,4 @@ For now all the necessary components, functions and logics are managed inside `P
also there is a `data.json` which is the main source and feeding requied data into the `PasswordGenerator.jsx` component.
-Happy Learning!
\ No newline at end of file
+Happy Learning!
diff --git a/src/plays/password-generator/data.json b/src/plays/password-generator/data.json
index d450eeb5d3..0549f89d18 100644
--- a/src/plays/password-generator/data.json
+++ b/src/plays/password-generator/data.json
@@ -1,5 +1,62 @@
{
- "uppercase": ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],
- "numbers": ["0","1","2","3","4","5","6","7","8","9"],
- "special": ["!","@","#","$","%","^","&","*","(",")","-","_","=","+","[","{","]","}","|",";",":","'","\"",",",".","<",">","/","?"]
-}
\ No newline at end of file
+ "uppercase": [
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z"
+ ],
+ "numbers": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
+ "special": [
+ "!",
+ "@",
+ "#",
+ "$",
+ "%",
+ "^",
+ "&",
+ "*",
+ "(",
+ ")",
+ "-",
+ "_",
+ "=",
+ "+",
+ "[",
+ "{",
+ "]",
+ "}",
+ "|",
+ ";",
+ ":",
+ "'",
+ "\"",
+ ",",
+ ".",
+ "<",
+ ">",
+ "/",
+ "?"
+ ]
+}
diff --git a/src/plays/password-generator/password-generator-style.css b/src/plays/password-generator/password-generator-style.css
index 1688b62849..2069320f37 100644
--- a/src/plays/password-generator/password-generator-style.css
+++ b/src/plays/password-generator/password-generator-style.css
@@ -1,139 +1,136 @@
-
-
.password-generator .main {
- padding: 0;
- margin: 0;
- box-sizing: border-box;
+ padding: 0;
+ margin: 0;
+ box-sizing: border-box;
}
.password-generator .title {
- text-align: center;
+ text-align: center;
}
.password-generator .section {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
}
.password-generator .section > div:nth-of-type(2) {
- position: relative;
- /* background-color: black; */
+ position: relative;
+ /* background-color: black; */
}
.password-generator .copy-button {
- position: absolute;
- right: 0;
- top: 0;
- bottom: 0;
- border: 2px solid #187B86;
- border-left: none;
- border-bottom-right-radius: 5px;
- border-top-right-radius: 5px;
- padding: 0 10px;
- font-size: 20px;
- background-color: #187B86;
- outline: none;
- color: white;
- transition: 100ms;
+ position: absolute;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ border: 2px solid #187b86;
+ border-left: none;
+ border-bottom-right-radius: 5px;
+ border-top-right-radius: 5px;
+ padding: 0 10px;
+ font-size: 20px;
+ background-color: #187b86;
+ outline: none;
+ color: white;
+ transition: 100ms;
}
.password-generator .copy-button:hover {
- background-color: #135088;
- border: 2px solid #135088;
- border-left: none;
+ background-color: #135088;
+ border: 2px solid #135088;
+ border-left: none;
}
.password-generator .copid {
- background-color: #135088;
- border: 2px solid #135088;
- border-left: none;
+ background-color: #135088;
+ border: 2px solid #135088;
+ border-left: none;
}
.password-generator .section > div:nth-of-type(1) {
- display: grid;
- grid-template-columns: 1fr 1fr;
- grid-template-rows: 1fr 1fr;
- width: 400px;
- column-gap: 25px;
- row-gap: 20px;
- margin: 25px 0;
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ grid-template-rows: 1fr 1fr;
+ width: 400px;
+ column-gap: 25px;
+ row-gap: 20px;
+ margin: 25px 0;
}
.password-generator .password-input {
- padding: 10px;
- outline: none;
- border: 2px solid #ccc;
- border-radius: 5px;
- font-size: 1.3rem;
- font-weight: bold;
- width: 400px;
- /* max-width: 400px; */
- color: gray;
+ padding: 10px;
+ outline: none;
+ border: 2px solid #ccc;
+ border-radius: 5px;
+ font-size: 1.3rem;
+ font-weight: bold;
+ width: 400px;
+ /* max-width: 400px; */
+ color: gray;
}
-
.password-generator .generate-pwd {
- padding: 10px 1rem;
- outline: none;
- font-size: 1.5rem;
- outline: none;
- background: rgb(0,128,0, 0.8);
- border: none;
- color: white;
- cursor: pointer;
- border-radius: 5px;
- transition: 100ms;
- margin: 1rem 0 0 0;
+ padding: 10px 1rem;
+ outline: none;
+ font-size: 1.5rem;
+ outline: none;
+ background: rgb(0, 128, 0, 0.8);
+ border: none;
+ color: white;
+ cursor: pointer;
+ border-radius: 5px;
+ transition: 100ms;
+ margin: 1rem 0 0 0;
}
.password-generator .generate-pwd:hover {
- background: rgb(0,128,0, 1);
+ background: rgb(0, 128, 0, 1);
}
.password-generator .checkbox-comp {
- padding: 0;
- margin: 0;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
+ padding: 0;
+ margin: 0;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
}
.password-generator .checkbox {
- width: 20px;
- height: 20px;
- float: right;
+ width: 20px;
+ height: 20px;
+ float: right;
}
.password-generator .select {
- width: 45px;
- height: 25px;
- font-size: 1rem;
- float: right;
- margin: 0;
+ width: 45px;
+ height: 25px;
+ font-size: 1rem;
+ float: right;
+ margin: 0;
}
.password-generator .error {
- color: red;
- font-size: 1rem;
- text-align: center;
+ color: red;
+ font-size: 1rem;
+ text-align: center;
}
@media screen and (max-width: 600px) {
- .password-generator .section > div:nth-of-type(1) {
- grid-template-columns: 1fr;
- grid-template-rows: 1fr;
- width: 100%;
- }
-
- .password-generator .password-input {
- font-size: 1rem;
- width: 100%;
- }
- .password-generator .copy-button {
- padding: 0 5px;
- font-size: 16px;
- }
-}
\ No newline at end of file
+ .password-generator .section > div:nth-of-type(1) {
+ grid-template-columns: 1fr;
+ grid-template-rows: 1fr;
+ width: 100%;
+ }
+
+ .password-generator .password-input {
+ font-size: 1rem;
+ width: 100%;
+ }
+ .password-generator .copy-button {
+ padding: 0 5px;
+ font-size: 16px;
+ }
+}
diff --git a/src/plays/quizeo/Readme.md b/src/plays/quizeo/Readme.md
index 60157bf7d7..d73576dd77 100644
--- a/src/plays/quizeo/Readme.md
+++ b/src/plays/quizeo/Readme.md
@@ -3,7 +3,9 @@
Quizeo is a react fun project to play quiz around favourite movies and series, if you have watched.
## What you will learn
-The app demonstrates
+
+The app demonstrates
+
- the use of reusable components, shows you how to divide your react app into components
- use of react-redux
- use of react-redux with hooks
@@ -12,4 +14,4 @@ The app demonstrates
The app uses redux store to store the state and data of the app globally and is fetched with the help of selectors 'react-reselect' to implement memoization to the app. Also each component contains its own CSS for easy implementation of design.
-Happy learning!
\ No newline at end of file
+Happy learning!
diff --git a/src/plays/quizeo/src/Quizeo.jsx b/src/plays/quizeo/src/Quizeo.jsx
index 5af714da17..cabf04050f 100644
--- a/src/plays/quizeo/src/Quizeo.jsx
+++ b/src/plays/quizeo/src/Quizeo.jsx
@@ -1,42 +1,42 @@
import { getPlayById } from 'meta/play-meta-util';
import PlayHeader from 'common/playlists/PlayHeader';
-import { store,persistor } from './redux/store';
+import { store, persistor } from './redux/store';
import { useEffect } from 'react';
-import { setScore, setQuestionNo } from "./redux/questions/questions-action";
-import Directory from "./components/directory/directory.component";
-import Header from "./components/header/header.component";
-import { Provider} from 'react-redux';
+import { setScore, setQuestionNo } from './redux/questions/questions-action';
+import Directory from './components/directory/directory.component';
+import Header from './components/header/header.component';
+import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
-import './quizeo.css'
+import './quizeo.css';
function Quizeo(props) {
- // Do not remove the below lines.
+ // Do not remove the below lines.
// The following code is to fetch the current play from the URL
const { id } = props;
- const play = getPlayById(id);
+ const play = getPlayById(id);
// Your Code Start below.
- useEffect(() =>{
+ useEffect(() => {
store.dispatch(setScore());
store.dispatch(setQuestionNo());
- })
+ });
return (
<>
- {/* Your Code Starts Here */}
-
-
-
-
+ {/* Your Code Starts Here */}
+
+
+
+
-
- {/* Your Code Ends Here */}
+
+ {/* Your Code Ends Here */}
>
);
}
-export default Quizeo;
\ No newline at end of file
+export default Quizeo;
diff --git a/src/plays/quizeo/src/components/directory/directory.component.jsx b/src/plays/quizeo/src/components/directory/directory.component.jsx
index 33545560ed..186d5f2771 100644
--- a/src/plays/quizeo/src/components/directory/directory.component.jsx
+++ b/src/plays/quizeo/src/components/directory/directory.component.jsx
@@ -1,29 +1,29 @@
-import React from "react";
-import { selectDirectorySection } from "../../redux/directory/directory-selectors";
-import MoviePage from "../../pages/moviePage/moviePage.component";
-import { useSelector} from 'react-redux';
-import MenuItem from "../menu-item/menuItem.component";
-import { selectQuestionIndex, selectClickedAction} from "../../redux/movie/movieSelector";
+import React from 'react';
+import { selectDirectorySection } from '../../redux/directory/directory-selectors';
+import MoviePage from '../../pages/moviePage/moviePage.component';
+import { useSelector } from 'react-redux';
+import MenuItem from '../menu-item/menuItem.component';
+import { selectQuestionIndex, selectClickedAction } from '../../redux/movie/movieSelector';
import './directory.styles.css';
-const Directory = () => {
+const Directory = () => {
+ let questionIndex = useSelector(selectQuestionIndex);
+ let isClick = useSelector(selectClickedAction);
+ const sections = useSelector(selectDirectorySection);
- let questionIndex = useSelector(selectQuestionIndex);
- let isClick = useSelector(selectClickedAction);
- const sections = useSelector(selectDirectorySection);
-
- return (
-
- {
- isClick ?
:
-
- {sections.map(({id, ...otherSectionComponent}) => (
-
- ))}
-
- }
+ return (
+
+ {isClick ? (
+
+ ) : (
+
+ {sections.map(({ id, ...otherSectionComponent }) => (
+
+ ))}
- );
-}
+ )}
+
+ );
+};
-export default Directory;
\ No newline at end of file
+export default Directory;
diff --git a/src/plays/quizeo/src/components/directory/directory.styles.css b/src/plays/quizeo/src/components/directory/directory.styles.css
index d12c7c65d1..5795a5b536 100644
--- a/src/plays/quizeo/src/components/directory/directory.styles.css
+++ b/src/plays/quizeo/src/components/directory/directory.styles.css
@@ -1,8 +1,8 @@
-.quizeo .directoryMenu{
- margin: 3rem;
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: center;
- align-items: center;
-}
\ No newline at end of file
+.quizeo .directoryMenu {
+ margin: 3rem;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ justify-content: center;
+ align-items: center;
+}
diff --git a/src/plays/quizeo/src/components/header/header.component.js b/src/plays/quizeo/src/components/header/header.component.js
index 086d845d79..c0eca83b8b 100644
--- a/src/plays/quizeo/src/components/header/header.component.js
+++ b/src/plays/quizeo/src/components/header/header.component.js
@@ -3,13 +3,15 @@ import { useDispatch } from 'react-redux';
import './header.styles.css';
import { isClicked } from '../../redux/questions/questions-action';
-const Header = () => {
- let dispatch = useDispatch();
- return (
-
-
dispatch(isClicked())}>Quizeo
-
- );
+function Header() {
+ const dispatch = useDispatch();
+ return (
+
+
dispatch(isClicked())}>
+ {'Quizeo'}
+
+
+ );
}
-export default Header;
\ No newline at end of file
+export default Header;
diff --git a/src/plays/quizeo/src/components/header/header.styles.css b/src/plays/quizeo/src/components/header/header.styles.css
index 884e361f0e..e94fc176a4 100644
--- a/src/plays/quizeo/src/components/header/header.styles.css
+++ b/src/plays/quizeo/src/components/header/header.styles.css
@@ -1,9 +1,9 @@
-.quizeo .header{
- cursor: pointer;
- margin-top: 1.5rem;
- margin-bottom: 3.5rem;
- font-size: 3rem;
- line-height: 1;
- font-weight: 700;
- text-decoration: none;
-}
\ No newline at end of file
+.quizeo .header {
+ cursor: pointer;
+ margin-top: 1.5rem;
+ margin-bottom: 3.5rem;
+ font-size: 3rem;
+ line-height: 1;
+ font-weight: 700;
+ text-decoration: none;
+}
diff --git a/src/plays/quizeo/src/components/menu-item/menu-item.styles.css b/src/plays/quizeo/src/components/menu-item/menu-item.styles.css
index cac0f889e6..144dc7e64d 100644
--- a/src/plays/quizeo/src/components/menu-item/menu-item.styles.css
+++ b/src/plays/quizeo/src/components/menu-item/menu-item.styles.css
@@ -1,35 +1,35 @@
-.quizeo .menu-item{
- display: flex;
- position: relative;
- margin: 0.25rem;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 18rem;
- border-width: 4px;
- opacity: 0.9;
+.quizeo .menu-item {
+ display: flex;
+ position: relative;
+ margin: 0.25rem;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ width: 18rem;
+ border-width: 4px;
+ opacity: 0.9;
}
-.quizeo .image-container{
- background-position: center;
- background-size: cover;
- width: 100%;
- height: 18rem;
+.quizeo .image-container {
+ background-position: center;
+ background-size: cover;
+ width: 100%;
+ height: 18rem;
}
-.quizeo .image-content{
- position: absolute;
- padding: 1.25rem;
- background-color: #ffffff;
- color: #000000;
- font-weight: 600;
- border-width: 2px;
- cursor: pointer;
- opacity: 0.8;
+.quizeo .image-content {
+ position: absolute;
+ padding: 1.25rem;
+ background-color: #ffffff;
+ color: #000000;
+ font-weight: 600;
+ border-width: 2px;
+ cursor: pointer;
+ opacity: 0.8;
}
-.quizeo .image-content h1{
- font-size: 1.125rem;
- line-height: 1.75rem;
-}
\ No newline at end of file
+.quizeo .image-content h1 {
+ font-size: 1.125rem;
+ line-height: 1.75rem;
+}
diff --git a/src/plays/quizeo/src/components/menu-item/menuItem.component.js b/src/plays/quizeo/src/components/menu-item/menuItem.component.js
index 9449b1cdea..0a5a32deeb 100644
--- a/src/plays/quizeo/src/components/menu-item/menuItem.component.js
+++ b/src/plays/quizeo/src/components/menu-item/menuItem.component.js
@@ -1,21 +1,26 @@
-import React from "react";
-import { useDispatch} from "react-redux"
-import { displayQuestionComponent, isClicked } from "../../redux/questions/questions-action";
+import React from 'react';
+import { useDispatch } from 'react-redux';
+import { displayQuestionComponent, isClicked } from '../../redux/questions/questions-action';
-import './menu-item.styles.css'
+import './menu-item.styles.css';
-const MenuItem = ({title, imageUrl, linkUrl}) => {
- const dispatch = useDispatch();
-
- return (
-
-
-
{dispatch(displayQuestionComponent(linkUrl)); dispatch(isClicked())}}>
-
{title}
-
-
- );
+function MenuItem({ title, imageUrl, linkUrl }) {
+ const dispatch = useDispatch();
+
+ return (
+
+
+
{
+ dispatch(displayQuestionComponent(linkUrl));
+ dispatch(isClicked());
+ }}
+ >
+
{title}
+
+
+ );
}
-export default MenuItem;
\ No newline at end of file
+export default MenuItem;
diff --git a/src/plays/quizeo/src/components/questions/questions.component.js b/src/plays/quizeo/src/components/questions/questions.component.js
index 0a0b2533a2..dfae4387e6 100644
--- a/src/plays/quizeo/src/components/questions/questions.component.js
+++ b/src/plays/quizeo/src/components/questions/questions.component.js
@@ -1,59 +1,79 @@
-import React from "react";
-import { useSelector, useDispatch } from "react-redux";
-import { ScoreModel } from "../../pages/score-page/score.component";
-import { addScore,showModel } from "../../redux/questions/questions-action";
-import { increaseQuestionNo } from "../../redux/questions/questions-action";
-import { selectQuestionNo, selectHiddenState } from "../../redux/movie/movieSelector";
+import React from 'react';
+import { useSelector, useDispatch } from 'react-redux';
+import { ScoreModel } from '../../pages/score-page/score.component';
+import { addScore, showModel, increaseQuestionNo } from '../../redux/questions/questions-action';
+import { selectQuestionNo, selectHiddenState } from '../../redux/movie/movieSelector';
import './questions.styles.css';
-const Questions = (collection) => {
- const counter = useSelector(selectQuestionNo);
- const hidden = useSelector(selectHiddenState);
- const dispatch = useDispatch();
- let obj;
- return (
-
- {Object.keys(collection).map((item,i) => (
-
- {/* movie title */}
-
- {collection[item].title}
-
-
- {/* question */}
-
- {counter + 1}.{collection[item].questions[counter].question}
-
-
- {/* options */}
-
- {Object.keys(collection[item].questions[counter].options).map((option, i) =>(
- {
- obj = {
- answer :e.target.value,
- correct : collection[item].questions[counter].answer
- }
- }}
- >
- {collection[item].questions[counter].options[option]}
-
- ))}
-
- {counter === collection[item].questions.length-1 ?
- {dispatch(addScore(obj));dispatch(showModel())}} >submit :
- {dispatch(addScore(obj)); dispatch(increaseQuestionNo())}}>Next }
-
-
-
- ))}
- {hidden ? null:
}
+function Questions(collection) {
+ const counter = useSelector(selectQuestionNo);
+ const hidden = useSelector(selectHiddenState);
+ const dispatch = useDispatch();
+ let obj;
+ return (
+
+ {Object.keys(collection).map((item, i) => (
+
+ {/* movie title */}
+
+ {collection[item].title}
+
+
+ {/* question */}
+
+ {counter + 1}
+ {'.'}
+ {collection[item].questions[counter].question}
+
+
+ {/* options */}
+
+ {Object.keys(collection[item].questions[counter].options).map((option, i) => (
+ {
+ obj = {
+ answer: e.target.value,
+ correct: collection[item].questions[counter].answer
+ };
+ }}
+ >
+ {collection[item].questions[counter].options[option]}
+
+ ))}
+
+ {counter === collection[item].questions.length - 1 ? (
+ {
+ dispatch(addScore(obj));
+ dispatch(showModel());
+ }}
+ >
+ {'submit'}
+
+ ) : (
+ {
+ dispatch(addScore(obj));
+ dispatch(increaseQuestionNo());
+ }}
+ >
+ {'Next'}
+
+ )}
+
+
- );
+ ))}
+ {hidden ? null :
}
+
+ );
}
-
-export default Questions;
\ No newline at end of file
+export default Questions;
diff --git a/src/plays/quizeo/src/components/questions/questions.styles.css b/src/plays/quizeo/src/components/questions/questions.styles.css
index 5a4a9afb02..e8f59ea3cf 100644
--- a/src/plays/quizeo/src/components/questions/questions.styles.css
+++ b/src/plays/quizeo/src/components/questions/questions.styles.css
@@ -1,118 +1,117 @@
-.quizeo .question-container{
- display: flex;
- margin-left: 2.25rem;
- margin-right: 2.25rem;
- text-align: center;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
+.quizeo .question-container {
+ display: flex;
+ margin-left: 2.25rem;
+ margin-right: 2.25rem;
+ text-align: center;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
}
-.quizeo .question-background{
- opacity: 0.5;
+.quizeo .question-background {
+ opacity: 0.5;
}
-.quizeo .question-model{
- margin-top:-4%;
+.quizeo .question-model {
+ margin-top: -4%;
}
-.quizeo .category-title{
- display: inline-block;
- position: relative;
- font-size: 2.25rem;
- line-height: 2.5rem;
- text-align: center;
+.quizeo .category-title {
+ display: inline-block;
+ position: relative;
+ font-size: 2.25rem;
+ line-height: 2.5rem;
+ text-align: center;
}
-.quizeo .category-title::before{
- content:"";
- display:block;
- position: absolute;
- background-color: #c12893;
- top: -0.25rem;
- right: -0.25rem;
- bottom: -0.25rem;
- left: -0.25rem;
- transform: rotate(-3deg);
+.quizeo .category-title::before {
+ content: '';
+ display: block;
+ position: absolute;
+ background-color: #c12893;
+ top: -0.25rem;
+ right: -0.25rem;
+ bottom: -0.25rem;
+ left: -0.25rem;
+ transform: rotate(-3deg);
}
-
-.quizeo .title{
- position: relative;
- color: #ffffff;
+.quizeo .title {
+ position: relative;
+ color: #ffffff;
}
-.quizeo .questions-section{
- background-color: #d8e2f7;
- margin-top: 2rem;
- border-radius: 0.75rem;
- box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
+.quizeo .questions-section {
+ background-color: #d8e2f7;
+ margin-top: 2rem;
+ border-radius: 0.75rem;
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
-.quizeo .question-title{
- padding-left: 0.75rem;
- padding-right: 0.75rem;
- padding-top: 3rem;
- padding-bottom: 3rem;
- color: #312E81;
- font-size: 1.5rem;
- line-height: 2rem;
- font-weight: 600;
+.quizeo .question-title {
+ padding-left: 0.75rem;
+ padding-right: 0.75rem;
+ padding-top: 3rem;
+ padding-bottom: 3rem;
+ color: #312e81;
+ font-size: 1.5rem;
+ line-height: 2rem;
+ font-weight: 600;
}
-.quizeo .options-section{
- margin-left: 1rem;
- margin-right: 1rem;
- text-align: center;
+.quizeo .options-section {
+ margin-left: 1rem;
+ margin-right: 1rem;
+ text-align: center;
}
-.quizeo .option-button{
- padding-top: 0.75rem;
- border:none;
- padding-bottom: 0.75rem;
- margin: 1rem;
- background-color: #3B82F6;
- color: #ffffff;
- font-size: 1.125rem;
- line-height: 1.75rem;
- font-weight: 500;
- text-align: center;
- text-transform: uppercase;
- width: 13rem;
- border-radius: 9999px;
- cursor: pointer;
- box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
+.quizeo .option-button {
+ padding-top: 0.75rem;
+ border: none;
+ padding-bottom: 0.75rem;
+ margin: 1rem;
+ background-color: #3b82f6;
+ color: #ffffff;
+ font-size: 1.125rem;
+ line-height: 1.75rem;
+ font-weight: 500;
+ text-align: center;
+ text-transform: uppercase;
+ width: 13rem;
+ border-radius: 9999px;
+ cursor: pointer;
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
-.quizeo .option-button:hover{
- background-color: #2563EB;
+.quizeo .option-button:hover {
+ background-color: #2563eb;
}
-.quizeo .option-button:active{
- background-color: #2e2b77;
+.quizeo .option-button:active {
+ background-color: #2e2b77;
}
-.quizeo .option-button:focus{
- outline: 0;
- background-color: #2e2b77;
- border : 2px solid #93C5FD;
+.quizeo .option-button:focus {
+ outline: 0;
+ background-color: #2e2b77;
+ border: 2px solid #93c5fd;
}
-.quizeo .submit-answer{
- border:none;
- padding: 0.5rem;
- margin:4%;
- color: #fff;
- background-color: #10B981;
- font-weight: 500;
- font-size: 1.2rem;
- width: 9rem;
- border-radius: 0.5rem;
+.quizeo .submit-answer {
+ border: none;
+ padding: 0.5rem;
+ margin: 4%;
+ color: #fff;
+ background-color: #10b981;
+ font-weight: 500;
+ font-size: 1.2rem;
+ width: 9rem;
+ border-radius: 0.5rem;
}
@media only screen and (min-width: 600px) {
- .quizeo .question-model{
- width: 50%;
- }
-}
\ No newline at end of file
+ .quizeo .question-model {
+ width: 50%;
+ }
+}
diff --git a/src/plays/quizeo/src/data/movie.data.jsx b/src/plays/quizeo/src/data/movie.data.jsx
index 830160c489..f1ba8d01a2 100644
--- a/src/plays/quizeo/src/data/movie.data.jsx
+++ b/src/plays/quizeo/src/data/movie.data.jsx
@@ -1,254 +1,254 @@
const movie_data = {
- avengers : {
+ avengers: {
+ id: 1,
+ title: 'Avengers',
+ total: 5,
+ questions: [
+ {
id: 1,
- title : "Avengers",
- total : 5,
- questions:[
- {
- id:1,
- question:"How many rings does Captain America's shield have?",
- options:{
- "a": 3,
- "b": 2,
- "c": 4,
- "d": 5
- },
- answer : 2
- },
- {
- id:2,
- question:"Who was the last holder of the Space Stone before Thanos claims it for his Infinity Gauntlet?",
- options:{
- "a": "Thor",
- "b": "Loki",
- "c": "The Collector",
- "d": "Tony stark"
- },
- answer : "Loki"
- },
- {
- id:3,
- question:"What is the real name of the Black Panther?",
- options:{
- "a":"T'Challa",
- "b": "M'Baku",
- "c": "N'Jadaka",
- "d": "N'Jobu"
- },
- answer : "T'Challa"
- },
- {
- id:4,
- question:"Who is killed by Loki in the Avengers?",
- options:{
- "a": "Maria Hill",
- "b": "Nick Fury",
- "c": "Agent Coulson",
- "d": "Doctor Erik Selvig"
- },
- answer : "Agent Coulson"
- },
- {
- id:5,
- question:"What is the name of Thor’s hammer?",
- options:{
- "a": "Vanir",
- "b": "Mjolnir",
- "c": "Aesir",
- "d": "Norn"
- },
- answer : "Mjolnir"
- }
- ]
- },
- moneyheist :{
+ question: "How many rings does Captain America's shield have?",
+ options: {
+ a: 3,
+ b: 2,
+ c: 4,
+ d: 5
+ },
+ answer: 2
+ },
+ {
id: 2,
- title : "Money Heist",
- total : 5,
- questions:[
-
- {
- id:1,
- question:" How long did the professor take to prepare for the robbery?",
- options:{
- "a": "months",
- "b": "weeks",
- "c": "days",
- "d": "years"
- },
- answer : "years"
- },
- {
- id:2,
- question:"How many people did the professor recruit to help him carry out his plan?",
- options:{
- "a": "seven",
- "b": "six",
- "c": "eight",
- "d": "nine"
- },
- answer : "eight"
- },
- {
- id:3,
- question:"In which country does Raquel track the Professor after the first heist?",
- options:{
- "a": "Philippines",
- "b": "Thailand",
- "c": "Portugal",
- "d": "Clark"
- },
- answer : "Philippines"
- },
- {
- id:4,
- question:"The whole idea and plan of the heist was whose?",
- options:{
- "a": "The professor's father",
- "b": "Berlin",
- "c": "Professor",
- "d": "Palermo"
- },
- answer : "The professor's father"
- },
- {
- id:5,
- question:"How much money were the Robbers able to print?",
- options:{
- "a": "976 million Euros",
- "b": "956 million Euros",
- "c": "967 million Euros",
- "d": "984 million Euros"
- },
- answer : "984 million Euros"
- }
-
- ]
- },
- friends:{
- id:3,
- title: "Friends",
- total : 5,
- questions:[
- {
- id:1,
- question:"How many sisters does Joey have?",
- options:{
- "a": 3,
- "b": 2,
- "c": 4,
- "d": 7
- },
- answer : 7
- },
- {
- id:2,
- question:"What is the name of Joey’s character in the commercial for opening milk cartons?",
- options:{
- "a": "Mak",
- "b": "Mark",
- "c": "Kevin",
- "d": "Drake"
- },
- answer : "Kevin"
- },
- {
- id:3,
- question:"What is the name of Joey’s acting agent?",
- options:{
- "a": "Andrea",
- "b": "Estelle",
- "c": "Martha",
- "d": "Carole"
- },
- answer : "Estelle"
- },
- {
- id:4,
- question:"Phoebe has a twin sister. What's her name?",
- options:{
- "a": "Ursula",
- "b": "Scalet",
- "c": "Sharon",
- "d": "Rita"
- },
- answer : "Ursula"
- },
- {
- id:5,
- question:"Who's wearing this turkey on their head?",
- options:{
- "a": "Pheobe",
- "b": "Joey",
- "c": "Monica",
- "d": "Chandler"
- },
- answer : "Monica"
- }
- ]
- },
- squidgame:{
- id:4,
- title: "Squid game",
- total : 5,
- questions:[
- {
- id:1,
- question:"How many contestants show up to play Squid Game?",
- options:{
- "a": 453,
- "b": 456,
- "c": 458,
- "d": 452
- },
- answer : 456
- },
- {
- id:2,
- question:"What shape did the old man carve in the Honeycomb challenge?",
- options:{
- "a": "triangle",
- "b": "circle",
- "c": "star",
- "d": "umbrella"
- },
- answer : "star"
- },
- {
- id:3,
- question:"Who was Hwang Jun-ho looking for?",
- options:{
- "a": "His younger brother",
- "b": "His mother",
- "c": "His father",
- "d": "His older brother"
- },
- answer : "His older brother"
- },
- {
- id:4,
- question:"How many games are in the competition?",
- options:{
- "a": 6,
- "b": 7,
- "c": 8,
- "d": 5
- },
- answer : 6
- },
- {
- id:5,
- question:"Why did Gi-Hun give his daughter a gift?",
- options:{
- "a": "It was her birthday",
- "b": "It was christmas",
- "c": "It was New Year",
- "d": "It was a festival"
- },
- answer : "It was her birthday"
- }
- ]
- }
-}
+ question:
+ 'Who was the last holder of the Space Stone before Thanos claims it for his Infinity Gauntlet?',
+ options: {
+ a: 'Thor',
+ b: 'Loki',
+ c: 'The Collector',
+ d: 'Tony stark'
+ },
+ answer: 'Loki'
+ },
+ {
+ id: 3,
+ question: 'What is the real name of the Black Panther?',
+ options: {
+ a: "T'Challa",
+ b: "M'Baku",
+ c: "N'Jadaka",
+ d: "N'Jobu"
+ },
+ answer: "T'Challa"
+ },
+ {
+ id: 4,
+ question: 'Who is killed by Loki in the Avengers?',
+ options: {
+ a: 'Maria Hill',
+ b: 'Nick Fury',
+ c: 'Agent Coulson',
+ d: 'Doctor Erik Selvig'
+ },
+ answer: 'Agent Coulson'
+ },
+ {
+ id: 5,
+ question: 'What is the name of Thor’s hammer?',
+ options: {
+ a: 'Vanir',
+ b: 'Mjolnir',
+ c: 'Aesir',
+ d: 'Norn'
+ },
+ answer: 'Mjolnir'
+ }
+ ]
+ },
+ moneyheist: {
+ id: 2,
+ title: 'Money Heist',
+ total: 5,
+ questions: [
+ {
+ id: 1,
+ question: ' How long did the professor take to prepare for the robbery?',
+ options: {
+ a: 'months',
+ b: 'weeks',
+ c: 'days',
+ d: 'years'
+ },
+ answer: 'years'
+ },
+ {
+ id: 2,
+ question: 'How many people did the professor recruit to help him carry out his plan?',
+ options: {
+ a: 'seven',
+ b: 'six',
+ c: 'eight',
+ d: 'nine'
+ },
+ answer: 'eight'
+ },
+ {
+ id: 3,
+ question: 'In which country does Raquel track the Professor after the first heist?',
+ options: {
+ a: 'Philippines',
+ b: 'Thailand',
+ c: 'Portugal',
+ d: 'Clark'
+ },
+ answer: 'Philippines'
+ },
+ {
+ id: 4,
+ question: 'The whole idea and plan of the heist was whose?',
+ options: {
+ a: "The professor's father",
+ b: 'Berlin',
+ c: 'Professor',
+ d: 'Palermo'
+ },
+ answer: "The professor's father"
+ },
+ {
+ id: 5,
+ question: 'How much money were the Robbers able to print?',
+ options: {
+ a: '976 million Euros',
+ b: '956 million Euros',
+ c: '967 million Euros',
+ d: '984 million Euros'
+ },
+ answer: '984 million Euros'
+ }
+ ]
+ },
+ friends: {
+ id: 3,
+ title: 'Friends',
+ total: 5,
+ questions: [
+ {
+ id: 1,
+ question: 'How many sisters does Joey have?',
+ options: {
+ a: 3,
+ b: 2,
+ c: 4,
+ d: 7
+ },
+ answer: 7
+ },
+ {
+ id: 2,
+ question:
+ 'What is the name of Joey’s character in the commercial for opening milk cartons?',
+ options: {
+ a: 'Mak',
+ b: 'Mark',
+ c: 'Kevin',
+ d: 'Drake'
+ },
+ answer: 'Kevin'
+ },
+ {
+ id: 3,
+ question: 'What is the name of Joey’s acting agent?',
+ options: {
+ a: 'Andrea',
+ b: 'Estelle',
+ c: 'Martha',
+ d: 'Carole'
+ },
+ answer: 'Estelle'
+ },
+ {
+ id: 4,
+ question: "Phoebe has a twin sister. What's her name?",
+ options: {
+ a: 'Ursula',
+ b: 'Scalet',
+ c: 'Sharon',
+ d: 'Rita'
+ },
+ answer: 'Ursula'
+ },
+ {
+ id: 5,
+ question: "Who's wearing this turkey on their head?",
+ options: {
+ a: 'Pheobe',
+ b: 'Joey',
+ c: 'Monica',
+ d: 'Chandler'
+ },
+ answer: 'Monica'
+ }
+ ]
+ },
+ squidgame: {
+ id: 4,
+ title: 'Squid game',
+ total: 5,
+ questions: [
+ {
+ id: 1,
+ question: 'How many contestants show up to play Squid Game?',
+ options: {
+ a: 453,
+ b: 456,
+ c: 458,
+ d: 452
+ },
+ answer: 456
+ },
+ {
+ id: 2,
+ question: 'What shape did the old man carve in the Honeycomb challenge?',
+ options: {
+ a: 'triangle',
+ b: 'circle',
+ c: 'star',
+ d: 'umbrella'
+ },
+ answer: 'star'
+ },
+ {
+ id: 3,
+ question: 'Who was Hwang Jun-ho looking for?',
+ options: {
+ a: 'His younger brother',
+ b: 'His mother',
+ c: 'His father',
+ d: 'His older brother'
+ },
+ answer: 'His older brother'
+ },
+ {
+ id: 4,
+ question: 'How many games are in the competition?',
+ options: {
+ a: 6,
+ b: 7,
+ c: 8,
+ d: 5
+ },
+ answer: 6
+ },
+ {
+ id: 5,
+ question: 'Why did Gi-Hun give his daughter a gift?',
+ options: {
+ a: 'It was her birthday',
+ b: 'It was christmas',
+ c: 'It was New Year',
+ d: 'It was a festival'
+ },
+ answer: 'It was her birthday'
+ }
+ ]
+ }
+};
export default movie_data;
diff --git a/src/plays/quizeo/src/pages/moviePage/moviePage.component.js b/src/plays/quizeo/src/pages/moviePage/moviePage.component.js
index de297821fc..addc7ed99f 100644
--- a/src/plays/quizeo/src/pages/moviePage/moviePage.component.js
+++ b/src/plays/quizeo/src/pages/moviePage/moviePage.component.js
@@ -1,18 +1,18 @@
-import React from "react";
-import { useSelector } from 'react-redux'
-import { selectMovieDataSection } from "../../redux/movie/movieSelector";
-import Questions from "../../components/questions/questions.component";
+import React from 'react';
+import { useSelector } from 'react-redux';
+import { selectMovieDataSection } from '../../redux/movie/movieSelector';
+import Questions from '../../components/questions/questions.component';
-import '../../quizeo.css'
+import '../../quizeo.css';
-const MoviePage = ({categoryId}) => {
- console.log(categoryId);
- const collection = useSelector(selectMovieDataSection(categoryId))
- return (
-
-
-
- );
+function MoviePage({ categoryId }) {
+ console.log(categoryId);
+ const collection = useSelector(selectMovieDataSection(categoryId));
+ return (
+
+
+
+ );
}
export default MoviePage;
diff --git a/src/plays/quizeo/src/pages/score-page/score.component.js b/src/plays/quizeo/src/pages/score-page/score.component.js
index 2879d30aa9..fa2ff97873 100644
--- a/src/plays/quizeo/src/pages/score-page/score.component.js
+++ b/src/plays/quizeo/src/pages/score-page/score.component.js
@@ -1,25 +1,39 @@
-import React from "react"
-import { useSelector, useDispatch} from "react-redux"
-import { showModel,setScore, setQuestionNo, isClicked } from "../../redux/questions/questions-action";
-import { selectScore } from "../../redux/movie/movieSelector";
+import React from 'react';
+import { useSelector, useDispatch } from 'react-redux';
+import {
+ showModel,
+ setScore,
+ setQuestionNo,
+ isClicked
+} from '../../redux/questions/questions-action';
+import { selectScore } from '../../redux/movie/movieSelector';
import './score.styles.css';
-export const ScoreModel = () => {
- var score = useSelector(selectScore);
- const dispatch = useDispatch();
- return(
-
-
- dispatch(showModel())}>x
-
🎉Your score is {score}
- {
- dispatch(showModel());
- dispatch(setScore());
- dispatch(isClicked());
- dispatch(setQuestionNo());
- }}>Play again
-
-
- )
-}
\ No newline at end of file
+export function ScoreModel() {
+ const score = useSelector(selectScore);
+ const dispatch = useDispatch();
+ return (
+
+
+ dispatch(showModel())}>
+ {'x'}
+
+
+ {'🎉Your score is '}
+ {score}
+
+ {
+ dispatch(showModel());
+ dispatch(setScore());
+ dispatch(isClicked());
+ dispatch(setQuestionNo());
+ }}
+ >
+ {'Play again'}
+
+
+
+ );
+}
diff --git a/src/plays/quizeo/src/pages/score-page/score.styles.css b/src/plays/quizeo/src/pages/score-page/score.styles.css
index 441f40b9cf..91d86ec270 100644
--- a/src/plays/quizeo/src/pages/score-page/score.styles.css
+++ b/src/plays/quizeo/src/pages/score-page/score.styles.css
@@ -1,48 +1,48 @@
-.quizeo .score-container{
- display: flex;
- align-items: center;
- justify-content: center;
+.quizeo .score-container {
+ display: flex;
+ align-items: center;
+ justify-content: center;
}
-.quizeo .score-section{
- display: flex;
- position: absolute;
- top:25%;
- background-color: #ffffff;
- display: flex;
- flex-direction: column;
- justify-content: center;
- width: 24rem;
- height: 16rem;
- border-radius: 1.5rem;
+.quizeo .score-section {
+ display: flex;
+ position: absolute;
+ top: 25%;
+ background-color: #ffffff;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ width: 24rem;
+ height: 16rem;
+ border-radius: 1.5rem;
}
-.quizeo .score-close{
- border:none;
- position: absolute;
- top: 1rem;
- right: 2rem;
- font-size: 1.875rem;
- line-height: 2.25rem;
- color: black;
- background-color: white;
+.quizeo .score-close {
+ border: none;
+ position: absolute;
+ top: 1rem;
+ right: 2rem;
+ font-size: 1.875rem;
+ line-height: 2.25rem;
+ color: black;
+ background-color: white;
}
-.quizeo .score-section h1{
- font-size: 1.5rem;
- line-height: 2rem;
- font-weight: 500;
+.quizeo .score-section h1 {
+ font-size: 1.5rem;
+ line-height: 2rem;
+ font-weight: 500;
}
-.quizeo .play-button{
- color:white;
- border:none;
- padding: 0.75rem;
- background-color: rgb(110, 216, 216);
- margin-top: 1.75rem;
- margin-bottom: 1.75rem;
- margin-left: 5rem;
- margin-right: 5rem;
- border-radius: 1.5rem;
- box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
-}
\ No newline at end of file
+.quizeo .play-button {
+ color: white;
+ border: none;
+ padding: 0.75rem;
+ background-color: rgb(110, 216, 216);
+ margin-top: 1.75rem;
+ margin-bottom: 1.75rem;
+ margin-left: 5rem;
+ margin-right: 5rem;
+ border-radius: 1.5rem;
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
+}
diff --git a/src/plays/quizeo/src/quizeo.css b/src/plays/quizeo/src/quizeo.css
index 6375c57f58..c358cf9b7c 100644
--- a/src/plays/quizeo/src/quizeo.css
+++ b/src/plays/quizeo/src/quizeo.css
@@ -1,6 +1,6 @@
-.quizeo h1{
- font-family:sans-serif;
- color:#3D56B2;
- text-decoration: none;
- text-align: center;
-}
+.quizeo h1 {
+ font-family: sans-serif;
+ color: #3d56b2;
+ text-decoration: none;
+ text-align: center;
+}
diff --git a/src/plays/quizeo/src/redux/directory/directory-reducer.js b/src/plays/quizeo/src/redux/directory/directory-reducer.js
index ea82baabe9..3360210a78 100644
--- a/src/plays/quizeo/src/redux/directory/directory-reducer.js
+++ b/src/plays/quizeo/src/redux/directory/directory-reducer.js
@@ -1,38 +1,37 @@
const INITIAL_STATE = {
- sections: [
- {
- id:1,
- title:"Avengers",
- imageUrl: "https://i.ibb.co/XWP17ND/avengers-resize.jpg",
- linkUrl:'avengers'
- },
- {
- id:2,
- title:"Money Heist",
- imageUrl: "https://i.ibb.co/Jtw5wN9/money-heist.jpg",
- linkUrl:'moneyheist'
- },
- {
- id:3,
- title:"Friends",
- imageUrl: "https://i.ibb.co/s9XCV3H/friends.jpg",
- linkUrl:'friends'
- },
- {
- id:4,
- title:"Squid Game",
- imageUrl: "https://i.ibb.co/Qr9ssY3/squid-game.jpg",
- linkUrl:'squidgame'
- }
- ]
-}
-
-
-const directoryReducer = (state = INITIAL_STATE, action) =>{
- switch(action.type){
- default:
- return {...state};
+ sections: [
+ {
+ id: 1,
+ title: 'Avengers',
+ imageUrl: 'https://i.ibb.co/XWP17ND/avengers-resize.jpg',
+ linkUrl: 'avengers'
+ },
+ {
+ id: 2,
+ title: 'Money Heist',
+ imageUrl: 'https://i.ibb.co/Jtw5wN9/money-heist.jpg',
+ linkUrl: 'moneyheist'
+ },
+ {
+ id: 3,
+ title: 'Friends',
+ imageUrl: 'https://i.ibb.co/s9XCV3H/friends.jpg',
+ linkUrl: 'friends'
+ },
+ {
+ id: 4,
+ title: 'Squid Game',
+ imageUrl: 'https://i.ibb.co/Qr9ssY3/squid-game.jpg',
+ linkUrl: 'squidgame'
}
-}
+ ]
+};
+
+const directoryReducer = (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ default:
+ return { ...state };
+ }
+};
-export default directoryReducer;
\ No newline at end of file
+export default directoryReducer;
diff --git a/src/plays/quizeo/src/redux/directory/directory-selectors.js b/src/plays/quizeo/src/redux/directory/directory-selectors.js
index 6f539d625f..cf9a40fa6e 100644
--- a/src/plays/quizeo/src/redux/directory/directory-selectors.js
+++ b/src/plays/quizeo/src/redux/directory/directory-selectors.js
@@ -1,8 +1,8 @@
-import { createSelector } from "reselect";
+import { createSelector } from 'reselect';
const selectDirectory = (state) => state.directory;
export const selectDirectorySection = createSelector(
- [selectDirectory],
- directory => directory.sections
-)
+ [selectDirectory],
+ (directory) => directory.sections
+);
diff --git a/src/plays/quizeo/src/redux/movie/movie-reducer.js b/src/plays/quizeo/src/redux/movie/movie-reducer.js
index 93bfeb5011..0d3d365eee 100644
--- a/src/plays/quizeo/src/redux/movie/movie-reducer.js
+++ b/src/plays/quizeo/src/redux/movie/movie-reducer.js
@@ -1,56 +1,56 @@
-import movie_data from "../../data/movie.data";
-import { QuestionTypes } from "../questions/question-types";
-import { calculateScore } from "../questions/question.utils";
+import movie_data from '../../data/movie.data';
+import { QuestionTypes } from '../questions/question-types';
+import { calculateScore } from '../questions/question.utils';
const INITIAL_STATE = {
- collection:movie_data,
- hidden: true,
- questionNo : 0,
- score:0,
- questionIndex : '',
- setClicked: false,
-}
+ collection: movie_data,
+ hidden: true,
+ questionNo: 0,
+ score: 0,
+ questionIndex: '',
+ setClicked: false
+};
-const movieReducer = (state = INITIAL_STATE,action) =>{
- switch(action.type){
- case QuestionTypes.ADD_SCORE:
- return{
- ...state,
- score: calculateScore(state.score, action.payload)
- }
- case QuestionTypes.SHOW_MODEL:
- return{
- ...state,
- hidden : !state.hidden
- }
- case QuestionTypes.SET_SCORE:
- return{
- ...state,
- score: 0
- }
- case QuestionTypes.INCREASE_QUESTION_NO:
- return{
- ...state,
- questionNo : state.questionNo + 1
- }
- case QuestionTypes.SET_QUESTION_NO:
- return{
- ...state,
- questionNo: 0
- }
- case QuestionTypes.DISPLAY_QUESTION_COMPONENT:
- return{
- ...state,
- questionIndex: action.payload
- }
- case QuestionTypes.IS_CLICKED:
- return{
- ...state,
- setClicked: !state.setClicked
- }
- default:
- return {...state}
- }
-}
+const movieReducer = (state = INITIAL_STATE, action) => {
+ switch (action.type) {
+ case QuestionTypes.ADD_SCORE:
+ return {
+ ...state,
+ score: calculateScore(state.score, action.payload)
+ };
+ case QuestionTypes.SHOW_MODEL:
+ return {
+ ...state,
+ hidden: !state.hidden
+ };
+ case QuestionTypes.SET_SCORE:
+ return {
+ ...state,
+ score: 0
+ };
+ case QuestionTypes.INCREASE_QUESTION_NO:
+ return {
+ ...state,
+ questionNo: state.questionNo + 1
+ };
+ case QuestionTypes.SET_QUESTION_NO:
+ return {
+ ...state,
+ questionNo: 0
+ };
+ case QuestionTypes.DISPLAY_QUESTION_COMPONENT:
+ return {
+ ...state,
+ questionIndex: action.payload
+ };
+ case QuestionTypes.IS_CLICKED:
+ return {
+ ...state,
+ setClicked: !state.setClicked
+ };
+ default:
+ return { ...state };
+ }
+};
export default movieReducer;
diff --git a/src/plays/quizeo/src/redux/movie/movieSelector.js b/src/plays/quizeo/src/redux/movie/movieSelector.js
index 530e7f4226..deb2a766c2 100644
--- a/src/plays/quizeo/src/redux/movie/movieSelector.js
+++ b/src/plays/quizeo/src/redux/movie/movieSelector.js
@@ -1,39 +1,20 @@
-import { createSelector } from "reselect";
+import { createSelector } from 'reselect';
import memoize from 'lodash.memoize';
const selectMovie = (state) => state.movie;
-export const selectQuestionIndex = createSelector(
- [selectMovie],
- movie => movie.questionIndex
-)
-
-export const selectQuestionNo = createSelector(
- [selectMovie],
- movie => movie.questionNo
-)
-
-export const selectHiddenState = createSelector(
- [selectMovie],
- movie => movie.hidden
-)
-
-export const selectScore = createSelector(
- [selectMovie],
- movie => movie.score
-)
-
-export const selectClickedAction = createSelector(
- [selectMovie],
- movie => movie.setClicked
-)
-
-export const selectMovieData = createSelector(
- [selectMovie],
- movie => movie.collection
-)
-
-export const selectMovieDataSection = memoize(collectionUrlParam => createSelector(
- [selectMovieData],
- collection => collection[collectionUrlParam]
-))
+export const selectQuestionIndex = createSelector([selectMovie], (movie) => movie.questionIndex);
+
+export const selectQuestionNo = createSelector([selectMovie], (movie) => movie.questionNo);
+
+export const selectHiddenState = createSelector([selectMovie], (movie) => movie.hidden);
+
+export const selectScore = createSelector([selectMovie], (movie) => movie.score);
+
+export const selectClickedAction = createSelector([selectMovie], (movie) => movie.setClicked);
+
+export const selectMovieData = createSelector([selectMovie], (movie) => movie.collection);
+
+export const selectMovieDataSection = memoize((collectionUrlParam) =>
+ createSelector([selectMovieData], (collection) => collection[collectionUrlParam])
+);
diff --git a/src/plays/quizeo/src/redux/questions/question-types.js b/src/plays/quizeo/src/redux/questions/question-types.js
index 6c394af19d..e56b31f8cb 100644
--- a/src/plays/quizeo/src/redux/questions/question-types.js
+++ b/src/plays/quizeo/src/redux/questions/question-types.js
@@ -1,9 +1,9 @@
export const QuestionTypes = {
- INCREASE_QUESTION_NO: 'INCREASE_QUESTION_NO',
- ADD_SCORE : 'ADD_SCORE',
- SHOW_MODEL : 'SHOW_MODEL',
- SET_SCORE : 'SET_SCORE',
- SET_QUESTION_NO: 'SET_QUESTION_NO',
- DISPLAY_QUESTION_COMPONENT : 'DISPLAY_QUESTION_COMPONENT',
- IS_CLICKED: 'IS_CLICKED'
-}
\ No newline at end of file
+ INCREASE_QUESTION_NO: 'INCREASE_QUESTION_NO',
+ ADD_SCORE: 'ADD_SCORE',
+ SHOW_MODEL: 'SHOW_MODEL',
+ SET_SCORE: 'SET_SCORE',
+ SET_QUESTION_NO: 'SET_QUESTION_NO',
+ DISPLAY_QUESTION_COMPONENT: 'DISPLAY_QUESTION_COMPONENT',
+ IS_CLICKED: 'IS_CLICKED'
+};
diff --git a/src/plays/quizeo/src/redux/questions/question.utils.js b/src/plays/quizeo/src/redux/questions/question.utils.js
index 292613c710..2d0dbb30b6 100644
--- a/src/plays/quizeo/src/redux/questions/question.utils.js
+++ b/src/plays/quizeo/src/redux/questions/question.utils.js
@@ -1,11 +1,9 @@
-
-export const calculateScore = (score, answer) =>{
- if(answer.answer){
- if(answer.answer === answer.correct){
- score = score + 1
- return score;
- }else{
- return score;
- }
+export const calculateScore = (score, answer) => {
+ if (answer.answer) {
+ if (answer.answer === answer.correct) {
+ score += 1;
+ return score;
}
-}
\ No newline at end of file
+ return score;
+ }
+};
diff --git a/src/plays/quizeo/src/redux/questions/questions-action.js b/src/plays/quizeo/src/redux/questions/questions-action.js
index 5b15e80b60..f6f2c8f1a6 100644
--- a/src/plays/quizeo/src/redux/questions/questions-action.js
+++ b/src/plays/quizeo/src/redux/questions/questions-action.js
@@ -1,31 +1,31 @@
-import { QuestionTypes } from "./question-types";
+import { QuestionTypes } from './question-types';
-export const increaseQuestionNo = () =>({
- type:QuestionTypes.INCREASE_QUESTION_NO
-})
+export const increaseQuestionNo = () => ({
+ type: QuestionTypes.INCREASE_QUESTION_NO
+});
export const addScore = (answer) => ({
- type:QuestionTypes.ADD_SCORE,
- payload : answer
-})
+ type: QuestionTypes.ADD_SCORE,
+ payload: answer
+});
export const showModel = () => ({
- type: QuestionTypes.SHOW_MODEL
-})
+ type: QuestionTypes.SHOW_MODEL
+});
export const setScore = () => ({
- type:QuestionTypes.SET_SCORE
-})
+ type: QuestionTypes.SET_SCORE
+});
export const setQuestionNo = () => ({
- type:QuestionTypes.SET_QUESTION_NO
-})
+ type: QuestionTypes.SET_QUESTION_NO
+});
-export const displayQuestionComponent = (linkUrl) =>({
- type: QuestionTypes.DISPLAY_QUESTION_COMPONENT,
- payload: linkUrl
-})
+export const displayQuestionComponent = (linkUrl) => ({
+ type: QuestionTypes.DISPLAY_QUESTION_COMPONENT,
+ payload: linkUrl
+});
export const isClicked = () => ({
- type:QuestionTypes.IS_CLICKED
-})
\ No newline at end of file
+ type: QuestionTypes.IS_CLICKED
+});
diff --git a/src/plays/quizeo/src/redux/root-reducer.js b/src/plays/quizeo/src/redux/root-reducer.js
index c27757f988..8b4bde0417 100644
--- a/src/plays/quizeo/src/redux/root-reducer.js
+++ b/src/plays/quizeo/src/redux/root-reducer.js
@@ -1,17 +1,17 @@
-import { combineReducers } from "redux";
-import { persistReducer } from "redux-persist";
-import storage from "redux-persist/lib/storage";
-import directoryReducer from "./directory/directory-reducer";
+import { combineReducers } from 'redux';
+import { persistReducer } from 'redux-persist';
+import storage from 'redux-persist/lib/storage';
+import directoryReducer from './directory/directory-reducer';
import movieReducer from './movie/movie-reducer';
// import questionReducer from "./questions/question-reducer";
const persistConfig = {
- key:'root',
- storage
-}
+ key: 'root',
+ storage
+};
const rootReducer = combineReducers({
- directory:directoryReducer,
- movie: movieReducer
-})
+ directory: directoryReducer,
+ movie: movieReducer
+});
-export default persistReducer(persistConfig, rootReducer);
\ No newline at end of file
+export default persistReducer(persistConfig, rootReducer);
diff --git a/src/plays/quizeo/src/redux/store.js b/src/plays/quizeo/src/redux/store.js
index a0921249da..6e9451722a 100644
--- a/src/plays/quizeo/src/redux/store.js
+++ b/src/plays/quizeo/src/redux/store.js
@@ -1,9 +1,9 @@
-import { createStore } from "redux";
-import { persistStore } from "redux-persist";
+import { createStore } from 'redux';
+import { persistStore } from 'redux-persist';
import rootReducer from './root-reducer';
const store = createStore(rootReducer);
const persistor = persistStore(store);
-export {store, persistor};
+export { store, persistor };
diff --git a/src/plays/quote-generator/QuoteGenerator.jsx b/src/plays/quote-generator/QuoteGenerator.jsx
index 62585abca2..86ee1155bb 100644
--- a/src/plays/quote-generator/QuoteGenerator.jsx
+++ b/src/plays/quote-generator/QuoteGenerator.jsx
@@ -1,10 +1,10 @@
-import { getPlayById } from "meta/play-meta-util";
-import PlayHeader from "common/playlists/PlayHeader";
-import "./quoteGenerator.css";
-import { useEffect, useState } from "react";
+import { getPlayById } from 'meta/play-meta-util';
+import PlayHeader from 'common/playlists/PlayHeader';
+import './quoteGenerator.css';
+import { useEffect, useState } from 'react';
const fetchQuote = () => {
- const response = fetch("https://api.quotable.io/random");
+ const response = fetch('https://api.quotable.io/random');
return response;
};
@@ -36,10 +36,7 @@ function QuoteGenerator(props) {
}
const response = await (await fetchQuote()).json();
- await updateState(
- [...quoteArray, [response.content, response.author]],
- setQuoteArray
- );
+ await updateState([...quoteArray, [response.content, response.author]], setQuoteArray);
await updateState(current + 1, setCurrent);
return;
};
@@ -47,10 +44,7 @@ function QuoteGenerator(props) {
useEffect(() => {
const fetcher = async () => {
const response = await (await fetchQuote()).json();
- await updateState(
- [...quoteArray, [response.content, response.author]],
- setQuoteArray
- );
+ await updateState([...quoteArray, [response.content, response.author]], setQuoteArray);
};
fetcher();
}, []);
@@ -66,11 +60,7 @@ function QuoteGenerator(props) {
@@ -92,25 +78,20 @@ function QuoteGenerator(props) {
{quoteArray.length > 0 &&
{quoteArray[current][0]}
}
- {quoteArray.length > 0 &&
-
-
- {current + 1}/{quoteArray.length}
-
- }
+ {quoteArray.length > 0 && (
+
+
+ {current + 1}/{quoteArray.length}
+
+
+ )}
- {quoteArray.length > 0 && (
- - {quoteArray[current][1]}
- )}
+ {quoteArray.length > 0 && - {quoteArray[current][1]}
}
diff --git a/src/plays/quote-generator/Readme.md b/src/plays/quote-generator/Readme.md
index e1e0ef9bf8..ede2934458 100644
--- a/src/plays/quote-generator/Readme.md
+++ b/src/plays/quote-generator/Readme.md
@@ -4,4 +4,4 @@ This play revolves around Random Quote generations, saving them and being able t
On loading this play, a random quote will be displayed which is stored using useState hook. User can fetch more quotes with the help of Generate Quote Button.
-User can use previous and Next button to traverse between various quotes stored with the help of useState hook.
\ No newline at end of file
+User can use previous and Next button to traverse between various quotes stored with the help of useState hook.
diff --git a/src/plays/quote-generator/quoteGenerator.css b/src/plays/quote-generator/quoteGenerator.css
index 2c4b9cb159..6b9795a493 100644
--- a/src/plays/quote-generator/quoteGenerator.css
+++ b/src/plays/quote-generator/quoteGenerator.css
@@ -15,7 +15,7 @@
justify-content: center;
}
-.rand-quote-gen .play-area .quote-area .quote{
+.rand-quote-gen .play-area .quote-area .quote {
height: 100%;
width: 55%;
font-size: 2rem;
@@ -29,7 +29,7 @@
justify-content: space-between;
}
-.rand-quote-gen .play-area .quote-area .page-author{
+.rand-quote-gen .play-area .quote-area .page-author {
margin-left: 30%;
}
@@ -44,7 +44,7 @@
display: flex;
align-items: center;
justify-content: center;
- border:none;
+ border: none;
}
.rand-quote-gen .play-area .change-btn:hover:enabled {
@@ -66,7 +66,7 @@
display: flex;
align-items: center;
justify-content: center;
- border:none;
+ border: none;
}
.rand-quote-gen .play-area .quote-area {
@@ -87,10 +87,10 @@
width: 100%;
}
- .rand-quote-gen .play-area .quote-area .page-author{
+ .rand-quote-gen .play-area .quote-area .page-author {
margin-left: 0;
width: 100%;
- padding: 0 10px 0 10px;
+ padding: 0 10px 0 10px;
}
.rand-quote-gen .play-area .change-btn:hover {
diff --git a/src/plays/random-meme-generator/RandomMemeGenerator.jsx b/src/plays/random-meme-generator/RandomMemeGenerator.jsx
index e495c01dd5..cc48a2660f 100644
--- a/src/plays/random-meme-generator/RandomMemeGenerator.jsx
+++ b/src/plays/random-meme-generator/RandomMemeGenerator.jsx
@@ -6,7 +6,7 @@ import PlayHeader from 'common/playlists/PlayHeader';
import './random-meme-generator.css';
function RandomMemeGenerator(props) {
- // Do not remove the below lines.
+ // Do not remove the below lines.
// The following code is to fetch the current play from the URL
const { id } = props;
const play = getPlayById(id);
@@ -19,26 +19,29 @@ function RandomMemeGenerator(props) {
const getMeme = useCallback(() => {
setIsLoading(true);
- fetch('https://meme-api.herokuapp.com/gimme').then((res) => {
- return res.json();
- }).then((data) => {
- setIsLoading(false)
- if(data.nsfw) {
- getMeme();
- } else {
- console.log(data);
- setMeme((prev) => {
- return data;
- })
- }
- }).catch((err) => {
- console.error(err);
- })
- }, [])
+ fetch('https://meme-api.herokuapp.com/gimme')
+ .then((res) => {
+ return res.json();
+ })
+ .then((data) => {
+ setIsLoading(false);
+ if (data.nsfw) {
+ getMeme();
+ } else {
+ console.log(data);
+ setMeme((prev) => {
+ return data;
+ });
+ }
+ })
+ .catch((err) => {
+ console.error(err);
+ });
+ }, []);
useEffect(() => {
getMeme();
- }, [getMeme])
+ }, [getMeme]);
return (
<>
@@ -46,16 +49,20 @@ function RandomMemeGenerator(props) {
{/* Your Code Starts Here */}
-
- Meme Generator
-
+
Meme Generator
- {meme.url === null || meme.url === undefined ?
:
}
+ {meme.url === null || meme.url === undefined ? (
+
+ ) : (
+
+ )}
- getMeme()}>Generate
+ getMeme()}>
+ Generate
+
{/* Your Code Ends Here */}
@@ -64,4 +71,4 @@ function RandomMemeGenerator(props) {
);
}
-export default RandomMemeGenerator;
\ No newline at end of file
+export default RandomMemeGenerator;
diff --git a/src/plays/random-meme-generator/random-meme-generator.css b/src/plays/random-meme-generator/random-meme-generator.css
index 57e6936350..c4cc28f617 100644
--- a/src/plays/random-meme-generator/random-meme-generator.css
+++ b/src/plays/random-meme-generator/random-meme-generator.css
@@ -1,57 +1,57 @@
.meme-container {
- width: 100%;
- display: flex;
- justify-content: center;
+ width: 100%;
+ display: flex;
+ justify-content: center;
}
.meme {
- width: 80%;
- max-width: 20rem;
- height: auto;
+ width: 80%;
+ max-width: 20rem;
+ height: auto;
}
.meme-generator-title {
- font-family: 'Quicksand', sans-serif;
- font-size: 2rem;
- display: flex;
- justify-content: center;
- margin: 2rem 0;
+ font-family: 'Quicksand', sans-serif;
+ font-size: 2rem;
+ display: flex;
+ justify-content: center;
+ margin: 2rem 0;
}
.generate-meme {
- width: 100%;
- display: flex;
- justify-content: center;
- margin: 2rem 0;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ margin: 2rem 0;
}
.generate-btn {
- display: flex;
- align-items: center;
- padding: 0.7rem 1.2rem;
- font-family: 'Quicksand', sans-serif;
- outline: none;
- background-color: #61DBFB;
- color: black;
- border: none;
- border-radius: 0.5rem;
- cursor: pointer;
+ display: flex;
+ align-items: center;
+ padding: 0.7rem 1.2rem;
+ font-family: 'Quicksand', sans-serif;
+ outline: none;
+ background-color: #61dbfb;
+ color: black;
+ border: none;
+ border-radius: 0.5rem;
+ cursor: pointer;
}
.generate-btn svg {
- margin-left: 0.5rem;
+ margin-left: 0.5rem;
}
.loading {
- animation: rotate 0.5s ease-in-out infinite both;
+ animation: rotate 0.5s ease-in-out infinite both;
}
@keyframes rotate {
- 0% {
- transform: rotate(0deg);
- }
-
- 100% {
- transform: rotate(360deg);
- }
-}
\ No newline at end of file
+ 0% {
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
diff --git a/src/plays/random-meme-generator/readme.md b/src/plays/random-meme-generator/readme.md
index 2416e1e353..666f1be730 100644
--- a/src/plays/random-meme-generator/readme.md
+++ b/src/plays/random-meme-generator/readme.md
@@ -1,4 +1,3 @@
-
# Random Meme Generator
This project demonstrates the use of API in order to fetch random memes!
diff --git a/src/plays/react-todo-app/ReactTodoApp.jsx b/src/plays/react-todo-app/ReactTodoApp.jsx
index 56dcba4ad4..4fb68fb5bf 100644
--- a/src/plays/react-todo-app/ReactTodoApp.jsx
+++ b/src/plays/react-todo-app/ReactTodoApp.jsx
@@ -12,33 +12,32 @@ import Input from './components/Input';
import TodoList from './components/TodoList';
function ReactTodoApp(props) {
- // Do not remove the below lines.
+ // Do not remove the below lines.
// The following code is to fetch the current play from the URL
const { id } = props;
const play = getPlayById(id);
// Your Code Start below.
- const [input, setInput] = useState("");
+ const [input, setInput] = useState('');
const [todos, setTodos] = useState([]);
- const [status, setStatus] = useState("all");
+ const [status, setStatus] = useState('all');
const [filtered, setFiltered] = useState([]);
useEffect(() => {
-
const filterHandler = () => {
switch (status) {
- case "completed":
- setFiltered(todos.filter(todo => todo.completed === true));
+ case 'completed':
+ setFiltered(todos.filter((todo) => todo.completed === true));
break;
- case "uncompleted":
- setFiltered(todos.filter(todo => todo.completed === false));
+ case 'uncompleted':
+ setFiltered(todos.filter((todo) => todo.completed === false));
break;
default:
setFiltered(todos);
break;
}
- }
+ };
filterHandler();
}, [status, todos]);
@@ -53,7 +52,13 @@ function ReactTodoApp(props) {
Todo List
-
+
{/* Your Code Ends Here */}
@@ -63,4 +68,4 @@ function ReactTodoApp(props) {
);
}
-export default ReactTodoApp;
\ No newline at end of file
+export default ReactTodoApp;
diff --git a/src/plays/react-todo-app/Readme.md b/src/plays/react-todo-app/Readme.md
index c79335c24f..2c958f8ecc 100644
--- a/src/plays/react-todo-app/Readme.md
+++ b/src/plays/react-todo-app/Readme.md
@@ -2,13 +2,11 @@
It is a Todo App to made with React to keep track of the tasks you plan to complete within a specific amount of time, most probably a day.
-
## What will you learn?
- Use of `useEffect` hook.
- Event handling for user interaction.
- State management
-
The file `ReactTodoApp` is the main file along with the css and other files in the component folder required to build the Todo App.
-If you want to implement your learnings about states and useEffect hooks try implementing it on your own!
\ No newline at end of file
+If you want to implement your learnings about states and useEffect hooks try implementing it on your own!
diff --git a/src/plays/react-todo-app/components/Input.jsx b/src/plays/react-todo-app/components/Input.jsx
index e338a30396..1dc8f2aed7 100644
--- a/src/plays/react-todo-app/components/Input.jsx
+++ b/src/plays/react-todo-app/components/Input.jsx
@@ -2,40 +2,37 @@ import React from 'react';
import { FaPlusSquare } from 'react-icons/fa';
const Input = ({ input, setInput, todos, setTodos, setStatus }) => {
+ const inputHandler = (e) => {
+ setInput(e.target.value);
+ };
- const inputHandler = (e) => {
- setInput(e.target.value);
+ const submitHandler = (e) => {
+ e.preventDefault();
+ if (input.length > 0) {
+ setTodos([...todos, { text: input, completed: false, id: Math.random() * 1000 }]);
+ setInput('');
}
+ };
- const submitHandler = (e) => {
- e.preventDefault();
- if (input.length > 0) {
- setTodos([
- ...todos, { text: input, completed: false, id: Math.random() * 1000 }
- ]);
- setInput('');
- }
- }
-
- const statusHandler = (e) => {
- setStatus(e.target.value);
- }
+ const statusHandler = (e) => {
+ setStatus(e.target.value);
+ };
- return (
-
-
-
-
-
-
-
- All
- Completed
- Uncompleted
-
-
-
- );
-}
+ return (
+
+
+
+
+
+
+
+ All
+ Completed
+ Uncompleted
+
+
+
+ );
+};
-export default Input;
\ No newline at end of file
+export default Input;
diff --git a/src/plays/react-todo-app/components/Todo.jsx b/src/plays/react-todo-app/components/Todo.jsx
index f133972479..b4bb5b1bb0 100644
--- a/src/plays/react-todo-app/components/Todo.jsx
+++ b/src/plays/react-todo-app/components/Todo.jsx
@@ -3,35 +3,35 @@ import React from 'react';
import { FaCheck, FaTrash } from 'react-icons/fa';
const Todo = ({ text, todo, todos, setTodos }) => {
+ const deleteHandler = () => {
+ setTodos(todos.filter((element) => element.id !== todo.id));
+ };
- const deleteHandler = () => {
- setTodos(todos.filter((element) => element.id !== todo.id))
- }
+ const completeHandler = () => {
+ setTodos(
+ todos.map((item) => {
+ if (item.id === todo.id) {
+ return {
+ ...item,
+ completed: !item.completed
+ };
+ }
+ return item;
+ })
+ );
+ };
- const completeHandler = () => {
- setTodos(todos.map(item => {
- if (item.id === todo.id) {
- return {
- ...item, completed: !item.completed
- }
- }
- return item;
- }))
- }
+ return (
+
+
{text}
+
+
+
+
+
+
+
+ );
+};
- return (
-
-
- {text}
-
-
-
-
-
-
-
-
- )
-}
-
-export default Todo;
\ No newline at end of file
+export default Todo;
diff --git a/src/plays/react-todo-app/components/TodoList.jsx b/src/plays/react-todo-app/components/TodoList.jsx
index 502c0c6707..b945711ea1 100644
--- a/src/plays/react-todo-app/components/TodoList.jsx
+++ b/src/plays/react-todo-app/components/TodoList.jsx
@@ -1,16 +1,16 @@
-import React from 'react'
+import React from 'react';
import Todo from './Todo';
const TodoList = ({ todos, setTodos, filtered }) => {
- return (
-
-
- {filtered.map((todo) => (
-
- ))}
-
-
- );
-}
+ return (
+
+
+ {filtered.map((todo) => (
+
+ ))}
+
+
+ );
+};
-export default TodoList;
\ No newline at end of file
+export default TodoList;
diff --git a/src/plays/react-todo-app/react-todo.css b/src/plays/react-todo-app/react-todo.css
index c4242dfd17..55f1cfe137 100644
--- a/src/plays/react-todo-app/react-todo.css
+++ b/src/plays/react-todo-app/react-todo.css
@@ -1,138 +1,138 @@
.todo-play-body {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- background-image: linear-gradient(0deg, rgba(34, 193, 195, 1) 0%, rgba(253, 187, 45, 1) 100%);
- color: white;
- font-family: "Poppins", sans-serif;
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ background-image: linear-gradient(0deg, rgba(34, 193, 195, 1) 0%, rgba(253, 187, 45, 1) 100%);
+ color: white;
+ font-family: 'Poppins', sans-serif;
}
.todo-top-banner {
- font-size: 2rem;
+ font-size: 2rem;
}
.todo-top-banner,
.react-todo-form {
- min-height: 20vh;
- display: flex;
- justify-content: center;
- align-items: center;
+ min-height: 20vh;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
.react-todo-form input,
.react-todo-form button {
- padding: 0.5rem;
- font-size: 1.2rem;
- border: none;
- background: white;
+ padding: 0.5rem;
+ font-size: 1.2rem;
+ border: none;
+ background: white;
}
.react-todo-form button {
- color: #ff6f47;
- background: #f7fffe;
- cursor: pointer;
- transition: all 0.3s ease;
+ color: #ff6f47;
+ background: #f7fffe;
+ cursor: pointer;
+ transition: all 0.3s ease;
}
.react-todo-form button:hover {
- background: #ff6f47;
- color: white;
+ background: #ff6f47;
+ color: white;
}
.todo-container {
- display: flex;
- justify-content: center;
- align-items: center;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
.todo-list {
- min-width: 30%;
- list-style: none;
+ min-width: 30%;
+ list-style: none;
}
.todo {
- margin: 0.5rem;
- background: white;
- font-size: 1.5rem;
- color: black;
- display: flex;
- justify-content: space-between;
- align-items: center;
- transition: all 1s ease;
+ margin: 0.5rem;
+ background: white;
+ font-size: 1.5rem;
+ color: black;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ transition: all 1s ease;
}
.filter-todo {
- padding: 0.8rem;
+ padding: 0.8rem;
}
.todo li {
- flex: 1;
+ flex: 1;
}
.trash-btn,
.complete-btn {
- background: #ff6f47;
- color: white;
- border: none;
- padding: 0.5rem;
- cursor: pointer;
- font-size: 1rem;
+ background: #ff6f47;
+ color: white;
+ border: none;
+ padding: 0.5rem;
+ cursor: pointer;
+ font-size: 1rem;
}
.complete-btn {
- background: rgb(11, 212, 162);
+ background: rgb(11, 212, 162);
}
.todo-item {
- padding: 0rem 0.5rem;
+ padding: 0rem 0.5rem;
}
.fa-trash,
.fa-check {
- pointer-events: none;
+ pointer-events: none;
}
.fall {
- transform: translateY(10rem) rotateZ(20deg);
- opacity: 0;
+ transform: translateY(10rem) rotateZ(20deg);
+ opacity: 0;
}
.completed {
- text-decoration: line-through;
- opacity: 0.5;
+ text-decoration: line-through;
+ opacity: 0.5;
}
/*CUSTOM SELECTOR */
.select-todo .options {
- -webkit-appearance: none;
- -moz-appearance: none;
- -ms-appearance: none;
- appearance: none;
- outline: 0;
- box-shadow: none;
- border: 0 !important;
- background-image: none;
- color: #ff6f47;
- font-family: "Poppins", sans-serif;
- cursor: pointer;
- width: 12rem;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ -ms-appearance: none;
+ appearance: none;
+ outline: 0;
+ box-shadow: none;
+ border: 0 !important;
+ background-image: none;
+ color: #ff6f47;
+ font-family: 'Poppins', sans-serif;
+ cursor: pointer;
+ width: 12rem;
}
/* Custom Select */
.select-todo {
- margin: 1rem;
- position: relative;
- overflow: hidden;
+ margin: 1rem;
+ position: relative;
+ overflow: hidden;
}
/* Arrow */
.select-todo::after {
- content: "\25BC";
- position: absolute;
- top: 0;
- right: 0;
- padding: 0.75rem;
- background: #ff6f47;
- cursor: pointer;
- pointer-events: none;
-}
\ No newline at end of file
+ content: '\25BC';
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: 0.75rem;
+ background: #ff6f47;
+ cursor: pointer;
+ pointer-events: none;
+}
diff --git a/src/plays/registration-form/RegistrationForm.jsx b/src/plays/registration-form/RegistrationForm.jsx
index d55cec4f33..7d919ebbd4 100644
--- a/src/plays/registration-form/RegistrationForm.jsx
+++ b/src/plays/registration-form/RegistrationForm.jsx
@@ -1,8 +1,8 @@
-import { getPlayById } from "meta/play-meta-util";
+import { getPlayById } from 'meta/play-meta-util';
-import PlayHeader from "common/playlists/PlayHeader";
-import "./Registration-form.css";
-import { useState } from "react";
+import PlayHeader from 'common/playlists/PlayHeader';
+import './Registration-form.css';
+import { useState } from 'react';
function RegistrationForm(props) {
// Do not remove the below lines.
@@ -14,29 +14,29 @@ function RegistrationForm(props) {
//for input values
const [values, setValues] = useState({
- name: "",
- email: "",
- password: "",
- confirmPassword: "",
+ name: '',
+ email: '',
+ password: '',
+ confirmPassword: '',
errors: {
- name: "",
- email: "",
- password: "",
- confirmPassword: "",
- },
+ name: '',
+ email: '',
+ password: '',
+ confirmPassword: ''
+ }
});
//input values after submit
const [storedValues, setStoredValues] = useState({
- name: "",
- email: "",
- password: "",
- confirmPassword: "",
+ name: '',
+ email: '',
+ password: '',
+ confirmPassword: ''
});
//self explanatory
const validateEmail = (emailvalue) => {
- if (emailvalue[0] === "email") {
+ if (emailvalue[0] === 'email') {
const regx = /\S+@\S+\.\S+/;
if (!regx.test(emailvalue[1])) {
//set error and return false
@@ -44,8 +44,8 @@ function RegistrationForm(props) {
...prevState,
errors: {
...prevState.errors,
- email: `your email is not correct`,
- },
+ email: `your email is not correct`
+ }
}));
return false;
} else {
@@ -54,8 +54,8 @@ function RegistrationForm(props) {
...prevState,
errors: {
...prevState.errors,
- email: ``,
- },
+ email: ``
+ }
}));
return true;
}
@@ -67,8 +67,8 @@ function RegistrationForm(props) {
//self explanatory
const conmparePassword = (pass, confirmPass) => {
// (pass and confirmPass) arrays containing name, value pair eg. ["password","xyz"] and ["confirmpassword","xyz"]
- if (pass[0] === "password") {
- if (values.confirmPassword !== "") {
+ if (pass[0] === 'password') {
+ if (values.confirmPassword !== '') {
if (pass[1] !== confirmPass[1]) {
//values don't match set error, return false
setValues((prevState) => ({
@@ -76,8 +76,8 @@ function RegistrationForm(props) {
errors: {
...prevState.errors,
password: "Password doesn't match",
- confirmPassword: "Password doesn't match",
- },
+ confirmPassword: "Password doesn't match"
+ }
}));
return false;
} else {
@@ -86,9 +86,9 @@ function RegistrationForm(props) {
...prevState,
errors: {
...prevState.errors,
- password: "",
- confirmPassword: "",
- },
+ password: '',
+ confirmPassword: ''
+ }
}));
return true;
}
@@ -103,14 +103,14 @@ function RegistrationForm(props) {
//final validation
const validate = (value) => {
//value is an array ex. ["name","deepak"]
- if (value[1] === "") {
+ if (value[1] === '') {
//if empty set error msg return false
setValues((prevState) => ({
...prevState,
errors: {
...prevState.errors,
- [value[0]]: `Please fill the ${value[0]}`,
- },
+ [value[0]]: `Please fill the ${value[0]}`
+ }
}));
return false;
} else {
@@ -119,13 +119,10 @@ function RegistrationForm(props) {
...prevState,
errors: {
...prevState.errors,
- [value[0]]: ``,
- },
+ [value[0]]: ``
+ }
}));
- return (
- validateEmail(value) &&
- conmparePassword(value, Object.entries(values)[3])
- );
+ return validateEmail(value) && conmparePassword(value, Object.entries(values)[3]);
}
};
@@ -146,14 +143,14 @@ function RegistrationForm(props) {
name: values.name,
email: values.email,
password: values.password,
- confirmPassword: values.confirmPassword,
+ confirmPassword: values.confirmPassword
});
setValues({
- name: "",
- email: "",
- password: "",
- confirmPassword: "",
- errors: { name: "", email: "", password: "", confirmPassword: "" },
+ name: '',
+ email: '',
+ password: '',
+ confirmPassword: '',
+ errors: { name: '', email: '', password: '', confirmPassword: '' }
});
}
};
@@ -179,28 +176,20 @@ function RegistrationForm(props) {
{value[0]}*
{values.errors[value[0]]}
@@ -210,11 +199,7 @@ function RegistrationForm(props) {
Submit
-
+
Form Submitted !
{Object.entries(storedValues).map((storedValue, index) => {
diff --git a/src/plays/social-card/CardDetails.jsx b/src/plays/social-card/CardDetails.jsx
index 5a2d4d70ba..116e97aa46 100644
--- a/src/plays/social-card/CardDetails.jsx
+++ b/src/plays/social-card/CardDetails.jsx
@@ -1,28 +1,27 @@
-import { useState, useContext, useEffect } from "react";
-import { SocialContext } from "./context/SocialContext";
-import { BsGithub, BsTwitter, BsLinkedin } from "react-icons/bs";
-import { CgWebsite } from "react-icons/cg";
-import { AiOutlineMail } from "react-icons/ai";
+import { useState, useContext, useEffect } from 'react';
+import { SocialContext } from './context/SocialContext';
+import { BsGithub, BsTwitter, BsLinkedin } from 'react-icons/bs';
+import { CgWebsite } from 'react-icons/cg';
+import { AiOutlineMail } from 'react-icons/ai';
const CardDetails = () => {
// Get the user-filled values from the context
const { social } = useContext(SocialContext);
// Destructure the values from the object.
- const { name, email, photo, bio, website, twitter, linkedIn, github } =
- social;
+ const { name, email, photo, bio, website, twitter, linkedIn, github } = social;
// We need a file reader to handle the photo uploaded by the user.
// We have to perform some computations and extract the actual picture
- // from the file. So created a state variable to take care of this.
+ // from the file. So created a state variable to take care of this.
const [picture, setPicture] = useState();
// We have an option to set the theme of the social card.
// This state variable is the theme object.
const [cardTheme, setCardTheme] = useState({
- bc: "#f2d6d6",
- fc: "#212121",
- link: "#000000",
+ bc: '#f2d6d6',
+ fc: '#212121',
+ link: '#000000'
});
// Perform all calculations to get the profile photo
@@ -38,65 +37,64 @@ const CardDetails = () => {
}, [photo]);
// This method will be called when the user changes the theme
- const applyTheme = theme => {
+ const applyTheme = (theme) => {
let bc = '';
let fc = '';
let link = '';
switch (theme) {
- case "dark":
+ case 'dark':
bc = '#212121';
fc = '#f2d6d6';
link = '#ffffff';
break;
- case "light":
+ case 'light':
bc = '#f2d6d6';
fc = '#212121';
link = '#000000';
break;
- case "red":
+ case 'red':
bc = '#f44336';
fc = '#ffffff';
link = '#ffffff';
break;
- case "green":
+ case 'green':
bc = '#4caf50';
fc = '#ffffff';
link = '#ffffff';
break;
- case "blue":
+ case 'blue':
bc = '#2196f3';
fc = '#ffffff';
link = '#ffffff';
break;
- case "yellow":
+ case 'yellow':
bc = '#ffeb3b';
fc = '#000000';
link = '#000000';
- break;
+ break;
default:
break;
}
setCardTheme({
...cardTheme,
- 'bc': bc,
- 'fc': fc,
- 'link': link
+ bc: bc,
+ fc: fc,
+ link: link
});
- }
+ };
return (
- applyTheme("light") }>
- applyTheme("dark")}>
- applyTheme("red")}>
- applyTheme("blue")}>
- applyTheme("yellow")}>
- applyTheme("green")}>
+ applyTheme('light')}>
+ applyTheme('dark')}>
+ applyTheme('red')}>
+ applyTheme('blue')}>
+ applyTheme('yellow')}>
+ applyTheme('green')}>
-
-
+
{picture && (
@@ -114,35 +112,55 @@ const CardDetails = () => {
{twitter && (
)}
{linkedIn && (
)}
{github && (
)}
{website && (
)}
{email && (
diff --git a/src/plays/social-card/CardForm.jsx b/src/plays/social-card/CardForm.jsx
index b23f4e10b3..c587bfb623 100644
--- a/src/plays/social-card/CardForm.jsx
+++ b/src/plays/social-card/CardForm.jsx
@@ -1,18 +1,18 @@
-import { useState, useContext, useEffect, useRef } from "react";
-import { SocialContext } from "./context/SocialContext";
+import { useState, useContext, useEffect, useRef } from 'react';
+import { SocialContext } from './context/SocialContext';
const CardForm = () => {
// Declaring the state value with an object that contains
// all the information of the social card.
const [state, setState] = useState({
- name: "",
- email: "",
- photo: "",
- bio: "",
- website: "",
- twitter: "",
- linkedIn: "",
- github: "",
+ name: '',
+ email: '',
+ photo: '',
+ bio: '',
+ website: '',
+ twitter: '',
+ linkedIn: '',
+ github: ''
});
// We get the updater function from the context.
@@ -20,7 +20,7 @@ const CardForm = () => {
// so that, other component can access it.
const { setSocial } = useContext(SocialContext);
- // We create a reference to focus on the
+ // We create a reference to focus on the
// first input field of the form.
const nameInputRef = useRef(null);
@@ -29,11 +29,10 @@ const CardForm = () => {
// note how we handle the file input differently.
const handleChange = (evt) => {
const name = evt.target.name;
- const value =
- evt.target.type === "file" ? evt.target.files : evt.target.value;
+ const value = evt.target.type === 'file' ? evt.target.files : evt.target.value;
setState({
...state,
- [name]: value,
+ [name]: value
});
};
@@ -53,7 +52,7 @@ const CardForm = () => {
-
+
Create your Social Card
Please fill the form below to create a Social Card for you.
@@ -42,4 +42,4 @@ function SocialCard(props) {
);
}
-export default SocialCard;
\ No newline at end of file
+export default SocialCard;
diff --git a/src/plays/social-card/context/SocialContext.js b/src/plays/social-card/context/SocialContext.js
index 278b4b7f33..4936b14f15 100644
--- a/src/plays/social-card/context/SocialContext.js
+++ b/src/plays/social-card/context/SocialContext.js
@@ -1,8 +1,8 @@
import React from 'react';
-// Creating the context here to hold the social card data and
+// Creating the context here to hold the social card data and
// the function to update the data.
export const SocialContext = React.createContext({
- social: {},
+ social: {},
setSocial: () => {}
-});
\ No newline at end of file
+});
diff --git a/src/plays/social-card/social-card.css b/src/plays/social-card/social-card.css
index 46364ce4bd..bd8f819780 100644
--- a/src/plays/social-card/social-card.css
+++ b/src/plays/social-card/social-card.css
@@ -1,8 +1,8 @@
.social-card {
display: flex;
align-items: center;
- justify-content: center;
- padding: 1rem;
+ justify-content: center;
+ padding: 1rem;
}
.social-card-form {
@@ -32,7 +32,7 @@
box-shadow: none;
}
-.card-details{
+.card-details {
margin: 0 0 0 1rem;
}
@@ -48,7 +48,7 @@
width: 1.2rem;
height: 1.2rem;
margin: 0 0.3rem 0 0;
- border-radius:5px;
+ border-radius: 5px;
}
.card-details-theme button.red {
@@ -114,7 +114,7 @@
margin: 0;
}
-.card .card-header .card-header-image img{
+.card .card-header .card-header-image img {
display: flex;
flex-direction: column;
align-items: center;
@@ -158,14 +158,12 @@
padding: 5px;
}
-
@media only screen and (max-width: 760px) {
.social-card {
flex-direction: column;
}
- .card-details{
+ .card-details {
margin: 1rem 0 0 0;
}
}
-
diff --git a/src/plays/states/Readme.md b/src/plays/states/Readme.md
index a3f9b2d62d..bd4e15a461 100644
--- a/src/plays/states/Readme.md
+++ b/src/plays/states/Readme.md
@@ -1,9 +1,10 @@
The `States Play` demonstrates the following concepts in React:
+
1. State & State Management in functional components.
2. useState Hook
3. Event Handling
4. Object Destructing
-This play has two input fields that asks the user for a Name and the duration. Once provides the necessary inputs and click on Submit, a message is displayed on the right side.
+This play has two input fields that asks the user for a Name and the duration. Once provides the necessary inputs and click on Submit, a message is displayed on the right side.
Message is `Welcome to State Play, {name}` where name will be the name value provided by the user. This message will be displayed for `duration` seconds provided by the user.
Once the `duration` amount of seconds are over, the input fields will be reset and the message on right side will disappear. If the user leaves any field blank the submit button won't be functional.
diff --git a/src/plays/states/States.jsx b/src/plays/states/States.jsx
index 1631c0f5e4..5aed595ba0 100644
--- a/src/plays/states/States.jsx
+++ b/src/plays/states/States.jsx
@@ -1,7 +1,7 @@
-import { useState } from "react";
-import { getPlayById } from "meta/play-meta-util";
-import PlayHeader from "common/playlists/PlayHeader";
-import "./states.css";
+import { useState } from 'react';
+import { getPlayById } from 'meta/play-meta-util';
+import PlayHeader from 'common/playlists/PlayHeader';
+import './states.css';
function States(props) {
// Do not remove the below lines.
@@ -10,19 +10,19 @@ function States(props) {
const play = getPlayById(id);
// Your Code Start below.
- const [name, setName] = useState("");
+ const [name, setName] = useState('');
const [display, setDisplay] = useState(false);
const [duration, setDuration] = useState(0);
const handleSubmit = (e) => {
- e.preventDefault()
- if(!name && !duration) {
- return
+ e.preventDefault();
+ if (!name && !duration) {
+ return;
}
setDisplay(true);
setTimeout(() => {
setDisplay(false);
- setName("");
+ setName('');
setDuration(0);
}, duration * 1000);
};
@@ -44,15 +44,13 @@ function States(props) {
States - Details about Component
- State is an inbuilt object of React which stores data/information
- about the component. State of the component can change over time.
- Change in state of the component causes re-rendering of the
- component. This change of State is Asynchronous.
+ State is an inbuilt object of React which stores data/information about the component.
+ State of the component can change over time. Change in state of the component causes
+ re-rendering of the component. This change of State is Asynchronous.
-
Enter a Name and Duration in Seconds for which you want to
- display a Message.
+
Enter a Name and Duration in Seconds for which you want to display a Message.
-
handleSubmit(e)}
- >
+ handleSubmit(e)}>
Submit
-
+
{!display ? (
-
Enter Details of the Message
+
Enter Details of the Message
) : (
-
Welcome to State Play, {name}
+
Welcome to State Play, {name}
)}
diff --git a/src/plays/states/states.css b/src/plays/states/states.css
index 88373ce3bf..19d16a0d8e 100644
--- a/src/plays/states/states.css
+++ b/src/plays/states/states.css
@@ -1,4 +1,5 @@
-.play-area, .play-area-result{
+.play-area,
+.play-area-result {
width: 100%;
display: flex;
flex-direction: column;
@@ -39,7 +40,7 @@
border-radius: 1rem;
}
-@media only screen and (max-width: 760px) {
+@media only screen and (max-width: 760px) {
.play-area-container {
display: flex;
flex-direction: column;
@@ -54,4 +55,4 @@
margin-left: 0.5rem;
margin-top: 1.5rem;
}
-}
\ No newline at end of file
+}
diff --git a/src/plays/tic-tac-toe-game/Readme.md b/src/plays/tic-tac-toe-game/Readme.md
index c37197340d..70c41e46d9 100644
--- a/src/plays/tic-tac-toe-game/Readme.md
+++ b/src/plays/tic-tac-toe-game/Readme.md
@@ -2,7 +2,6 @@
It is a Tic Tac Toe Game to made with React.
-
## What will you learn?
- Functional Components
@@ -11,7 +10,6 @@ It is a Tic Tac Toe Game to made with React.
- How to reuse the components.(e.g we reused our game square button many times).
- How to reset the states.
-
The file `TicTacToeGAme` is the main file along with the css.
-If you want to implement your learnings about states and useEffect hooks try implementing it on your own!
\ No newline at end of file
+If you want to implement your learnings about states and useEffect hooks try implementing it on your own!
diff --git a/src/plays/tic-tac-toe-game/TicTacToeGame.jsx b/src/plays/tic-tac-toe-game/TicTacToeGame.jsx
index 67440fcc06..7ca2fce9f2 100644
--- a/src/plays/tic-tac-toe-game/TicTacToeGame.jsx
+++ b/src/plays/tic-tac-toe-game/TicTacToeGame.jsx
@@ -2,14 +2,14 @@ import { getPlayById } from 'meta/play-meta-util';
import PlayHeader from 'common/playlists/PlayHeader';
-import React from "react";
+import React from 'react';
-import Game from "./components/Game.jsx"
+import Game from './components/Game.jsx';
-import "./styles/tic-tac-toe-tj.css";
+import './styles/tic-tac-toe-tj.css';
function TicTacToeGame(props) {
- // Do not remove the below lines.
+ // Do not remove the below lines.
// The following code is to fetch the current play from the URL
const { id } = props;
const play = getPlayById(id);
@@ -20,13 +20,13 @@ function TicTacToeGame(props) {
- {/* Your Code Starts Here */}
-
- {/* Your Code Ends Here */}
+ {/* Your Code Starts Here */}
+
+ {/* Your Code Ends Here */}
>
);
}
-export default TicTacToeGame;
\ No newline at end of file
+export default TicTacToeGame;
diff --git a/src/plays/tic-tac-toe-game/components/Game.jsx b/src/plays/tic-tac-toe-game/components/Game.jsx
index 33b2658403..379846b3bf 100644
--- a/src/plays/tic-tac-toe-game/components/Game.jsx
+++ b/src/plays/tic-tac-toe-game/components/Game.jsx
@@ -1,8 +1,11 @@
-import React, { useState } from "react";
+import React, { useState } from 'react';
function Square(props) {
return (
-
+
{props.value}
);
@@ -19,11 +22,10 @@ function Game() {
const [squares, setSquares] = useState(Array(9).fill(null));
const [isXNext, setIsXNext] = useState(true);
- const nextSymbol = isXNext ? "X" : "O";
+ const nextSymbol = isXNext ? 'X' : 'O';
const winner = calculateWinner(squares);
-
function renderSquare(i) {
return (
-
-
- {renderRow(0)}
- {renderRow(3)}
- {renderRow(6)}
-
+
+
+ {renderRow(0)}
+ {renderRow(3)}
+ {renderRow(6)}
+
{getStatus()}
{renderRestartButton()}
@@ -97,12 +99,12 @@ function calculateWinner(squares) {
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
- [2, 4, 6],
+ [2, 4, 6]
];
for (let i = 0; i < possibleLines.length; i++) {
const [a, b, c] = possibleLines[i];
if (squares[a] && squares[a] === squares[b] && squares[a] === squares[c]) {
- return {player:squares[a], line:[a, b, c]};
+ return { player: squares[a], line: [a, b, c] };
}
}
return null;
diff --git a/src/plays/tic-tac-toe-game/styles/tic-tac-toe-tj.css b/src/plays/tic-tac-toe-game/styles/tic-tac-toe-tj.css
index 2cc5ed5861..746447b6a5 100644
--- a/src/plays/tic-tac-toe-game/styles/tic-tac-toe-tj.css
+++ b/src/plays/tic-tac-toe-game/styles/tic-tac-toe-tj.css
@@ -1,70 +1,69 @@
-.tic-tac-toe-tj .container{
- text-align: center;
+.tic-tac-toe-tj .container {
+ text-align: center;
}
+.tic-tac-toe-tj .squareButton {
+ width: 5rem;
+ height: 5rem;
+ margin: 1px;
+ background-color: #ec4899;
-.tic-tac-toe-tj .squareButton{
- width: 5rem;
- height: 5rem;
- margin: 1px;
- background-color: #EC4899;
+ display: inline-flex;
+ justify-content: center;
+ align-items: center;
- display: inline-flex;
- justify-content: center;
- align-items: center;
-
- border: none;
- font: bold;
- font-size: 32px;
- color: white;
+ border: none;
+ font: bold;
+ font-size: 32px;
+ color: white;
}
-.tic-tac-toe-tj .squareButton:hover{
- background-color: #10B981;
+.tic-tac-toe-tj .squareButton:hover {
+ background-color: #10b981;
}
-.tic-tac-toe-tj .row{
- display: flex;
+.tic-tac-toe-tj .row {
+ display: flex;
}
-.tic-tac-toe-tj .jumpButton{
- padding: 0.5rem 1rem;
- background-color: #10B981;
+.tic-tac-toe-tj .jumpButton {
+ padding: 0.5rem 1rem;
+ background-color: #10b981;
+
+ display: inline-flex;
+ justify-content: center;
+ align-items: center;
- display: inline-flex;
- justify-content: center;
- align-items: center;
-
- border: none;
- color: white;
- font-size: 18px;
- border-radius: 4px;
- margin-top: 1rem;
+ border: none;
+ color: white;
+ font-size: 18px;
+ border-radius: 4px;
+ margin-top: 1rem;
}
-.tic-tac-toe-tj .bg-yellow-500{
- background-color: #f59e0b;
+.tic-tac-toe-tj .bg-yellow-500 {
+ background-color: #f59e0b;
}
-.tic-tac-toe-tj .jumpButton:hover{
- background-color: #EC4899;
+.tic-tac-toe-tj .jumpButton:hover {
+ background-color: #ec4899;
}
-.tic-tac-toe-tj .list{
- margin-top: 1rem;
+.tic-tac-toe-tj .list {
+ margin-top: 1rem;
}
-.tic-tac-toe-tj .status{
- margin-top: 1rem;
- font-size: 24px;
+.tic-tac-toe-tj .status {
+ margin-top: 1rem;
+ font-size: 24px;
}
-.tic-tac-toe-tj .header{
- width: 100%;
- padding: 16px 8px;
- color: white;
- font-size: 24px;
-
- display: grid;
- place-content: center;
+.tic-tac-toe-tj .header {
+ width: 100%;
+ padding: 16px 8px;
+ color: white;
+ font-size: 24px;
- background-color: #010326;
- margin-bottom: 2rem;
+ display: grid;
+ place-content: center;
+
+ background-color: #010326;
+ margin-bottom: 2rem;
}
-.tic-tac-toe-tj .boardMain{
- display: grid;
- place-content: center;
-}
\ No newline at end of file
+.tic-tac-toe-tj .boardMain {
+ display: grid;
+ place-content: center;
+}
diff --git a/src/plays/why-react/WhyReact.jsx b/src/plays/why-react/WhyReact.jsx
index 0b1aa634b9..36854132b8 100644
--- a/src/plays/why-react/WhyReact.jsx
+++ b/src/plays/why-react/WhyReact.jsx
@@ -1,19 +1,19 @@
-import PlayHeader from "common/playlists/PlayHeader";
-import { useState } from "react";
-import { getPlayById } from "meta/play-meta-util";
-import "./why-react.css";
+import PlayHeader from 'common/playlists/PlayHeader';
+import { useState } from 'react';
+import { getPlayById } from 'meta/play-meta-util';
+import './why-react.css';
const WhyReact = ({ id }) => {
// The following code is to fetch the current play from the URL
const play = getPlayById(id);
const [reasons] = useState([
- "React is Declarative",
- "It is fast",
- "JSX is simple",
- "It is Component-based",
- "It is easy to learn",
- "It is fun to use",
- "Write Once, Use Everywhere",
+ 'React is Declarative',
+ 'It is fast',
+ 'JSX is simple',
+ 'It is Component-based',
+ 'It is easy to learn',
+ 'It is fun to use',
+ 'Write Once, Use Everywhere'
]);
return (
@@ -22,9 +22,8 @@ const WhyReact = ({ id }) => {
- React is a JavaScript library for building user interfaces. It is
- maintained by Facebook and a community of individual
- developers and companies.
+ React is a JavaScript library for building user interfaces. It is maintained by{' '}
+ Facebook and a community of individual developers and companies.
diff --git a/src/plays/why-react/why-react.css b/src/plays/why-react/why-react.css
index 2258fe2639..5d951d47b4 100644
--- a/src/plays/why-react/why-react.css
+++ b/src/plays/why-react/why-react.css
@@ -1,4 +1,4 @@
.heading {
font-size: 1.5em;
- color: rgb(29, 91, 223)
-}
\ No newline at end of file
+ color: rgb(29, 91, 223);
+}
diff --git a/src/plays/why-typescript/Readme.md b/src/plays/why-typescript/Readme.md
index b67afcf40e..9e4f72e5ed 100644
--- a/src/plays/why-typescript/Readme.md
+++ b/src/plays/why-typescript/Readme.md
@@ -1,4 +1,5 @@
# Why Typescript
+
The `Why Typescript` project shows how `TypeScript` can be used .
- It uses simple concept of interface.
diff --git a/src/plays/why-typescript/WhyTypescript.tsx b/src/plays/why-typescript/WhyTypescript.tsx
index 31e8784bc2..45a9f04305 100644
--- a/src/plays/why-typescript/WhyTypescript.tsx
+++ b/src/plays/why-typescript/WhyTypescript.tsx
@@ -1,9 +1,9 @@
-import * as React from "react";
-import { getPlayById } from "meta/play-meta-util";
+import * as React from 'react';
+import { getPlayById } from 'meta/play-meta-util';
-import PlayHeader from "common/playlists/PlayHeader";
-import Wizard from "./wizard";
-import data from "./data.json";
+import PlayHeader from 'common/playlists/PlayHeader';
+import Wizard from './wizard';
+import data from './data.json';
function WhyTypescript(props: any) {
// Do not remove the below lines.
diff --git a/src/plays/why-typescript/data.json b/src/plays/why-typescript/data.json
index 06dd6c513a..01387f4602 100644
--- a/src/plays/why-typescript/data.json
+++ b/src/plays/why-typescript/data.json
@@ -1,31 +1,34 @@
-[{
+[
+ {
"title": "General",
"details": [
- "A powerful type system that includes generics.",
- "TypeScript is nothing but JavaScript with some additional features.",
- "It is Structural, rather than nominal way of processing"
+ "A powerful type system that includes generics.",
+ "TypeScript is nothing but JavaScript with some additional features.",
+ "It is Structural, rather than nominal way of processing"
]
-},{
+ },
+ {
"title": "Power",
"details": [
- "TypeScript provides highly productive development tools for JavaScript IDEs and practices, like static checking.",
- "TypeScript makes code easier to read and understand.",
- "TypeScript gives us all the benefits of ES6 (ECMAScript 6), plus more productivity."
-
+ "TypeScript provides highly productive development tools for JavaScript IDEs and practices, like static checking.",
+ "TypeScript makes code easier to read and understand.",
+ "TypeScript gives us all the benefits of ES6 (ECMAScript 6), plus more productivity."
]
-},{
+ },
+ {
"title": "Friendlyness",
"details": [
- "TypeScript can help us to avoid painful bugs that developers commonly run into when writing JavaScript by type checking the code",
- "Typescript is aligned with ECMAScript for compatibility.",
- "TypeScript code can be compiled as per ES5 and ES6 standards to support the latest browser."
-
+ "TypeScript can help us to avoid painful bugs that developers commonly run into when writing JavaScript by type checking the code",
+ "Typescript is aligned with ECMAScript for compatibility.",
+ "TypeScript code can be compiled as per ES5 and ES6 standards to support the latest browser."
]
-},{
+ },
+ {
"title": "Features",
"details": [
- "TypeScript simplifies JavaScript code, making it easier to read and debug.",
- "With TypeScript, we can make a huge improvement over plain JavaScript.",
- "A feature rich language that supports static typing."
+ "TypeScript simplifies JavaScript code, making it easier to read and debug.",
+ "With TypeScript, we can make a huge improvement over plain JavaScript.",
+ "A feature rich language that supports static typing."
]
-}]
\ No newline at end of file
+ }
+]
diff --git a/src/plays/why-typescript/wizard/index.css b/src/plays/why-typescript/wizard/index.css
index 12994fe889..773811f02f 100644
--- a/src/plays/why-typescript/wizard/index.css
+++ b/src/plays/why-typescript/wizard/index.css
@@ -1,4 +1,3 @@
-
.ol-cards,
.ol-cards * {
margin: 0;
@@ -13,7 +12,7 @@
}
.wizard-container--core {
- flex: 1
+ flex: 1;
}
.wizard-container--buttons {
@@ -48,10 +47,9 @@
counter-reset: ol-cards-count;
list-style: none;
}
-.ol-cards li {
+.ol-cards li {
display: grid;
- grid-template-areas:
- "icon descr nr";
+ grid-template-areas: 'icon descr nr';
gap: 0 var(--colGapSize);
align-items: center;
padding: var(--colGapSize) var(--flapWidth) var(--colGapSize) 0;
@@ -62,9 +60,9 @@
box-shadow: inset 2px 2px 2px white, inset -1px -1px 1px rgba(0, 0, 0, 0.25);
}
-.ol-cards li > .icon {
+.ol-cards li > .icon {
grid-area: icon;
- background:#EE5830;
+ background: #ee5830;
color: white;
font-size: var(--iconSize);
width: calc(2 * var(--flapWidth) + var(--iconSize));
@@ -76,26 +74,17 @@
display: grid;
place-items: center;
}
-.ol-cards li > .icon::before {
- content: "";
+.ol-cards li > .icon::before {
+ content: '';
position: absolute;
width: var(--flapWidth);
height: calc(100% + calc(var(--flapHeigth) * 2));
left: 0;
top: calc(var(--flapHeigth) * -1);
- clip-path: polygon(
- 0 var(--flapHeigth),
- 100% 0,
- 100% 100%,
- 0 calc(100% - var(--flapHeigth))
- );
- background-color:#EE5830;
- background-image: linear-gradient(
- 90deg,
- rgba(0, 0, 0, 0.5),
- rgba(0, 0, 0, 0.2)
- );
+ clip-path: polygon(0 var(--flapHeigth), 100% 0, 100% 100%, 0 calc(100% - var(--flapHeigth)));
+ background-color: #ee5830;
+ background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.2));
z-index: -1;
}
@@ -103,10 +92,10 @@
grid-area: descr;
width: 100%;
}
-.ol-cards li::after {
+.ol-cards li::after {
grid-area: nr;
content: counter(ol-cards-count, decimal-leading-zero);
- color:#EE5830;
+ color: #ee5830;
font-size: var(--numberSize);
font-weight: 700;
}
@@ -120,9 +109,8 @@
}
}
-
.s-button span {
- background: #FFF;
+ background: #fff;
display: block;
padding: 5px 15px;
border-radius: 5px;
@@ -139,7 +127,7 @@
.s-button {
position: relative;
float: left;
- font: normal 14px/15px "Patrick Hand", sans-serif;
+ font: normal 14px/15px 'Patrick Hand', sans-serif;
margin-right: 10px;
text-transform: uppercase;
color: #000;
@@ -155,8 +143,8 @@
cursor: not-allowed;
}
-.s-button:disabled span{
- background-color: #ABABAB;
+.s-button:disabled span {
+ background-color: #ababab;
}
.page-container {
@@ -167,5 +155,5 @@
}
.page-container h1 {
- color: #EE5830;
-}
\ No newline at end of file
+ color: #ee5830;
+}
diff --git a/src/plays/why-typescript/wizard/index.tsx b/src/plays/why-typescript/wizard/index.tsx
index 6c55bc757c..ee7c1ce731 100644
--- a/src/plays/why-typescript/wizard/index.tsx
+++ b/src/plays/why-typescript/wizard/index.tsx
@@ -1,7 +1,7 @@
-import * as React from "react";
-import Page from "./page";
-import { WizardData } from "./contract";
-import "./index.css";
+import * as React from 'react';
+import Page from './page';
+import { WizardData } from './contract';
+import './index.css';
const Wizard = (props: any) => {
const title: String = props.title;
@@ -21,17 +21,11 @@ const Wizard = (props: any) => {
<>
- {wizData && wizData.pages.length > 0 ? (
-
- ) : null}
+ {wizData && wizData.pages.length > 0 ?
: null}
- prevPage()}
- disabled={index === 0}
- >
+ prevPage()} disabled={index === 0}>
< Previous
{
- This play has been created using TypeScript. It aims to give a pointer
- to typescript, not to elaborate the usage.
+ This play has been created using TypeScript. It aims to give a pointer to typescript, not
+ to elaborate the usage.
>
diff --git a/src/plays/why-typescript/wizard/page.tsx b/src/plays/why-typescript/wizard/page.tsx
index e320aadfc9..0cd37e9bc7 100644
--- a/src/plays/why-typescript/wizard/page.tsx
+++ b/src/plays/why-typescript/wizard/page.tsx
@@ -1,6 +1,6 @@
-import * as React from "react";
-import { AppProps, IPageData } from "./contract";
-import "./index.css";
+import * as React from 'react';
+import { AppProps, IPageData } from './contract';
+import './index.css';
const Page = (props: AppProps) => {
const data: IPageData = props.pagedata;
diff --git a/src/reportWebVitals.js b/src/reportWebVitals.js
index 5253d3ad9e..532f29b0bb 100644
--- a/src/reportWebVitals.js
+++ b/src/reportWebVitals.js
@@ -1,4 +1,4 @@
-const reportWebVitals = onPerfEntry => {
+const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
diff --git a/tsconfig.json b/tsconfig.json
index c6a772a827..071be1cbde 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,16 +1,16 @@
{
- "compilerOptions": {
- "jsx": "react",
- "baseUrl": "src",
- "outDir": "./dist/",
- "noImplicitAny": true,
- "module": "es6",
- "target": "es5",
- "allowJs": true,
- "moduleResolution": "node",
- "suppressImplicitAnyIndexErrors": false,
- "resolveJsonModule": true,
- "allowSyntheticDefaultImports": true
- },
- "include": ["src/**/*"]
-}
\ No newline at end of file
+ "compilerOptions": {
+ "jsx": "react",
+ "baseUrl": "src",
+ "outDir": "./dist/",
+ "noImplicitAny": true,
+ "module": "es6",
+ "target": "es5",
+ "allowJs": true,
+ "moduleResolution": "node",
+ "suppressImplicitAnyIndexErrors": false,
+ "resolveJsonModule": true,
+ "allowSyntheticDefaultImports": true
+ },
+ "include": ["src/**/*"]
+}