Implement new toast UI (#10467)
* Implement new toast UI * Use PCSS vars and Caption component * Add GenericToast-test * Tweak call toast * Fix code style
This commit is contained in:
parent
e350b4c2c2
commit
7632f36624
14 changed files with 206 additions and 66 deletions
|
@ -18,6 +18,7 @@ import React, { ReactNode } from "react";
|
|||
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
import { XOR } from "../../../@types/common";
|
||||
import { Caption } from "../typography/Caption";
|
||||
|
||||
export interface IProps {
|
||||
description: ReactNode;
|
||||
|
@ -40,7 +41,7 @@ const GenericToast: React.FC<XOR<IPropsExtended, IProps>> = ({
|
|||
onAccept,
|
||||
onReject,
|
||||
}) => {
|
||||
const detailContent = detail ? <div className="mx_Toast_detail">{detail}</div> : null;
|
||||
const detailContent = detail ? <Caption className="mx_Toast_detail">{detail}</Caption> : null;
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
|
|
@ -19,13 +19,14 @@ import React, { HTMLAttributes } from "react";
|
|||
|
||||
interface Props extends Omit<HTMLAttributes<HTMLSpanElement>, "className"> {
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
isError?: boolean;
|
||||
}
|
||||
|
||||
export const Caption: React.FC<Props> = ({ children, isError, ...rest }) => {
|
||||
export const Caption: React.FC<Props> = ({ children, className, isError, ...rest }) => {
|
||||
return (
|
||||
<span
|
||||
className={classNames("mx_Caption", {
|
||||
className={classNames("mx_Caption", className, {
|
||||
mx_Caption_error: isError,
|
||||
})}
|
||||
{...rest}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue