-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gift card customer page #1520
Gift card customer page #1520
Changes from all commits
0693209
08ae0e5
de7c1b9
b35fd52
1c8bfe4
1277f2d
8d3c7d8
0651396
171bbfc
1b435aa
8c8663c
affe8c4
efbb155
eea33c4
b5848af
10478b5
af2258c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { defineMessages } from "react-intl"; | ||
|
||
export const cardMenuMessages = defineMessages({ | ||
cardMenuItemLoading: { | ||
defaultMessage: "working...", | ||
description: "menu item loading" | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
import HorizontalSpacer from "@saleor/apps/components/HorizontalSpacer"; | ||
import StatusChip from "@saleor/components/StatusChip"; | ||
import { StatusType } from "@saleor/components/StatusChip/types"; | ||
import { makeStyles } from "@saleor/macaw-ui"; | ||
import React from "react"; | ||
|
||
import ExtendedPageHeader from "../ExtendedPageHeader"; | ||
export interface PageTitleWithStatusChipProps { | ||
title: string; | ||
statusLabel: string; | ||
statusType: StatusType; | ||
} | ||
|
||
const useStyles = makeStyles( | ||
|
@@ -22,17 +19,20 @@ const useStyles = makeStyles( | |
|
||
const PageTitleWithStatusChip: React.FC<PageTitleWithStatusChipProps> = ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now it can more things than StatusChip, so I think the component name should be changed to something more appropriate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a component There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Technically yes, practically it's styled only to be used with StatusChip. I think it's better to have one component that does one thing without having to change styles every time I want to use it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dominik-zeglen Maybe we can make a PageTitleWithStatusChip precisely styled for status chip but using extended page header underneath? @Cloud11PL check if it's possible There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bmigirl @dominik-zeglen It is, I pushed the changes |
||
title, | ||
statusLabel, | ||
statusType | ||
children | ||
}) => { | ||
const classes = useStyles({}); | ||
|
||
return ( | ||
<div className={classes.container}> | ||
{title} | ||
<HorizontalSpacer spacing={2} /> | ||
<StatusChip label={statusLabel} status={statusType} /> | ||
</div> | ||
<ExtendedPageHeader | ||
title={title} | ||
childrenWrapperClassName={classes.container} | ||
> | ||
<> | ||
<HorizontalSpacer spacing={2} /> | ||
{children} | ||
</> | ||
</ExtendedPageHeader> | ||
); | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
is also falsy, so unless we're going to silence some strict null checking errors (which is not the case) I think it's safe to omit thisThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep
withOuterDividers = false