-
Notifications
You must be signed in to change notification settings - Fork 1
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 #138 from SwitchDreams/fix/size-of-support-message
♻️ Refactor ErrorMessage to SupportOrErrorMessage
- Loading branch information
Showing
8 changed files
with
36 additions
and
29 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
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
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
import React from "react"; | ||
import { Text } from "src/components/Text"; | ||
|
||
interface ErrorMsgProps { | ||
error: boolean; | ||
supportText?: string; | ||
errorMsg?: string; | ||
} | ||
|
||
export const SupportOrErrorMessage = ({ error, supportText, errorMsg }: ErrorMsgProps) => { | ||
return error && errorMsg ? ( | ||
<Text size="xs" as="span" className="text-error-500"> | ||
{errorMsg} | ||
</Text> | ||
) : ( | ||
supportText && ( | ||
<Text size="xs" as="span" className="text-coolGray-600"> | ||
{supportText} | ||
</Text> | ||
) | ||
); | ||
}; | ||
|
||
export default SupportOrErrorMessage; |