-
Notifications
You must be signed in to change notification settings - Fork 9
UI: made the course page responsive #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Anurag607
wants to merge
2
commits into
Samagra-Development:c4gt-community
Choose a base branch
from
Anurag607:feat/minor-ui
base: c4gt-community
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,29 @@ | ||
| import React from "react"; | ||
| import { Menu } from "../../scripts/burgerMenu"; | ||
| import Filters from "../Filters"; | ||
|
|
||
| const Burger: React.FC<{ applyFilter: any; mode: any }> = ({ | ||
| applyFilter, | ||
| mode, | ||
| }) => { | ||
| return ( | ||
| <div className={"burgerCont"}> | ||
| <div className={`burgerWrapper bg-transparent`}> | ||
| <div className={`menu`} data-toggle="open" onClick={Menu}> | ||
| <div className={`menuBarCont`}> | ||
| <span className={`menu_bar1`} /> | ||
| <span className={`menu_bar2`} /> | ||
| <span className={`menu_bar3`} /> | ||
| </div> | ||
| </div> | ||
| <div className={`sidebar`}> | ||
| <div className="burgerFilterWrapper"> | ||
| <Filters applyFilter={applyFilter} mode={mode} /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default Burger; |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -5,18 +5,34 @@ import { CourseType } from "../types/courses"; | |
| import Rating from "./Ratings"; | ||
| import { Button, Card, Col, Row } from "react-bootstrap"; | ||
| import { find, map } from "lodash"; | ||
| import { FaBookmark, FaCalendar ,FaCreditCard,FaEye,FaUser} from "react-icons/fa"; | ||
| import { BiListPlus} from "react-icons/bi"; | ||
| import { | ||
| FaBookmark, | ||
| FaCalendar, | ||
| FaCreditCard, | ||
| FaEye, | ||
| FaUser, | ||
| } from "react-icons/fa"; | ||
| import { BiListPlus } from "react-icons/bi"; | ||
| import moment from "moment"; | ||
| const CourseCard: FC<{ course: CourseType;isMyCourse?:boolean }> = ({ course,isMyCourse }) => { | ||
| console.log("mnop:",{course}) | ||
|
|
||
| const CourseCard: FC<{ course: CourseType; isMyCourse?: boolean }> = ({ | ||
| course, | ||
| isMyCourse, | ||
| }) => { | ||
| const imageUrl = useMemo( | ||
| () => course?.descriptor?.images?.[0]?.url ?? Books, | ||
| [course, Books] | ||
| ); | ||
|
|
||
| const normalisedTags = useMemo(() => map(course?.tags[0]?.list, (tag) => ({ name: tag?.descriptor?.name, value: tag?.value })), [course]) | ||
| const [offeringInstitue,credits,instructors] = useMemo( | ||
| const normalisedTags = useMemo( | ||
| () => | ||
| map(course?.tags[0]?.list, (tag) => ({ | ||
| name: tag?.descriptor?.name, | ||
| value: tag?.value, | ||
| })), | ||
| [course] | ||
| ); | ||
| const [offeringInstitue, credits, instructors] = useMemo( | ||
| () => [ | ||
| find(normalisedTags, { name: "offeringInstitue" })?.value, | ||
| find(normalisedTags, { name: "credits" })?.value, | ||
|
|
@@ -25,25 +41,20 @@ console.log("mnop:",{course}) | |
| [normalisedTags] | ||
| ); | ||
| return ( | ||
| <LinkContainer | ||
| to={`/courses/${course?.id}`} | ||
| style={{ cursor: "pointer", marginBottom: "10px" }} | ||
| > | ||
| <Card className="p-2"> | ||
| <Row> | ||
| <LinkContainer to={`/courses/${course?.id}`}> | ||
| <Card className="p-2 courseCard"> | ||
| <Row className="cardContent"> | ||
| <Col> | ||
| <Row> | ||
| <Col xs={3}> | ||
| <Card.Img src={imageUrl} /> | ||
| <Row className="courseTitle"> | ||
| <Col> | ||
| <img src={imageUrl} className="courseImage" /> | ||
| </Col> | ||
| <Col xs={7}> | ||
| <Col> | ||
| <Row> | ||
| <h6>{offeringInstitue}</h6> | ||
| </Row> | ||
| <Row> | ||
| <strong> | ||
| {course?.descriptor?.name} | ||
| </strong> | ||
| <strong>{course?.descriptor?.name}</strong> | ||
| </Row> | ||
| <Row> | ||
| <Rating value={4} size={1} /> | ||
|
|
@@ -58,44 +69,65 @@ console.log("mnop:",{course}) | |
| cupiditate officia sapiente in magni? | ||
| </Col> | ||
| </Row> | ||
| {isMyCourse ? (<Row className="mt-2"> | ||
| <Col> | ||
|
|
||
| <Button variant="outline-danger" size="sm" style={{borderTopRightRadius:'20px',borderTopLeftRadius:'20px',borderBottomRightRadius:'20px',borderBottomLeftRadius:'20px',marginRight:'15px'}}> Svayam - NCERT</Button> | ||
| <Button variant="outline-success" size="sm" style={{borderTopRightRadius:'20px',borderTopLeftRadius:'20px',borderBottomRightRadius:'20px',borderBottomLeftRadius:'20px',marginRight:'15px'}}> 0 INR</Button> | ||
| <Button variant="outline-primary" size="sm" style={{borderTopRightRadius:'20px',borderTopLeftRadius:'20px',borderBottomRightRadius:'20px',borderBottomLeftRadius:'20px',marginRight:'15px'}}> Start Course</Button> | ||
|
|
||
| </Col> | ||
| </Row>):( | ||
| <Row className="mt-2"> | ||
| <Col> | ||
| <FaBookmark color="blue" style={{fontSize:'23px',marginRight:'15px'}}/> | ||
| <Button variant="outline-secondary" size="sm" style={{marginRight:'15px'}}> <BiListPlus style={{fontSize:'23px'}}/> Add to List</Button> | ||
| <Button variant="outline-secondary" size="sm"><FaEye style={{fontSize:'18px'}}/> Quick View</Button> | ||
| </Col> | ||
| </Row> | ||
| {isMyCourse ? ( | ||
| <Row className="mt-2"> | ||
| <Col> | ||
| <Button | ||
| variant="outline-danger" | ||
| size="sm" | ||
| className={"courseCardButtons"} | ||
| > | ||
| {" "} | ||
| Svayam - NCERT | ||
| </Button> | ||
| <Button | ||
| variant="outline-success" | ||
| size="sm" | ||
| className={"courseCardButtons"} | ||
| > | ||
| {" "} | ||
| 0 INR | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove this hard coding? |
||
| </Button> | ||
| <Button | ||
| variant="outline-primary" | ||
| size="sm" | ||
| className={"courseCardButtons"} | ||
| > | ||
| {" "} | ||
| Start Course | ||
| </Button> | ||
| </Col> | ||
| </Row> | ||
| ) : ( | ||
| <div className="courseCardActions"> | ||
| <FaBookmark color="blue" className={"courseCardFaIconsSize"} /> | ||
| <Button variant="outline-secondary" size="sm"> | ||
| <BiListPlus className={"courseCardFaIconsSize"} /> Add to List | ||
| </Button> | ||
| <Button variant="outline-secondary" size="sm"> | ||
| <FaEye className={"courseCardFaIconsSize"} /> Quick View | ||
| </Button> | ||
| </div> | ||
| )} | ||
|
|
||
| </Col> | ||
|
|
||
| <Col | ||
| xs={3} | ||
| style={{ borderLeft: "1px solid lightgray" }} | ||
| className="p-2 container-fluid" | ||
| > | ||
| <div | ||
| style={{ borderBottom: "1px solid lightgray" }} | ||
| className="py-1" | ||
| > | ||
| <FaCreditCard /> <span style={{fontSize:'12px',color:'gray'}}> Credits :{credits}</span> | ||
| </div> | ||
| <div style={{ borderBottom: "1px solid lightgray" }} className="py-2"> | ||
| <FaCalendar /> <span style={{fontSize:'12px',color:'gray'}}> {moment(course?.time?.range?.start).format('Do MMM, YYYY')}</span> | ||
| </div> | ||
| <div> | ||
| <FaUser /> <span style={{fontSize:'12px',color:'gray'}}>{instructors}</span> | ||
| </div> | ||
|
|
||
|
|
||
| <Col className="p-2 courseCardMeta"> | ||
| <div> | ||
| <FaCreditCard /> | ||
| <span> Credits: {credits}</span> | ||
| </div> | ||
| <div> | ||
| <FaCalendar /> | ||
| <span> | ||
| {moment(course?.time?.range?.start ?? Date.now()).format( | ||
| "Do MMM, YYYY" | ||
| )} | ||
| </span> | ||
| </div> | ||
| <div> | ||
| <FaUser /> | ||
| <span>{instructors}</span> | ||
| </div> | ||
| </Col> | ||
| </Row> | ||
| </Card> | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this hardcoding?