Skip to content

Commit

Permalink
Create State Play
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-90 committed Apr 17, 2022
1 parent ec10280 commit 7efb038
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/meta/play-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
MovieContainer,
WhyReact,
CounterApp,
States,
//import play here
} from "plays";

Expand Down Expand Up @@ -75,6 +76,18 @@ export const plays = [
tags: 'JSX, State, Props',
github: 'murtuzaalisurti',
featured: true
}, {
id: 'pl-states',
name: 'States',
description: 'States in Functional Components',
component: () => {return <States />},
path: '/plays/states',
level: 'Beginner',
tags: 'Hooks,State,JSX',
github: 'Abhishek-90',
cover: '',
blog: 'https://abhishek-90.github.io/My-Portfolio/',
video: ''
}, //replace new play item here
];

Expand Down
1 change: 1 addition & 0 deletions src/plays/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ 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';
//add export here
38 changes: 38 additions & 0 deletions src/plays/states/States.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

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 (
<>
<div className="play-details">
<PlayHeader play={play} />
<div className="play-details-body">
{/* Your Code Starts Here */}
<div>
<h1>Play Details - States</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Pellentesque euismod, urna eu tincidunt consectetur,
nisi nunc ultricies nisi, eget consectetur nunc nisi
euismod nunc.
</p>
</div>
{/* Your Code Ends Here */}
</div>
</div>
</>
);
}

export default States;

0 comments on commit 7efb038

Please sign in to comment.