Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'garage/t-anlian/card-change-css' of https://github.com/…
…microsoft/WebTemplateStudio into garage/t-anlian/card-change-css
- Loading branch information
Showing
9 changed files
with
198 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from "react"; | ||
import classnames from "classnames"; | ||
import { injectIntl, defineMessages, InjectedIntl } from "react-intl"; | ||
|
||
import { ReactComponent as Warning } from "../../assets/warning.svg"; | ||
import { ReactComponent as Checkmark } from "../../assets/checkgreen.svg"; | ||
|
||
import styles from "./styles.module.css"; | ||
|
||
interface IProps { | ||
showWarning: Boolean; | ||
text: string; | ||
altMessage: string; | ||
} | ||
|
||
const Notification = ({ showWarning, text, altMessage }: IProps) => { | ||
const messages = defineMessages({ | ||
notificationMessage: { | ||
id: "notification.notificationAltMessage", | ||
defaultMessage: altMessage | ||
} | ||
}); | ||
|
||
return ( | ||
<React.Fragment> | ||
<div role="img" aria-label={altMessage}> | ||
{showWarning ? ( | ||
<Warning className={styles.iconWarning} /> | ||
) : ( | ||
<Checkmark className={styles.iconCheck} /> | ||
)} | ||
</div> | ||
<div | ||
className={classnames(styles.text, { | ||
[styles.bodyGreen]: !showWarning, | ||
[styles.bodyYellow]: showWarning | ||
})} | ||
> | ||
{text} | ||
</div> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default injectIntl(Notification); |
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,40 @@ | ||
.text { | ||
margin-left: 6px; | ||
font-style: normal; | ||
font-weight: 600; | ||
font-size: 12px; | ||
} | ||
|
||
.iconCheck { | ||
margin-top: 3px; | ||
height: 14px; | ||
} | ||
|
||
.iconWarning { | ||
margin-top: 3px; | ||
height: 16px; | ||
} | ||
|
||
.iconCheck path { | ||
fill: var(--vscode-gitDecoration-untrackedResourceForeground); | ||
} | ||
|
||
.iconWarning path { | ||
fill: var(--vscode-editorMarkerNavigationWarning-background); | ||
} | ||
|
||
.borderGreen { | ||
border: 1px solid var(--vscode-gitDecoration-untrackedResourceForeground); | ||
} | ||
|
||
.borderYellow { | ||
border: 1px solid var(--vscode-editorMarkerNavigationWarning-background); | ||
} | ||
|
||
.bodyGreen { | ||
color: var(--vscode-gitDecoration-untrackedResourceForeground); | ||
} | ||
|
||
.bodyYellow { | ||
color: var(--vscode-editorMarkerNavigationWarning-background); | ||
} |
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
Oops, something went wrong.