import { Avatar, Button, CardContent, TextField } from "@material-ui/core"; import deepPurple from "@material-ui/core/colors/deepPurple"; import PersonIcon from "@material-ui/icons/Person"; import { makeStyles } from "@saleor/macaw-ui"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; const useStyles = makeStyles( theme => ({ avatar: { "& span": { height: "100%", width: "100%" }, alignSelf: "flex-start", marginRight: theme.spacing(3.5) }, button: { zIndex: 2 }, cardActionsExpanded: { maxHeight: theme.spacing(6) }, input: { "& > div": { padding: "0 14px" }, "& textarea": { "&::placeholder": { opacity: [[1], "!important"] as any }, zIndex: 2 }, background: theme.palette.background.paper }, noteRoot: { left: theme.spacing(-8.5), marginBottom: theme.spacing(3), position: "relative", width: `calc(100% + ${theme.spacing(8.5)})` }, noteTitle: { "&:last-child": { paddingBottom: 0, paddingRight: 0 }, alignItems: "center", background: theme.palette.background.default, display: "flex", paddingLeft: theme.spacing(3) }, root: { borderColor: theme.palette.divider, borderStyle: "solid", borderWidth: "0 0 0 2px", marginLeft: 20, paddingLeft: theme.spacing(3) } }), { name: "Timeline" } ); interface TimelineProps { children?: React.ReactNode; } interface TimelineAddNoteProps { disabled?: boolean; message: string; reset: () => void; onChange(event: React.ChangeEvent); onSubmit(event: React.FormEvent); } export const Timeline: React.FC = props => { const { children } = props; const classes = useStyles(props); return
{children}
; }; export const TimelineAddNote: React.FC = props => { const { message, onChange, onSubmit, reset, disabled } = props; const classes = useStyles(props); const intl = useIntl(); const submit = e => { reset(); onSubmit(e); }; return (
submit(e)} disabled={disabled} > ) }} variant="outlined" />
); }; Timeline.displayName = "Timeline"; export default Timeline;