@availity/page-header 0.0.0-t325224b2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,59 +2,24 @@
2
2
 
3
3
  > The standard page header for Availity Portal Applications
4
4
 
5
+ [![Version](https://img.shields.io/npm/v/@availity/page-header.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/page-header)
6
+ [![NPM Downloads](https://img.shields.io/npm/dt/@availity/page-header.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/page-header)
7
+ [![Dependecy Status](https://img.shields.io/librariesio/release/npm/@availity/page-header?style=for-the-badge)](https://github.com/Availity/availity-react/blob/master/packages/page-header/package.json)
8
+
5
9
  ## Installation
6
10
 
11
+ ### NPM
12
+
7
13
  ```bash
8
- npm install @availity/page-header --save
14
+ npm install @availity/page-header
9
15
  ```
10
16
 
11
- ### Usage
17
+ ### Yarn
12
18
 
13
- ```javascript
14
- import React from 'react';
15
- import PageHeader from '@availity/page-header';
16
- // ...
17
- <PageHeader appName="Applicaiton Name" />
18
- // ...
19
+ ```bash
20
+ yarn add @availity/page-header
19
21
  ```
20
22
 
21
- #### PageHeader (Default export)
22
- The standard Availity application header which appears at the top of the page. It can include an app icon, payer logo, and/or the feedback loop.
23
-
24
- ##### Props
25
-
26
- - **`children`**: Node. Optional. This value will appear at the `h1` of the page. Overrides the `appName` to allow for custom elements (such as a "beta" tag) Default: value of `appName` prop
27
- - **`appName`**: String. Required. Name of the application
28
- - **`spaceName`**: String. Optional. Payer Space Name of the space in which this page is under.
29
- - **`spaceId`**: String. Optional. Payer Space ID of the space in which this page is under.
30
- - **`appAbbr`**: String. Optional. If provided and payerId is not provided the app icon will appear.
31
- - **`iconColor`**: String, optional. Potential values: `"black"`, `"blue"`, `"green"`, `"orange"`. Only used if the app icon should appear. Default value: `"black"`
32
- - **`branded`**: String. Optional. Triggers the app icon's "branded" styles. Only used if the app icon should appear.
33
- - **`payerId`**: String. Optional. The ID of the payer if the application is payer specific. If provided the payer logo will appear and not the app icon.
34
- - **`feedback`**: Boolean. Optional. If `true` the feedback loop button will appear. Default: `false`.
35
- - **`crumbs`**: Array of Objects contains `name` (String) and `url` (string) properties. Optional. The ancestor pages which gets passed to the `Breadcrumbs` component.
36
- - **`component`**: Component. Optional. Allow rendering of an optional component in the top right of the header.
37
-
38
- ##### PageHeader Usage
39
-
40
- ```javascript
41
- import React from 'react';
42
- import PageHeader from '@availity/page-header';
43
- // ...
44
- <PageHeader
45
- appName="Payer Space"
46
- appAbbr="PS"
47
- iconColor="blue"
48
- feedback
49
- />
50
-
51
- <PageHeader
52
- appName="Payer Space"
53
- payerId="PayerID"
54
- spaceName="Payer's Space"
55
- spaceId="73162546201441126239486200007187"
56
- >
57
- Payer Space<sup>beta</sup>
58
- </PageHeader>
59
- // ...
60
- ```
23
+ ## Documentation
24
+
25
+ Check out more documentation at [availity.github.io](https://availity.github.io/availity-react/components/page-header)
package/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import PageHeader from './PageHeader';
2
-
3
- export default PageHeader;
1
+ export { default } from './types/PageHeader';
2
+ export * from './types/PageHeader';
package/index.js CHANGED
@@ -1,3 +1 @@
1
- import PageHeader from './PageHeader';
2
-
3
- export default PageHeader;
1
+ export { default } from './src/PageHeader';
package/jest.config.js ADDED
@@ -0,0 +1,7 @@
1
+ const global = require('../../jest/global-config');
2
+
3
+ module.exports = {
4
+ ...global,
5
+ displayName: 'page-header',
6
+ coverageDirectory: '../../coverage/page-header',
7
+ };
package/package.json CHANGED
@@ -1,39 +1,58 @@
1
1
  {
2
2
  "name": "@availity/page-header",
3
- "version": "0.0.0-t325224b2",
4
- "author": "Evan Sharp <evan.sharp@availity.com>",
3
+ "version": "1.0.0",
5
4
  "description": "The standard page header for Availity Portal Applications",
6
- "main": "index.js",
7
5
  "keywords": [
8
6
  "react",
9
- "availity"
7
+ "availity",
8
+ "page",
9
+ "header"
10
10
  ],
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/Availity/availity-react.git"
14
- },
11
+ "homepage": "https://availity.github.io/availity-react/components/page-header",
15
12
  "bugs": {
16
13
  "url": "https://github.com/Availity/availity-react/issues"
17
14
  },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/Availity/availity-react.git",
18
+ "directory": "packages/page-header"
19
+ },
18
20
  "license": "MIT",
19
- "publishConfig": {
20
- "access": "public"
21
+ "author": "Evan Sharp <evan.sharp@availity.com>",
22
+ "main": "index.js",
23
+ "types": "index.d.ts",
24
+ "scripts": {
25
+ "publish": "yarn npm publish --tolerate-republish --access public",
26
+ "publish:canary": "yarn npm publish --access public --tag canary"
21
27
  },
22
28
  "dependencies": {
23
- "@availity/app-icon": "^0.0.0-t325224b2",
24
- "@availity/breadcrumbs": "^0.0.0-t325224b2",
25
- "@availity/feedback": "^0.0.0-t325224b2",
26
- "@availity/payer-logo": "^0.0.0-t325224b2",
27
- "@availity/training-link": "^0.0.0-t325224b2",
28
- "prop-types": "^15.5.8"
29
+ "@availity/app-icon": "0.1.0",
30
+ "@availity/breadcrumbs": "1.0.0",
31
+ "@availity/feedback": "1.0.0",
32
+ "@availity/payer-logo": "1.0.0",
33
+ "classnames": "^2.5.1",
34
+ "prop-types": "^15.8.1"
29
35
  },
30
36
  "devDependencies": {
31
- "react": "^16.3.0",
32
- "react-dom": "^16.3.0",
33
- "react-testing-library": "^5.4.4"
37
+ "@availity/api-axios": "^9.0.0",
38
+ "@availity/spaces": "1.0.0",
39
+ "@availity/training-link": "0.1.0",
40
+ "axios": "^1.7.4",
41
+ "formik": "^2.4.6",
42
+ "react": "^18.3.1",
43
+ "react-dom": "^18.3.1",
44
+ "yup": "^0.32.11"
34
45
  },
35
46
  "peerDependencies": {
36
- "react": "^16.3.0"
47
+ "@availity/api-axios": "^8.0.0",
48
+ "@availity/spaces": "^8.0.0",
49
+ "axios": "^1.7.4",
50
+ "formik": "^2.0.1",
51
+ "react": ">=16.11.0",
52
+ "react-dom": ">=16.11.0",
53
+ "yup": "^0.32.0"
37
54
  },
38
- "gitHead": "ca7f4108bea3ef671aada738d15a8628c495dd1d"
39
- }
55
+ "publishConfig": {
56
+ "access": "public"
57
+ }
58
+ }
package/project.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@availity/page-header",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "projectType": "library",
5
+ "targets": {
6
+ "test": {
7
+ "executor": "@nx/jest:jest",
8
+ "outputs": ["{workspaceRoot}/coverage/page-header"],
9
+ "options": {
10
+ "jestConfig": "packages/page-header/jest.config.js"
11
+ }
12
+ },
13
+ "version": {
14
+ "executor": "@jscutlery/semver:version",
15
+ "options": {
16
+ "preset": "angular",
17
+ "commitMessageFormat": "chore({projectName}): release version ${version} [skip ci]",
18
+ "tagPrefix": "@availity/{projectName}@",
19
+ "baseBranch": "master",
20
+ "trackDeps": true
21
+ }
22
+ },
23
+ "lint": {
24
+ "executor": "@nx/eslint:lint",
25
+ "options": {
26
+ "eslintConfig": ".eslintrc.yaml",
27
+ "silent": false,
28
+ "fix": false,
29
+ "cache": true,
30
+ "cacheLocation": "./node_modules/.cache/page-header/.eslintcache",
31
+ "maxWarnings": -1,
32
+ "quiet": false,
33
+ "noEslintrc": false,
34
+ "hasTypeAwareRules": true,
35
+ "cacheStrategy": "metadata"
36
+ }
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,195 @@
1
+ import React, { useMemo } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import classNames from 'classnames';
4
+ import Breadcrumbs from '@availity/breadcrumbs';
5
+ import AppIcon from '@availity/app-icon';
6
+ import Feedback from '@availity/feedback';
7
+ import Spaces, { SpacesLogo, useSpaces, useSpacesContext } from '@availity/spaces';
8
+ import '../styles.scss';
9
+
10
+ const PageHeader = ({
11
+ payerId = null,
12
+ logo,
13
+ spaceName,
14
+ spaceId = null,
15
+ children,
16
+ appName,
17
+ appAbbr,
18
+ iconColor,
19
+ branded,
20
+ showCrumbs = true,
21
+ crumbs,
22
+ feedback: showFeedback,
23
+ feedbackProps,
24
+ titleProps: { className: titleClassName, ...restTitleProps } = {},
25
+ renderRightContent: RenderRightContent,
26
+ renderRightClassName = 'page-header-right',
27
+ component,
28
+ tag: Tag = 'div',
29
+ clientId,
30
+ iconSrc,
31
+ iconAlt,
32
+ homeUrl = '/public/apps/dashboard',
33
+ linkTag,
34
+ className,
35
+ ...props
36
+ }) => {
37
+ const spaces = useSpaces(spaceId, payerId);
38
+
39
+ let firstSpaceForPayerID;
40
+ let firstSpaceForSpaceID;
41
+ if (!spaceId && payerId && spaces[0]) {
42
+ firstSpaceForPayerID = spaces[0];
43
+ } else {
44
+ firstSpaceForSpaceID = spaces[0];
45
+ firstSpaceForPayerID = spaces[1];
46
+ }
47
+ const { loading: spacesIsLoading } = useSpacesContext() || {};
48
+
49
+ const _space = firstSpaceForSpaceID || firstSpaceForPayerID;
50
+
51
+ let payerLogo = null;
52
+ if (payerId || logo) {
53
+ const logoAttrs = {
54
+ spaceId,
55
+ payerId,
56
+ className: 'd-inline-flex',
57
+ skeletonProps: {
58
+ width: 180,
59
+ height: '100%',
60
+ },
61
+ };
62
+ payerLogo =
63
+ firstSpaceForPayerID || (logo && firstSpaceForSpaceID) || spacesIsLoading ? (
64
+ <SpacesLogo {...logoAttrs} />
65
+ ) : (
66
+ <Spaces
67
+ spaceIds={spaceId ? [spaceId] : undefined}
68
+ payerIds={payerId ? [payerId] : undefined}
69
+ clientId={clientId}
70
+ >
71
+ <SpacesLogo {...logoAttrs} />
72
+ </Spaces>
73
+ );
74
+ }
75
+
76
+ const _spaceName = spaceName || (_space && _space.name);
77
+ if ((spaceId || _spaceName) && !crumbs) {
78
+ const url =
79
+ firstSpaceForSpaceID && firstSpaceForSpaceID.link && firstSpaceForSpaceID.link.url
80
+ ? firstSpaceForSpaceID.link.url
81
+ : `/web/spc/spaces/#/${spaceId}`;
82
+ crumbs = [{ name: _spaceName, url }];
83
+ }
84
+
85
+ const feedback = useMemo(() => <Feedback appName={appName} {...feedbackProps} />, [appName, feedbackProps]);
86
+
87
+ return (
88
+ <>
89
+ <div className="page-header-above">
90
+ {showCrumbs ? (
91
+ // eslint-disable-next-line react/jsx-no-useless-fragment
92
+ <>
93
+ {React.isValidElement(crumbs) ? (
94
+ crumbs
95
+ ) : (
96
+ <Breadcrumbs crumbs={crumbs} active={appName || children} homeUrl={homeUrl} linkTag={linkTag} />
97
+ )}
98
+ </>
99
+ ) : null}
100
+ {component}
101
+ </div>
102
+ <div className={classNames('page-header', className)} data-testid="page-header" {...props}>
103
+ <Tag
104
+ className={classNames('page-header-title', titleClassName)}
105
+ data-testid="page-header-title"
106
+ {...restTitleProps}
107
+ >
108
+ {!payerId && appAbbr && (
109
+ <AppIcon
110
+ data-testid="page-header-app-icon"
111
+ color={iconColor}
112
+ branded={branded}
113
+ title={appName}
114
+ src={iconSrc}
115
+ alt={iconAlt}
116
+ aria-hidden
117
+ >
118
+ {appAbbr}
119
+ </AppIcon>
120
+ )}
121
+ {children || <h1>{appName}</h1>}
122
+ </Tag>
123
+ {!RenderRightContent ? (
124
+ <div className="page-header-right">
125
+ {showFeedback && feedback}
126
+ {payerLogo}
127
+ </div>
128
+ ) : (
129
+ <RenderRightContent className={renderRightClassName} payerLogo={payerLogo} feedback={feedback} />
130
+ )}
131
+ </div>
132
+ </>
133
+ );
134
+ };
135
+
136
+ PageHeader.propTypes = {
137
+ /** Name of the application. */
138
+ appName: PropTypes.string.isRequired,
139
+ /** The name of the class. */
140
+ className: PropTypes.string,
141
+ /** Payer Space Name of the space in which this page is under. */
142
+ spaceName: PropTypes.string,
143
+ /** Payer Space ID of the space in which this page is under. */
144
+ spaceId: PropTypes.string,
145
+ /** If provided and payerId is not provided, the app icon will appear. */
146
+ appAbbr: PropTypes.string,
147
+ /** Potential values: "black", "blue", "green", "orange", "red". Only used if the app icon should appear. Default: "black". */
148
+ iconColor: PropTypes.string,
149
+ /** Triggers the app icon's "branded" styles. Only used if the app icon should appear. */
150
+ branded: PropTypes.bool,
151
+ /** The ID of the payer the application is for. If provided, the payer logo appears and not the app icon. */
152
+ payerId: PropTypes.string,
153
+ /** Allow rendering of an optional component in the top right of the header. */
154
+ component: PropTypes.element,
155
+ /** If true, the feedback loop button appears. */
156
+ feedback: PropTypes.bool,
157
+ /** See Feedback. Props to send to <Feedback /> component */
158
+ feedbackProps: PropTypes.shape({ ...Feedback.propTypes }),
159
+ /** Additional props passed to the page-header-title. */
160
+ titleProps: PropTypes.object,
161
+ /** This value appears at the h1 of the page. Overrides the appName to allow for custom elements (such as a "beta" tag). Default: ${appName}. */
162
+ children: PropTypes.node,
163
+ /** Custom link tag for the links. Default: <a> */
164
+ linkTag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
165
+ /** Flag whether or not to show the breadcrumbs. Default: true */
166
+ showCrumbs: PropTypes.bool,
167
+ /** Array of Objects containing name (String) and url (String) properties. The ancestor pages which get passed to the Breadcrumbs component. See Breadcrumbs */
168
+ crumbs: PropTypes.oneOfType([
169
+ PropTypes.arrayOf(
170
+ PropTypes.shape({
171
+ name: PropTypes.string,
172
+ url: PropTypes.string,
173
+ })
174
+ ),
175
+ PropTypes.node,
176
+ ]),
177
+ /** If true will fetch the payer logo using the spaceId or payerId. */
178
+ logo: PropTypes.bool,
179
+ /** The tag to render the page header as. Default: <h1>. */
180
+ tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
181
+ /** Used to customize the contents of the right side of the page header where the feedback and payer logo get rendered. Accepts the rendered payerLogo and feedback as props */
182
+ renderRightContent: PropTypes.func,
183
+ /** Renders the name of the right side of the page header */
184
+ renderRightClassName: PropTypes.string,
185
+ /** Url for the Home route. Default: public/apps/dashboard. */
186
+ homeUrl: PropTypes.string,
187
+ /** Client ID to use in Spaces to fetch the payer's logo */
188
+ clientId: PropTypes.string,
189
+ /** Image source for <AppIcon /> to be used instead of appAbbr. */
190
+ iconSrc: PropTypes.string,
191
+ /** Required if iconSrc is used. Image alt property of <AppIcon /> */
192
+ iconAlt: PropTypes.string,
193
+ };
194
+
195
+ export default PageHeader;
package/styles.scss ADDED
@@ -0,0 +1,47 @@
1
+ .page-header {
2
+ border-bottom: 1px solid #dadfdf;
3
+ margin: 40px 0 20px;
4
+ padding-bottom: 9px;
5
+ display: flex;
6
+ flex-wrap: wrap;
7
+ align-items: flex-end;
8
+ justify-content: space-between;
9
+ }
10
+
11
+ .page-header-right {
12
+ display: flex;
13
+ flex-wrap: wrap;
14
+ flex-shrink: 1;
15
+ align-items: flex-end;
16
+ margin: -.15rem;
17
+
18
+ img,
19
+ button, .btn,
20
+ a {
21
+ flex-grow: 0;
22
+ margin: .15rem;
23
+ max-width: 100%;
24
+ }
25
+ }
26
+
27
+ .page-header-title {
28
+ margin-bottom: 0;
29
+ align-items: center;
30
+ display: flex;
31
+
32
+ h1 {
33
+ margin-bottom: 0;
34
+ }
35
+
36
+ .app-icon {
37
+ margin-right: 0.5rem;
38
+ }
39
+ }
40
+
41
+ .page-header-above {
42
+ display: flex;
43
+ flex-wrap: wrap;
44
+ flex-shrink: 0;
45
+ align-items: flex-start;
46
+ justify-content: space-between;
47
+ }
package/tsconfig.json CHANGED
@@ -1,27 +1,5 @@
1
1
  {
2
- "compilerOptions": {
3
- "outDir": "build/lib",
4
- "module": "commonjs",
5
- "target": "es5",
6
- "lib": ["es5", "es6", "es7", "es2017", "dom"],
7
- "sourceMap": true,
8
- "allowJs": false,
9
- "jsx": "react",
10
- "moduleResolution": "node",
11
- "rootDirs": ["./"],
12
- "baseUrl": "",
13
- "forceConsistentCasingInFileNames": true,
14
- "noImplicitReturns": true,
15
- "noImplicitThis": true,
16
- "noImplicitAny": true,
17
- "strictNullChecks": true,
18
- "suppressImplicitAnyIndexErrors": true,
19
- "noUnusedLocals": true,
20
- "declaration": true,
21
- "allowSyntheticDefaultImports": true,
22
- "experimentalDecorators": true,
23
- "emitDecoratorMetadata": true
24
- },
25
- "include": ["**/*"],
26
- "exclude": ["node_modules", "build", "scripts"]
27
- }
2
+ "extends": "../../tsconfig.json",
3
+ "include": ["."],
4
+ "exclude": ["dist", "build", "node_modules"]
5
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "module": "commonjs",
6
+ "types": ["jest", "node", "@testing-library/jest-dom"],
7
+ "allowJs": true
8
+ },
9
+ "include": ["**/*.test.js", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
10
+ }
@@ -0,0 +1,36 @@
1
+ type CrumbType = {
2
+ name?: string;
3
+ url?: string;
4
+ };
5
+
6
+ export interface RightContentProps extends React.HTMLAttributes<HTMLElement> {
7
+ payerLogo?: React.ReactNode;
8
+ feedback?: React.ReactNode;
9
+ }
10
+
11
+ export interface PageHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
12
+ appName: string;
13
+ spaceName?: string;
14
+ spaceId?: string;
15
+ appAbbr?: string;
16
+ iconColor?: string;
17
+ branded?: boolean;
18
+ payerId?: string;
19
+ component?: React.ReactNode;
20
+ feedback?: boolean;
21
+ feedbackProps?: any;
22
+ logo?: boolean;
23
+ linkTag?: React.ComponentType<React.HTMLAttributes<HTMLAnchorElement>> | string;
24
+ titleProps?: React.HTMLAttributes<HTMLDivElement>;
25
+ renderRightContent?: React.FC<RightContentProps>;
26
+ crumbs?: CrumbType[] | React.ReactNode;
27
+ iconSrc?: string;
28
+ iconAlt?: string;
29
+ clientId?: string;
30
+ homeUrl?: string;
31
+ showCrumbs?: boolean;
32
+ }
33
+
34
+ declare const PageHeader: React.FC<PageHeaderProps>;
35
+
36
+ export default PageHeader;
package/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2017-present Availity, LLC
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/PageHeader.d.ts DELETED
@@ -1,22 +0,0 @@
1
- type CrumbType = {
2
- name?: string;
3
- url?: string;
4
- };
5
-
6
- export interface PageHeaderProps {
7
- appName: string;
8
- spaceName?: string;
9
- spaceId?: string;
10
- appAbbr?: string;
11
- iconColor?: string;
12
- branded?: boolean;
13
- payerId?: string;
14
- component?: React.ReactType;
15
- feedback?: boolean;
16
- children?: Node;
17
- crumbs?: Array<CrumbType>;
18
- }
19
-
20
- declare const PageHeader: React.FunctionComponent<PageHeaderProps>;
21
-
22
- export default PageHeader;
package/PageHeader.js DELETED
@@ -1,79 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import Breadcrumbs from '@availity/breadcrumbs';
4
- import AppIcon from '@availity/app-icon';
5
- import Feedback from '@availity/feedback';
6
- import PayerLogo from '@availity/payer-logo';
7
-
8
- const PageHeader = ({
9
- payerId,
10
- spaceName,
11
- spaceId,
12
- children,
13
- appName,
14
- appAbbr,
15
- iconColor,
16
- branded,
17
- crumbs: ogCrumbs,
18
- feedback,
19
- component,
20
- ...props
21
- }) => {
22
- let crumbs = ogCrumbs;
23
- if (spaceId || spaceName) {
24
- crumbs = [
25
- { name: spaceName, url: spaceId && `/web/spaces/spaces/#/${spaceId}` },
26
- ];
27
- }
28
- return (
29
- <React.Fragment>
30
- <div className="d-flex align-items-start">
31
- <Breadcrumbs crumbs={crumbs} active={appName || children} /> {component}
32
- </div>
33
- <h1 className="h4 page-header page-header-brand" {...props}>
34
- <div className="page-header-title">
35
- {!payerId && appAbbr && (
36
- <AppIcon color={iconColor} branded={branded} title={appName}>
37
- {appAbbr}
38
- </AppIcon>
39
- )}{' '}
40
- {children || appName}
41
- </div>
42
- {!payerId && feedback && (
43
- <Feedback
44
- appName={appName}
45
- className="float-md-right d-inline-block"
46
- />
47
- )}
48
- {payerId && (
49
- <PayerLogo
50
- spaceId={spaceId}
51
- payerId={payerId}
52
- className="float-md-right d-inline-block"
53
- />
54
- )}
55
- </h1>
56
- </React.Fragment>
57
- );
58
- };
59
-
60
- PageHeader.propTypes = {
61
- appName: PropTypes.string.isRequired,
62
- spaceName: PropTypes.string,
63
- spaceId: PropTypes.string,
64
- appAbbr: PropTypes.string,
65
- iconColor: PropTypes.string,
66
- branded: PropTypes.bool,
67
- payerId: PropTypes.string,
68
- component: PropTypes.element,
69
- feedback: PropTypes.bool,
70
- children: PropTypes.node,
71
- crumbs: PropTypes.arrayOf(
72
- PropTypes.shape({
73
- name: PropTypes.string,
74
- url: PropTypes.string,
75
- })
76
- ),
77
- };
78
-
79
- export default PageHeader;