Skip to content

Commit

Permalink
build qtify
Browse files Browse the repository at this point in the history
  • Loading branch information
Anusree6154s committed Aug 4, 2024
1 parent 7942a9b commit a563b69
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 12 deletions.
20 changes: 20 additions & 0 deletions qtify/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions qtify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.0",
"react-scripts": "5.0.1",
"swiper": "^11.1.9",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion qtify/src/components/Card/Card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

.container {
height: 250px;
height: 205px;
width: 100%;
border-radius: 10px;
overflow: hidden;
Expand Down
79 changes: 79 additions & 0 deletions qtify/src/components/Carousel/Carousel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// import React from "react";
// import Grid from '@mui/material/Grid';
// import Card from '../Card/Card';
// import { Typography } from '@mui/material';
// import styles from "./Section.module.css";

// export default function Carousel({ title, data }) {
// return (
// <div>

// <Grid container spacing={4} sx={{ padding: 3 }}>
// {data && data.map((group, index) => (
// <Grid item xs={12} key={index}>
// <Card image={group.image} follows={group.follows} />
// <Typography sx={{ color: 'white', textAlign: 'left' }}> {group.title}</Typography>
// </Grid>
// ))}
// </Grid>
// </div>
// )
// }

import React, { useRef, useState } from 'react';
import { Swiper, SwiperSlide } from 'swiper/react';
import 'swiper/css';
import 'swiper/css/pagination';
import 'swiper/css/navigation';
// import './styles.css';
import { Navigation } from 'swiper/modules';

import Grid from '@mui/material/Grid';
import Card from '../Card/Card';
import { Typography } from '@mui/material';

export default function Carousel({ data }) {
return (
<Grid item xs={12}>
<Swiper
slidesPerView={1}
breakpoints={{
280: {
slidesPerView: 2,
spaceBetween: 30,
},
400: {
slidesPerView: 3,
spaceBetween: 30,
},
668: {
slidesPerView: 5,
spaceBetween: 30,
},
1024: {
slidesPerView: 7,
spaceBetween: 30,
},
}}
spaceBetween={10}
loop={true}
navigation={true}
modules={[Navigation]}
className="mySwiper"
>
{/* <Grid container >
<Grid item xs={12}> */}
{data && data.map((group, index) => (
<SwiperSlide>
{/* <Grid item xs={12} key={index}> */}
<Card image={group.image} follows={group.follows} />
<Typography sx={{ color: 'white', textAlign: 'left' }}> {group.title}</Typography>
{/* </Grid> */}
</SwiperSlide>
))}
{/* </Grid>
</Grid> */}
</Swiper>
</Grid>
);
}
Empty file.
30 changes: 19 additions & 11 deletions qtify/src/components/Section/Section.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
import React from "react";
import React, { useState } from "react";
import Grid from '@mui/material/Grid';
import Card from '../Card/Card';
import { Typography } from '@mui/material';
import styles from "./Section.module.css";
import Carousel from "../Carousel/Carousel";

export default function Section({ title, data }) {
const [collapsed, setCollapse] = useState(true)
return (
<div>

<Grid container spacing={4} sx={{ padding: 3 }}>
<Grid item xs={12}>
<h1 style={{ color: 'white', textAlign: 'left', margin: '0px' }}>
{title}
</h1>
<Grid item xs={12} style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ color: 'white', textAlign: 'left', margin: '0px' }}>
{title} Albums
</span>
<button style={{ backgroundColor: 'transparent', border: 'none', color: 'var(--color-primary)' }} onClick={() => setCollapse(!collapsed)}>
{collapsed ? 'Show All' : 'Collapse'}
</button>
</Grid>
{data && data.map((group, index) => (
<Grid item xs={12 / 7} key={index}>
<Card image={group.image} follows={group.follows} />
<Typography sx={{ color: 'white', textAlign: 'left' }}> {group.title}</Typography>
</Grid>
))}
{collapsed ?
<Carousel data={data} />
:
data && data.map((group, index) => (
<Grid item xs={12 / 7} key={index}>
<Card image={group.image} follows={group.follows} />
<Typography sx={{ color: 'white', textAlign: 'left' }}> {group.title}</Typography>
</Grid>
))}
</Grid>
</div>
)
Expand Down

0 comments on commit a563b69

Please sign in to comment.