forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scope product-callout and contributor-callout css to component (githu…
…b#20801) * remove custom css for product-callout and contributor-callout * create callout component, update existing test * use Callout in more places
- Loading branch information
1 parent
5b59619
commit 23f4681
Showing
7 changed files
with
46 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.container p { | ||
margin: 0; | ||
} |
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,28 @@ | ||
import { DOMAttributes, ReactNode } from 'react' | ||
import cx from 'classnames' | ||
import styles from './Callout.module.scss' | ||
|
||
type Props = { | ||
dangerouslySetInnerHTML?: DOMAttributes<HTMLDivElement>['dangerouslySetInnerHTML'] | ||
variant: 'success' | 'info' | 'warning' | ||
children?: ReactNode | ||
className?: string | ||
} | ||
export const Callout = ({ variant, className, dangerouslySetInnerHTML, children }: Props) => { | ||
return ( | ||
<div | ||
data-testid="callout" | ||
className={cx( | ||
className, | ||
styles.container, | ||
'border rounded-1 p-3 f5', | ||
variant === 'success' && 'color-border-success color-bg-success', | ||
variant === 'info' && 'color-border-info color-bg-info', | ||
variant === 'warning' && 'color-bg-warning color-border-warning' | ||
)} | ||
dangerouslySetInnerHTML={dangerouslySetInnerHTML} | ||
> | ||
{children} | ||
</div> | ||
) | ||
} |
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