This repository was archived by the owner on Feb 23, 2022. It is now read-only.
Mac-LU-CEM2514-Menu Item Card + Loyalty Points#429
Open
mfnisbetLU wants to merge 2 commits intomasterfrom
Open
Mac-LU-CEM2514-Menu Item Card + Loyalty Points#429mfnisbetLU wants to merge 2 commits intomasterfrom
mfnisbetLU wants to merge 2 commits intomasterfrom
Conversation
New branch since the old one was on an old version of storybook and had other issues. Added new functions to get values of item image and prices. Changed HTML so sale tag and loyalty points are aligned. Made modifications to SaleTag and limited time banner to make the dimensions adjustable and fit with my menu item card. Also added loyalty points since it was never merged to main.
ralph-dev
suggested changes
Jan 8, 2022
Member
ralph-dev
left a comment
There was a problem hiding this comment.
Quite a bit of simple work needed.
| extends MainInterface { | ||
| /* minutes until time runs out */ | ||
| minsRemaining: number, | ||
| minsRemaining: number, |
| minsRemaining: number, | ||
| minsRemaining: number, | ||
| bannerWidth?: number, | ||
| bannerHeight?: number, |
Member
There was a problem hiding this comment.
Why can't these live in the props?
|
|
||
| export interface LoyaltyPointsProps | ||
| extends React.HTMLAttributes<HTMLDivElement> { | ||
| loyaltyamount: number; //the amount of loyalty points that the user gets with purchase, used to display on component. |
| export interface LoyaltyPointsProps | ||
| extends React.HTMLAttributes<HTMLDivElement> { | ||
| loyaltyamount: number; //the amount of loyalty points that the user gets with purchase, used to display on component. | ||
| loyaltypointlimit: number; //the limit of loyalty points before it says 99+ instead. |
| argTypes: { onClick: { action: 'This card was clicked!' } }, | ||
| } as Meta; | ||
|
|
||
| const Template: Story<MenuItemCardProps> = (args) => <MenuItemCard {...args}> <LoyaltyPoints {...args} /> |
Member
There was a problem hiding this comment.
Use round brackets only do this when it's one line not 3
| */ | ||
| function getMenuItemStatus(sale: boolean, soldOut: boolean, itemPrice: number, itemPriceLimit: number, saleAmount: number) { | ||
|
|
||
| var itemSaleAmount; |
Fixed casing and documentation in the loyalty points tag. Removed banner width and height properties and made minutes remaining optional in the limited time banner. Changed 'var' to 'let' in menu item card functions. Added a new div with onClick that calls an action when not in the sold out state.
ralph-dev
reviewed
Jan 16, 2022
|
|
||
| const BannerBox = styled.div<LimitedTimeBannerProps>` | ||
| width: 300px; | ||
| height; 40px; |
Member
There was a problem hiding this comment.
Suggested change
| height; 40px; | |
| height: 40px; |
typo
ralph-dev
reviewed
Jan 16, 2022
| title: 'Components/Menu Item Card', | ||
| component: MenuItemCard, | ||
| subcomponents: { LoyaltyPoints, LimitedTimeBanner, SaleTag }, | ||
| argTypes: { onClick: { action: 'This card was clicked!' } }, |
Member
There was a problem hiding this comment.
Why remove the onclick handler?
ralph-dev
reviewed
Jan 16, 2022
Member
ralph-dev
left a comment
There was a problem hiding this comment.
Almost there, why remove the onClick Handler?
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New branch since the old one was on an old version of storybook and had other issues. Also added loyalty points since it was never merged to main. Made modifications to sale tag and limited time banner to make the dimensions adjustable and fit with my menu item card. Added new functions to get values of item image and prices. Changed HTML so sale tag and loyalty points are aligned.
2022-01-07.19-25-25.mp4