Skip to content

Commit

Permalink
Merge pull request #10 from frani/feature/custom-message
Browse files Browse the repository at this point in the history
Feature/custom title
  • Loading branch information
GhassenEljday authored Sep 6, 2023
2 parents fb76eeb + 0f16c39 commit 8feb371
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 9 deletions.
9 changes: 8 additions & 1 deletion src/components/AppGalleryButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ type AppGalleryButtonProps = {
*/
theme?: "dark" | "light";

/**
* @default "EXPLORE IT ON"
*/
title: string;

/**
* @default 60px
*/
Expand All @@ -34,6 +39,7 @@ type AppGalleryButtonProps = {
*
* @param {string} theme Choose a theme between dark and light
* @param {number} height Controls the height of the button
* @param {string} title Custom title in button
* @param {number} width Controls the width of the button
* @param {string} className Add className to the button in order to customize the button appearance
* @param {string} url Add your store url to the button
Expand All @@ -43,6 +49,7 @@ type AppGalleryButtonProps = {
const AppGalleryButton: FC<AppGalleryButtonProps> = ({
theme = "light",
height,
title = "EXPLORE IT ON",
width,
className,
url,
Expand All @@ -56,7 +63,7 @@ const AppGalleryButton: FC<AppGalleryButtonProps> = ({
storeName={"AppGallery"}
logo={Huawei}
className={className}
title={"EXPLORE IT ON"}
title={title}
/>
);
};
Expand Down
9 changes: 8 additions & 1 deletion src/components/AppStoreButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ type AppStoreButtonProps = {
*/
theme?: "dark" | "light";

/**
* @default "Download on the"
*/
title: string;

/**
* @default 60px
*/
Expand All @@ -35,6 +40,7 @@ type AppStoreButtonProps = {
*
* @param {string} theme Choose a theme between dark and light
* @param {number} height Controls the height of the button
* @param {number} height Controls the height of the button
* @param {number} width Controls the width of the button
* @param {string} className Add className to the button in order to customize the button appearance
* @param {string} url Add your store url to the button
Expand All @@ -44,6 +50,7 @@ type AppStoreButtonProps = {
const AppStoreButton: FC<AppStoreButtonProps> = ({
theme = "light",
height,
title = "Download on the",
width,
className,
url,
Expand All @@ -57,7 +64,7 @@ const AppStoreButton: FC<AppStoreButtonProps> = ({
storeName={"App Store"}
logo={theme === "dark" ? AppStoreLight : AppStore}
className={className}
title={"Download on the"}
title={title}
/>
);
};
Expand Down
12 changes: 9 additions & 3 deletions src/components/GooglePlayButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ type GooglePlayButtonProps = {
*/
theme?: "dark" | "light";

/**
* @default "GET IT ON"
*/
title: string;

/**
* @default 60px
*/
Expand All @@ -31,18 +36,19 @@ type GooglePlayButtonProps = {
};

/**
*
*
* @param {string} theme Choose a theme between dark and light
* @param {number} height Controls the height of the button
* @param {number} width Controls the width of the button
* @param {string} className Add className to the button in order to customize the button appearance
* @param {string} url Add your store url to the button
* @example <GooglePlayButton theme="light" height={70} width={130} className="button-container" url="https://play.google.com/" />
* @returns
* @returns
*/
const GooglePlayButton: FC<GooglePlayButtonProps> = ({
theme = "light",
height,
title = "GET IT ON",
width,
className,
url,
Expand All @@ -56,7 +62,7 @@ const GooglePlayButton: FC<GooglePlayButtonProps> = ({
storeName={"Google Play"}
logo={GooglePlay}
className={className}
title={"GET IT ON"}
title={title}
/>
);
};
Expand Down
9 changes: 9 additions & 0 deletions src/stories/AppGalleryButton.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ export const CustomWidth = {
width: 160,
},
};

/**
* Example: "EXPLORE IT ON"
*/
export const CustomTitle = {
args: {
title: "EXPLORE IT ON",
},
};
9 changes: 9 additions & 0 deletions src/stories/AppStoreButton.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ export const CustomWidth = {
width: 160,
},
};

/**
* Example: title "Download on the"
*/
export const CustomTitle = {
args: {
title: "Download on the",
},
};
7 changes: 3 additions & 4 deletions src/stories/GooglePlayButton.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ export const CustomHeight = {
};

/**
* Example: width 160px
* Example: "GET IT ON"
*/
export const CustomWidth = {
export const CustomTitle = {
args: {
theme: "dark",
width: 160,
title: "GET IT ON",
},
};

1 comment on commit 8feb371

@vercel
Copy link

@vercel vercel bot commented on 8feb371 Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.