Skip to content

Commit

Permalink
refactor(item-card): show presenter name and cost in more info modal
Browse files Browse the repository at this point in the history
  • Loading branch information
KimiaMontazeri committed Nov 27, 2023
1 parent 9d8d5f1 commit 40f8fbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
6 changes: 2 additions & 4 deletions frontend/src/components/item-card/item-card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button, Card, CardActions, CardContent, CardHeader, Chip, Divider, Stac
import PropTypes from 'prop-types';
import MoreInfoModal from './more-info-modal';

export const Presenter = ({ presenterName }) => (
const Presenter = ({ presenterName }) => (
<Stack flexDirection="row" alignItems="center" gap={1}>
<Person />
<Typography variant="body1" sx={{ fontSize: 14 }} color="text.secondary">
Expand All @@ -14,7 +14,7 @@ export const Presenter = ({ presenterName }) => (
);

// TODO: format cost with commas
export const Cost = ({ cost }) => (
const Cost = ({ cost }) => (
<Stack flexDirection="row" alignItems="center" gap={1}>
<CreditCard />
<Typography variant="overline" sx={{ fontSize: 14 }} color="text.secondary">
Expand Down Expand Up @@ -106,8 +106,6 @@ const ItemCard = ({
visibility={moreInfoModalVisibility}
onVisibilityChange={() => setMoreInfoModalVisibility(false)}
title={title}
presenterName={presenterName}
cost={cost}
purchaseState={purchaseState}
hasProject={hasProject}
prerequisites={prerequisites}
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/components/item-card/more-info-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
Chip,
} from '@mui/material';
import PropTypes from 'prop-types';
import { Cost, Presenter } from './item-card';

const Prerequisites = ({ prerequisites }) => (
<>
Expand Down Expand Up @@ -43,8 +42,6 @@ const MoreInfoModal = ({
visibility,
onVisibilityChange,
title,
presenterName,
cost,
purchaseState,
hasProject,
prerequisites,
Expand All @@ -71,9 +68,6 @@ const MoreInfoModal = ({
>
<DialogTitle variant="h5">{title}</DialogTitle>
<DialogContent>
<Presenter presenterName={presenterName} />
<Cost cost={cost} />
<Divider sx={{ my: 2 }} />
<Prerequisites prerequisites={prerequisites} />
<Divider sx={{ my: 2 }} />
<Syllabus syllabus={syllabus} />
Expand Down Expand Up @@ -102,8 +96,6 @@ const MoreInfoModal = ({

MoreInfoModal.propTypes = {
title: PropTypes.string,
presenterName: PropTypes.string,
cost: PropTypes.number,
isBought: PropTypes.bool,
purchaseState: PropTypes.number,
prerequisites: PropTypes.string,
Expand Down

0 comments on commit 40f8fbe

Please sign in to comment.