-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c5455f
commit b7ab328
Showing
7 changed files
with
99 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, {useEffect, useState} from 'react'; | ||
import Header from './header'; | ||
import Search from './search'; | ||
import { useParams } from 'react-router-dom'; | ||
import SingleFramework from './single-framework'; | ||
import frameworkData from '../json'; | ||
|
||
const Framework = () => { | ||
|
||
const { framework } = useParams(); | ||
const [selectedFramework, SetSelectedFramework] = useState({}); | ||
|
||
useEffect(() => { | ||
|
||
if ( framework && frameworkData && frameworkData.length > 0 ) { | ||
|
||
const foundFramework = frameworkData.find(o => o.slug === framework); | ||
|
||
if ( foundFramework ) { | ||
SetSelectedFramework( foundFramework ); | ||
} | ||
|
||
} | ||
|
||
}, [framework]); | ||
|
||
return( | ||
<div className="App"> | ||
<Header /> | ||
<Search /> | ||
<SingleFramework framework={selectedFramework} /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Framework; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters