-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72699cf
commit 8b3a6ea
Showing
5 changed files
with
55 additions
and
51 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
14 changes: 14 additions & 0 deletions
14
airbyte-webapp/src/views/Connection/ConnectionForm/components/ResponseMessage.module.scss
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,14 @@ | ||
.message { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
flex: 1; | ||
} | ||
|
||
.success { | ||
color: colors.$green; | ||
} | ||
|
||
.error { | ||
color: colors.$red; | ||
} |
33 changes: 33 additions & 0 deletions
33
airbyte-webapp/src/views/Connection/ConnectionForm/components/ResponseMessage.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,33 @@ | ||
import classnames from "classnames"; | ||
|
||
import { Text } from "components/base/Text"; | ||
|
||
import styles from "./ResponseMessage.module.scss"; | ||
|
||
interface ResponseMessageProps { | ||
successMessage?: React.ReactNode; | ||
errorMessage?: React.ReactNode; | ||
dirty: boolean; | ||
} | ||
export const ResponseMessage: React.FC<ResponseMessageProps> = ({ successMessage, errorMessage, dirty }) => { | ||
const messageStyle = classnames(styles.message, { | ||
[styles.success]: successMessage, | ||
[styles.error]: errorMessage, | ||
}); | ||
if (errorMessage) { | ||
return ( | ||
<Text as="div" size="lg" className={messageStyle}> | ||
{errorMessage} | ||
</Text> | ||
); | ||
} | ||
|
||
if (successMessage && !dirty) { | ||
return ( | ||
<Text as="div" size="lg" className={messageStyle} data-id="success-result"> | ||
{successMessage} | ||
</Text> | ||
); | ||
} | ||
return null; | ||
}; |