-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from atlassian/ARC-2729-add-images-and-update…
…-content ARC-2729 add images and update content
- Loading branch information
Showing
14 changed files
with
496 additions
and
113 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
73 changes: 73 additions & 0 deletions
73
app/jenkins-for-jira-ui/src/components/ConnectionPanel/ConnectionPanelContent.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import React from 'react'; | ||
import { cx } from '@emotion/css'; | ||
import Button, { Appearance, ButtonGroup } from '@atlaskit/button'; | ||
import { ConnectedState } from '../StatusLabel/StatusLabel'; | ||
import { | ||
connectionPanelContainerContainer, | ||
connectionPanelContainerHeader, | ||
connectionPanelContainerParagraph | ||
} from './ConnectionPanel.styles'; | ||
import { ConnectionPendingIcon } from '../icons/ConnectionPendingIcon'; | ||
import { NoDataIcon } from '../icons/NoDataIcon'; | ||
import { DuplicateServerIcon } from '../icons/DuplicateServerIcon'; | ||
|
||
type NotConnectedStateProps = { | ||
connectedState: ConnectedState; | ||
contentHeader: string, | ||
contentInstructionOne: string, | ||
contentInstructionTwo?: string, | ||
buttonAppearance: Appearance, | ||
firstButtonLabel: string, | ||
secondButtonLabel?: string, | ||
buttonOneOnClick(data?: any): void, | ||
buttonTwoOnClick?(): void, | ||
testId?: string | ||
}; | ||
|
||
const ConnectionPanelContent = ({ | ||
connectedState, | ||
contentHeader, | ||
contentInstructionOne, | ||
contentInstructionTwo, | ||
buttonAppearance, | ||
firstButtonLabel, | ||
secondButtonLabel, | ||
buttonOneOnClick, | ||
buttonTwoOnClick, | ||
testId | ||
}: NotConnectedStateProps): JSX.Element => { | ||
let icon; | ||
|
||
if (connectedState === ConnectedState.CONNECTED) { | ||
icon = <NoDataIcon />; | ||
} else if (connectedState === ConnectedState.PENDING) { | ||
icon = <ConnectionPendingIcon />; | ||
} else { | ||
icon = <DuplicateServerIcon />; | ||
} | ||
|
||
return ( | ||
<div className={cx(connectionPanelContainerContainer)}> | ||
{icon} | ||
<h3 className={cx(connectionPanelContainerHeader)}>{contentHeader}</h3> | ||
<p className={cx(connectionPanelContainerParagraph)}>{contentInstructionOne}</p> | ||
<p className={cx(connectionPanelContainerParagraph)}>{contentInstructionTwo}</p> | ||
<ButtonGroup> | ||
<Button | ||
appearance={buttonAppearance} | ||
onClick={buttonOneOnClick} | ||
testId={testId} | ||
> | ||
{firstButtonLabel} | ||
</Button> | ||
{ | ||
secondButtonLabel | ||
? <Button onClick={buttonTwoOnClick}>{secondButtonLabel}</Button> | ||
: <></> | ||
} | ||
</ButtonGroup> | ||
</div> | ||
); | ||
}; | ||
|
||
export { ConnectionPanelContent }; |
This file contains 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
Oops, something went wrong.