From 41c53ddde27da58c264601d77801370a679de9e6 Mon Sep 17 00:00:00 2001 From: ShwetKhatri2001 <19dcs001@lnmiit.ac.in> Date: Tue, 22 Nov 2022 00:10:30 +0530 Subject: [PATCH 1/2] Added Gallery component for fifth theme --- src/components/Gallery/Gallery.md | 22 +++++++++ src/components/Gallery/Gallery.stories.js | 48 ++++++++++++++++++++ src/components/Gallery/index.js | 40 +++++++++++++++++ src/components/Gallery/style.sass | 55 +++++++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 src/components/Gallery/Gallery.md create mode 100644 src/components/Gallery/Gallery.stories.js create mode 100644 src/components/Gallery/index.js create mode 100644 src/components/Gallery/style.sass diff --git a/src/components/Gallery/Gallery.md b/src/components/Gallery/Gallery.md new file mode 100644 index 00000000..08aff909 --- /dev/null +++ b/src/components/Gallery/Gallery.md @@ -0,0 +1,22 @@ +## Initial Setup + +Hope you have successfully set up the project in your local system and install all dependencies + +## About the Gallery Component + +This is a reusable component for the gallery built from scratch. It could be used to display pictures of flexible sizes. This Component is highly reusable and customizable via props. + +## How to use the component + +Import the component to `pages/index.js` +`import {Gallery} from "../components/Gallery";` + +## How to handle props to the component + +``` + +``` + +`subText` prop of type text is the subtitle for the gallery +`mainText` prop of type text is the main title for gallery +`data` prop is the array of image-sources along with image-titles \ No newline at end of file diff --git a/src/components/Gallery/Gallery.stories.js b/src/components/Gallery/Gallery.stories.js new file mode 100644 index 00000000..72d7222d --- /dev/null +++ b/src/components/Gallery/Gallery.stories.js @@ -0,0 +1,48 @@ +import React from "react" + +import { Gallery } from "./index" + +import "bootstrap/dist/css/bootstrap.css" + +export default { + title: "General/Gallery", + component: Gallery, + argTypes: { + subText: { control: "text" }, + mainText: { control: "text" }, + data: { control: "array" }, + }, +} + +export const gallery = args => + +gallery.args = { + subText: "Memories", + mainText: "Past Year Gallery", + data: [ + { + image: "https://user-images.githubusercontent.com/56475750/203128758-e02f4766-5dfb-4eb0-9e36-8ce2c8883ae4.png", + title: "Freshers being mentored", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203128871-79b36496-7f5a-4df2-aeef-cda8bbafc6e9.png", + title: "Women in Tech", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203128989-7d70215d-3b78-4649-b8d0-3187126846fe.png", + title: "Amazing work environment", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203129183-8c3b6305-9daa-4b79-89f1-642f68cc34fa.png", + title: "Made Connections", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203129450-deda01a6-f3de-44e8-bb21-c607c4c64bc5.png", + title: "Achieved Goals", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203129311-c3f54810-aaae-48bb-bc97-61aa6385249c.png", + title: "Discussed Creative Ideas", + }, + ], +} diff --git a/src/components/Gallery/index.js b/src/components/Gallery/index.js new file mode 100644 index 00000000..6e80c785 --- /dev/null +++ b/src/components/Gallery/index.js @@ -0,0 +1,40 @@ +import React from "react" +import PropTypes from "prop-types" +import "./style.sass" +import { Container } from "react-bootstrap" + +export const Gallery = ({ subText, mainText, data }) => { + return ( + +
+

{subText}

+

{mainText}

+
+ {data?.length > 0 ? ( +
+ {data.map((item, index) => { + return ( +
+ {item.title} +
+ ) + })} +
+ ) : ( +

No Pictures Available

+ )} +
+ ) +} + +Gallery.propTypes = { + subText: PropTypes.string, + mainText: PropTypes.string, + data: PropTypes.array, +} diff --git a/src/components/Gallery/style.sass b/src/components/Gallery/style.sass new file mode 100644 index 00000000..0a8e5081 --- /dev/null +++ b/src/components/Gallery/style.sass @@ -0,0 +1,55 @@ +@import '../../styles/variables.sass' + +.galleryHeadingsDiv + padding: 20px + .gallerySubText + font-family: 'Montserrat' + font-style: normal + font-weight: 700 + text-align: center + font-size: 20px + line-height: 39px + text-transform: uppercase + color: #51AD28 + @media #{$sm-and-less} + font-weight: 500 + .galleryMainHeading + font-family: 'Montserrat' + font-style: normal + text-align: center + font-weight: 700 + font-size: 45px + text-transform: uppercase + color: #808080 + @media #{$sm-and-less} + font-size: 30px + font-weight: 500 + +.gallery + column-count: 3 + -webkit-column-count: 3 + -moz-column-count: 3 + padding: 12px + .pics + transition: all 350ms ease + -webkit-transition: all 350ms ease + margin-bottom: 12px + @media (max-width: 992px) + column-count: 2 + -webkit-column-count: 2 + -moz-column-count: 2 + @media #{$sm-and-less} + column-count: 1 + -webkit-column-count: 1 + -moz-column-count: 1 + +.emptyMessage + font-family: 'Montserrat' + font-style: normal + text-align: center + font-size: 25px + color: #B2B6BB + + + + From 58f2d16a6a5e19e4b3b8f28a6a96339a04efcf8b Mon Sep 17 00:00:00 2001 From: ShwetKhatri2001 <19dcs001@lnmiit.ac.in> Date: Tue, 22 Nov 2022 00:13:32 +0530 Subject: [PATCH 2/2] Added Gallery component for fifth theme --- src/components/Gallery/Gallery.md | 22 +++++++++ src/components/Gallery/Gallery.stories.js | 48 ++++++++++++++++++++ src/components/Gallery/index.js | 40 +++++++++++++++++ src/components/Gallery/style.sass | 55 +++++++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 src/components/Gallery/Gallery.md create mode 100644 src/components/Gallery/Gallery.stories.js create mode 100644 src/components/Gallery/index.js create mode 100644 src/components/Gallery/style.sass diff --git a/src/components/Gallery/Gallery.md b/src/components/Gallery/Gallery.md new file mode 100644 index 00000000..08aff909 --- /dev/null +++ b/src/components/Gallery/Gallery.md @@ -0,0 +1,22 @@ +## Initial Setup + +Hope you have successfully set up the project in your local system and install all dependencies + +## About the Gallery Component + +This is a reusable component for the gallery built from scratch. It could be used to display pictures of flexible sizes. This Component is highly reusable and customizable via props. + +## How to use the component + +Import the component to `pages/index.js` +`import {Gallery} from "../components/Gallery";` + +## How to handle props to the component + +``` + +``` + +`subText` prop of type text is the subtitle for the gallery +`mainText` prop of type text is the main title for gallery +`data` prop is the array of image-sources along with image-titles \ No newline at end of file diff --git a/src/components/Gallery/Gallery.stories.js b/src/components/Gallery/Gallery.stories.js new file mode 100644 index 00000000..72d7222d --- /dev/null +++ b/src/components/Gallery/Gallery.stories.js @@ -0,0 +1,48 @@ +import React from "react" + +import { Gallery } from "./index" + +import "bootstrap/dist/css/bootstrap.css" + +export default { + title: "General/Gallery", + component: Gallery, + argTypes: { + subText: { control: "text" }, + mainText: { control: "text" }, + data: { control: "array" }, + }, +} + +export const gallery = args => + +gallery.args = { + subText: "Memories", + mainText: "Past Year Gallery", + data: [ + { + image: "https://user-images.githubusercontent.com/56475750/203128758-e02f4766-5dfb-4eb0-9e36-8ce2c8883ae4.png", + title: "Freshers being mentored", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203128871-79b36496-7f5a-4df2-aeef-cda8bbafc6e9.png", + title: "Women in Tech", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203128989-7d70215d-3b78-4649-b8d0-3187126846fe.png", + title: "Amazing work environment", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203129183-8c3b6305-9daa-4b79-89f1-642f68cc34fa.png", + title: "Made Connections", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203129450-deda01a6-f3de-44e8-bb21-c607c4c64bc5.png", + title: "Achieved Goals", + }, + { + image: "https://user-images.githubusercontent.com/56475750/203129311-c3f54810-aaae-48bb-bc97-61aa6385249c.png", + title: "Discussed Creative Ideas", + }, + ], +} diff --git a/src/components/Gallery/index.js b/src/components/Gallery/index.js new file mode 100644 index 00000000..6e80c785 --- /dev/null +++ b/src/components/Gallery/index.js @@ -0,0 +1,40 @@ +import React from "react" +import PropTypes from "prop-types" +import "./style.sass" +import { Container } from "react-bootstrap" + +export const Gallery = ({ subText, mainText, data }) => { + return ( + +
+

{subText}

+

{mainText}

+
+ {data?.length > 0 ? ( +
+ {data.map((item, index) => { + return ( +
+ {item.title} +
+ ) + })} +
+ ) : ( +

No Pictures Available

+ )} +
+ ) +} + +Gallery.propTypes = { + subText: PropTypes.string, + mainText: PropTypes.string, + data: PropTypes.array, +} diff --git a/src/components/Gallery/style.sass b/src/components/Gallery/style.sass new file mode 100644 index 00000000..0a8e5081 --- /dev/null +++ b/src/components/Gallery/style.sass @@ -0,0 +1,55 @@ +@import '../../styles/variables.sass' + +.galleryHeadingsDiv + padding: 20px + .gallerySubText + font-family: 'Montserrat' + font-style: normal + font-weight: 700 + text-align: center + font-size: 20px + line-height: 39px + text-transform: uppercase + color: #51AD28 + @media #{$sm-and-less} + font-weight: 500 + .galleryMainHeading + font-family: 'Montserrat' + font-style: normal + text-align: center + font-weight: 700 + font-size: 45px + text-transform: uppercase + color: #808080 + @media #{$sm-and-less} + font-size: 30px + font-weight: 500 + +.gallery + column-count: 3 + -webkit-column-count: 3 + -moz-column-count: 3 + padding: 12px + .pics + transition: all 350ms ease + -webkit-transition: all 350ms ease + margin-bottom: 12px + @media (max-width: 992px) + column-count: 2 + -webkit-column-count: 2 + -moz-column-count: 2 + @media #{$sm-and-less} + column-count: 1 + -webkit-column-count: 1 + -moz-column-count: 1 + +.emptyMessage + font-family: 'Montserrat' + font-style: normal + text-align: center + font-size: 25px + color: #B2B6BB + + + +