-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from Ekta29yadav/ui-designs
Task #0000 - domain carousel
- Loading branch information
Showing
7 changed files
with
228 additions
and
3 deletions.
There are no files selected for viewing
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,118 @@ | ||
import * as React from 'react'; | ||
import AspectRatio from '@mui/joy/AspectRatio'; | ||
import Box from '@mui/joy/Box'; | ||
import Typography from '@mui/joy/Typography'; | ||
import Card from '@mui/joy/Card'; | ||
import Button from '@mui/joy/Button'; | ||
import { NavigateBefore, NavigateNext } from '@mui/icons-material'; | ||
import Carousel from 'react-multi-carousel'; | ||
import 'react-multi-carousel/lib/styles.css'; | ||
|
||
export default function DomainCarousel({ domain }) { | ||
const containerRef = React.useRef(null); | ||
const [activeIndex, setActiveIndex] = React.useState(0); | ||
|
||
const handleScroll = (scrollOffset) => { | ||
if (containerRef.current) { | ||
containerRef.current.scrollLeft += scrollOffset; | ||
} | ||
}; | ||
|
||
const handlePrev = () => { | ||
setActiveIndex((prevIndex) => Math.max(prevIndex - 1, 0)); | ||
}; | ||
|
||
const handleNext = () => { | ||
setActiveIndex((prevIndex) => Math.min(prevIndex + 1, domain.length - 1)); | ||
}; | ||
|
||
const handleDotClick = (index) => { | ||
setActiveIndex(index); | ||
}; | ||
|
||
return ( | ||
|
||
<Box | ||
sx={{ | ||
position: 'relative', | ||
overflow: 'hidden', | ||
width: '100%', | ||
}} | ||
> | ||
<Box | ||
ref={containerRef} | ||
sx={{ | ||
display: 'flex', | ||
gap: 1, | ||
py: 1, | ||
overflow: 'auto', | ||
scrollSnapType: 'x mandatory', | ||
'& > *': { | ||
scrollSnapAlign: 'center', | ||
}, | ||
'::-webkit-scrollbar': { display: 'none' }, | ||
}} | ||
> | ||
|
||
{domain.map((item, index) => ( | ||
<Box key={index} orientation="horizontal" size="sm" variant="outlined" style={{display:'flex'}}> | ||
<Box style={{background:'#fff',padding:'10px',borderRadius:'10px',height:'45px',width:'45px',border:'solid 1px #E1E1E1'}}> | ||
<img src={require("../assets/swm.png")} style={{width:'40px',objectFit:'contain'}} alt={item.name} /> | ||
</Box> | ||
<Box sx={{ alignSelf:'center',padding:'0 19px 0 5px' }}> | ||
<Typography level="title-md">{item.name}</Typography> | ||
</Box> | ||
</Box> | ||
))} | ||
</Box> | ||
<Box | ||
sx={{ | ||
position: 'absolute', | ||
top: '50%', | ||
transform: 'translateY(-50%)', | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
width: '100%', | ||
px: 2, | ||
}} | ||
> | ||
<Button | ||
disabled={activeIndex === 0} | ||
onClick={handlePrev} | ||
startIcon={<NavigateBefore />} | ||
sx={{ alignSelf: 'center' }} | ||
> | ||
Prev | ||
</Button> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
gap: 1, | ||
}} | ||
> | ||
{domain.map((_, index) => ( | ||
<Box | ||
key={index} | ||
sx={{ | ||
width: 8, | ||
height: 8, | ||
borderRadius: '50%', | ||
backgroundColor: activeIndex === index ? 'primary.main' : 'grey.500', | ||
cursor: 'pointer', | ||
}} | ||
onClick={() => handleDotClick(index)} | ||
/> | ||
))} | ||
</Box> | ||
<Button | ||
disabled={activeIndex === domain.length - 1} | ||
onClick={handleNext} | ||
endIcon={<NavigateNext />} | ||
sx={{ alignSelf: 'center' }} | ||
> | ||
Next | ||
</Button> | ||
</Box> | ||
</Box> | ||
); | ||
} |
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,91 @@ | ||
// Profile.js | ||
|
||
import React, { useState, useEffect } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import Footer from "components/Footer"; | ||
import Header from "components/header"; | ||
import Container from '@mui/material/Container'; | ||
import Box from '@mui/material/Box'; | ||
import Typography from '@mui/material/Typography'; | ||
import SimCardDownloadOutlinedIcon from '@mui/icons-material/SimCardDownloadOutlined'; | ||
import Link from '@mui/material/Link'; | ||
import Grid from '@mui/material/Grid'; | ||
import data from "../../assets/certificates.json"; | ||
import DescriptionOutlinedIcon from '@mui/icons-material/DescriptionOutlined'; | ||
import Breadcrumbs from "@mui/material/Breadcrumbs"; | ||
import Card from '@mui/material/Card'; | ||
|
||
|
||
const LearningHistory = () => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div> | ||
<Header/> | ||
|
||
<Container maxWidth="xxl" role="main" className="container-pb"> | ||
|
||
<Box textAlign="center" padding="10"> | ||
<Breadcrumbs | ||
aria-label="breadcrumb" | ||
style={{ | ||
padding: "25px 0", | ||
fontSize: "16px", | ||
fontWeight: "600", | ||
}} | ||
> | ||
<Link underline="hover" color="#004367" href="/"> | ||
{t("MY_PROFILE")} | ||
</Link> | ||
<Link | ||
underline="hover" | ||
href="" | ||
aria-current="page" | ||
color="#484848" | ||
> | ||
{t("CERTIFICATES")} | ||
</Link> | ||
</Breadcrumbs> | ||
<Card style={{padding:'20px',textAlign:'left'}}> | ||
<Box style={{display:'flex',alignItems:'end'}}> | ||
<DescriptionOutlinedIcon/> {t("CERTIFICATES")} | ||
|
||
</Box> | ||
<Grid container spacing={2} style={{ textAlign: 'left', paddingTop: '10px' }} > | ||
|
||
{data.result && data.result.response.content && data.result.response.content.map((faqIndex) => ( | ||
<Grid item xs={12} md={4} key={faqIndex._id}> | ||
<Card sx={{ marginTop: '10px', padding: '10px',borderRadius:'10px',border:'solid 1px #EFEFEF',boxShadow:'none',color:'#484848' }}> | ||
<Typography className="twoLineEllipsis" variant="subtitle1" color="text.secondary" component="div" style={{ fontSize: '14px', paddingBottom: '15px',height:'42px',fontWeight:'600' }}> | ||
{faqIndex._source.data.badge.name} | ||
</Typography> | ||
<Typography variant="subtitle1" color="text.secondary" component="div" style={{ fontSize: '12px' }}> | ||
{t("CERTIFICATE_GIVEN_BY")}: {faqIndex._source.data.badge.issuer.name} | ||
</Typography> | ||
<Typography variant="subtitle1" color="text.secondary" component="div" style={{ fontSize: '12px' }}> | ||
{t("CERTIFICATE_ISSUE_DATE")}: -{faqIndex._source.data.issuedOn} | ||
</Typography> | ||
<Box style={{ display: 'flex', alignItems: 'end', color: '#1976d2' }}> | ||
<SimCardDownloadOutlinedIcon /> | ||
<Link href="{faqIndex._source.pdfUrl}" underline="none" style={{ fontSize: '12px', marginTop: '15px', display: 'block' }}>{t("CERTIFICATES")} </Link> | ||
</Box> | ||
</Card> | ||
|
||
</Grid> | ||
))} | ||
</Grid> | ||
|
||
|
||
|
||
|
||
</Card> | ||
</Box> | ||
</Container> | ||
<Footer/> | ||
|
||
</div> | ||
|
||
); | ||
}; | ||
|
||
export default LearningHistory; |
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