Skip to content

Commit

Permalink
Replace prop with context
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Feb 23, 2021
1 parent ffeb3fe commit 25f0635
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/ItemView/ItemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ import { Paper, AppBar, Tab, makeStyles, useTheme } from '@material-ui/core';
// Import these tab components from @material-ui/lab instead of @material-ui/core for automatic a11y props
// See: https://material-ui.com/components/tabs/#experimental-api
import { TabContext, TabList, TabPanel } from '@material-ui/lab';
import ItemMetadataView from "../ItemMetadataView/"
import ItemMetadataView from "../ItemMetadataView"
import ItemBodyView from "../ItemBodyView";
import ItemHeaderView from "../ItemHeaderView";
import { useItem } from "../ItemProvider";

export default function ItemView({ activeItem }){
export default function ItemView(){
// Set stateful variables
const [activeTab, setActiveTab] = useState('Conversation');

// Set contextual variables
const activeItem = useItem();

const theme = useTheme();
const useStyles = makeStyles({
"paperPadding": {
Expand Down Expand Up @@ -51,6 +56,4 @@ export default function ItemView({ activeItem }){
};

ItemView.propTypes = {
/** The item to be viewed. */
"activeItem": PropTypes.object.isRequired
};

0 comments on commit 25f0635

Please sign in to comment.