Skip to content

Commit

Permalink
Preserve line breaks in toast body
Browse files Browse the repository at this point in the history
Closes #144
  • Loading branch information
timolins committed Jan 4, 2022
1 parent b8b3762 commit f981e45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/components/sections/toast-example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ const examples: Array<{
title: 'Multi Line',
emoji: '↕️',
snippet: `toast(
"This toast is super big. I don't think anyone could eat it in one bite. It's larger than you expected. You eat it but it does not seem to get smaller.",
"This toast is super big. I don't think anyone could eat it in one bite.\\n\\nIt's larger than you expected. You eat it but it does not seem to get smaller.",
{
duration: 6000,
}
);`,
action: () => {
toast(
"This toast is super big. I don't think anyone could eat it in one bite. It's larger than you expected. You eat it but it does not seem to get smaller.",
"This toast is super big. I don't think anyone could eat it in one bite.\n\n It's larger than you expected. You eat it but it does not seem to get smaller.",
{
duration: 6000,
}
Expand Down
1 change: 1 addition & 0 deletions src/components/toast-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const Message = styled('div')`
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`;

interface ToastBarProps {
Expand Down

1 comment on commit f981e45

@vercel
Copy link

@vercel vercel bot commented on f981e45 Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.