Skip to content

Commit 04863cb

Browse files
authored
resolve theopenconversationkit#149: remove margin on paragraphs (theopenconversationkit#150)
1 parent 02d9117 commit 04863cb

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

src/components/MessageBot/MessageBot.stories.tsx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,16 @@ import MessageBot from './MessageBot';
55

66
const message = 'A bot message';
77

8+
const simpleHtml = '<p>A <b>formatted</b> bot message</p>';
9+
810
const html = `
911
<b>Hello user!</b>
1012
<p>This is how I display:</p>
1113
<ul>
12-
<li>
13-
a html link to the <a href="https://doc.tock.ai">Tock Documentation Page</a>
14-
</li>
15-
<li>
16-
a clickable string url to github.com/theopenconversationkit/tock-react-kit
17-
</li>
18-
<li>
19-
a phone number link <a href="tel:0612345678">0612345678</a>, but not a number string link +33612345678
20-
</li>
21-
<li>
22-
an e-mail link to a <a href="mailto:tock@yopmail.com">tock contact</a> and a string email link to tock@yopmail.com
23-
</li>
14+
<li>a html link to the <a href="https://doc.tock.ai">Tock Documentation Page</a></li>
15+
<li>a clickable string url to github.com/theopenconversationkit/tock-react-kit</li>
16+
<li>a phone number link <a href="tel:0612345678">0612345678</a>, but not a number string link +33612345678</li>
17+
<li>an e-mail link to a <a href="mailto:tock@yopmail.com">tock contact</a> and a string email link to tock@yopmail.com</li>
2418
</ul>`;
2519

2620
const meta: Meta<typeof MessageBot> = {
@@ -43,6 +37,19 @@ export const Default: Story = {
4337
},
4438
};
4539

40+
export const WithBasicFormatting: Story = {
41+
name: 'With basic formatting',
42+
args: {
43+
message: {
44+
author: 'bot',
45+
message: simpleHtml,
46+
type: MessageType.message,
47+
buttons: [],
48+
},
49+
onAction: Function.bind(null),
50+
},
51+
};
52+
4653
export const WithHtmlContent: Story = {
4754
name: 'With HTML content',
4855
args: {

src/components/MessageBot/MessageBot.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export const MessageContainer: StyledComponent<{}> = styled.li`
1515
max-width: ${theme('sizing.conversation.width')};
1616
margin: 0.5em auto;
1717
list-style: none;
18+
19+
p {
20+
margin: 0;
21+
}
1822
`;
1923

2024
export const Message: StyledComponent<{}> = styled.div`

0 commit comments

Comments
 (0)