-
Notifications
You must be signed in to change notification settings - Fork 25
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 #50 from SureshPradhana/feat/OurStoryCard
feat/ourstorycard
- Loading branch information
Showing
7 changed files
with
152 additions
and
27 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions
40
src/components/molecules/ourstoryCard/OurStoryCard.module.scss
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,40 @@ | ||
@import "../../../foundations/sass/all"; | ||
|
||
.ourstory-card { | ||
border-radius: $br-sm; | ||
display: flex; | ||
gap: px-to-rem(20); | ||
overflow: hidden; | ||
padding: px-to-rem(20); | ||
transition: all 300ms ease; | ||
|
||
&--primary { | ||
border: 2px solid $ourstory-card-border-color; | ||
} | ||
|
||
&--secondary { | ||
flex-direction: row-reverse; | ||
} | ||
|
||
&__image { | ||
border-radius: $br-sm; | ||
object-fit: cover; | ||
overflow: hidden; | ||
position: relative; | ||
} | ||
|
||
&__image, | ||
&__info { | ||
flex: 1; | ||
} | ||
|
||
&__info { | ||
color: $ourstory-card-color; | ||
gap: px-to-rem(10); | ||
|
||
&__story { | ||
font-size: $fs-md; | ||
margin: $spacing-sm; | ||
} | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/components/molecules/ourstoryCard/OurStoryCard.stories.tsx
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,38 @@ | ||
import { Meta } from "@storybook/react"; | ||
import OurStoryCard from "./OurStoryCard"; | ||
|
||
export const Default = { | ||
args: { | ||
image: "./images/image_about_1.png", | ||
story: | ||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passage", | ||
}, | ||
}; | ||
|
||
export const Primary: StoryObj<typeof OurStoryCard> = { | ||
args: { | ||
...Default.args, | ||
mode: "primary", | ||
}, | ||
}; | ||
|
||
export const Secondary: StoryObj<typeof OurStoryCard> = { | ||
args: { | ||
...Default.args, | ||
mode: "secondary", | ||
}, | ||
}; | ||
|
||
const ourStoryCard: Meta<typeof OurStoryCard> = { | ||
title: "Molecules/OurStoryCard", | ||
component: OurStoryCard, | ||
tags: ["autodocs"], | ||
excludeStories: /.*Data$/, | ||
decorators: [ | ||
(Story) => { | ||
return <Story />; | ||
}, | ||
], | ||
}; | ||
|
||
export default ourStoryCard; |
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,41 @@ | ||
import React, { ReactNode } from "react"; | ||
import styles from "./OurStoryCard.module.scss"; | ||
import Image from "next/image"; | ||
|
||
interface OurStoryCardProps { | ||
image: string; | ||
story: ReactNode; | ||
mode?: "primary" | "secondary"; | ||
} | ||
|
||
const OurStoryCard: React.FC<OurStoryCardProps> = ({ | ||
image, | ||
story, | ||
mode = "primary", | ||
}) => { | ||
return ( | ||
<div | ||
className={`${styles["ourstory-card"]} ${ | ||
mode === "secondary" | ||
? styles["ourstory-card--secondary"] | ||
: styles["ourstory-card--primary"] | ||
}`} | ||
> | ||
<div className={styles["ourstory-card__image"]}> | ||
<Image | ||
src={image} | ||
alt="Our Story" | ||
layout="responsive" | ||
width={511} | ||
height={294} | ||
/> | ||
</div> | ||
<div className={styles["ourstory-card__info"]}> | ||
<div className={styles["ourstory-card__info__story"]} /> | ||
{story} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default OurStoryCard; |
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 @@ | ||
export { default } from "./OurStoryCard.tsx"; |
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