Skip to content

Commit

Permalink
Merge branch 'main' into playState
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-90 committed Apr 26, 2022
2 parents 07c8b10 + 64d0b9b commit ebbe0da
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
10 changes: 7 additions & 3 deletions src/meta/play-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
RandomMemeGenerator,
ReactTodoApp,
//import play here
States,
//import play here
} from "plays";

export const plays = [
Expand Down Expand Up @@ -80,10 +82,11 @@ export const plays = [
github: 'murtuzaalisurti',
featured: true
}, {
id: 'pl-states',
name: 'States',
id: 'pl-states',
name: 'States',
description: 'States in Functional Components',
component: () => { return <States /> },
component: () => {return <States />},

path: '/plays/states',
level: 'Beginner',
tags: 'Hooks,State,JSX',
Expand Down Expand Up @@ -125,6 +128,7 @@ export const plays = [
github: 'nirban256',
cover: 'https://res.cloudinary.com/atapas/image/upload/v1650866465/demos/cover_y20bzk.png',
blog: '',
blog: 'https://abhishek-90.github.io/My-Portfolio/',
video: ''
}, //replace new play item here
];
Expand Down
22 changes: 15 additions & 7 deletions src/plays/states/States.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@ import { getPlayById } from "meta/play-meta-util";
import PlayHeader from "common/playlists/PlayHeader";
import "./states.css";

<<<<<<< HEAD
function States() {
const location = useLocation();
const { id } = location.state;
=======
function States(props) {
// Do not remove the below lines.
// The following code is to fetch the current play from the URL
const { id } = props;
>>>>>>> ccd1aa9a02cba5ebc27b7a546f658ec45b3f1f04
const play = getPlayById(id);

// Your Code Start below.
Expand Down Expand Up @@ -40,6 +33,21 @@ function States(props) {
const handleDurationChange = (e) => {
setDuration(e.target.value);
};
=======

import { useLocation } from 'react-router-dom';
import { getPlayById } from 'meta/play-meta-util';

import PlayHeader from 'common/playlists/PlayHeader';

function States() {
// Do not remove the below lines.
// The following code is to fetch the current play from the URL
const location = useLocation();
const { id } = location.state;
const play = getPlayById(id);

// Your Code Start below.

return (
<>
Expand Down

0 comments on commit ebbe0da

Please sign in to comment.