Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature/custom title #10

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
},
};