Skip to content

Commit

Permalink
Keyboard help screen to use HTML description list (#5116)
Browse files Browse the repository at this point in the history
* Keyboard help screen to use HTML description list

* Update PR number

* Fix styles
  • Loading branch information
compulim authored Apr 4, 2024
1 parent 512cc60 commit 136b5a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- Fixes [#5050](https://github.com/microsoft/BotFramework-WebChat/issues/5050). Fixed focus should not blur briefly after tapping on a suggested action, by [@compulim](https://github.com/compulim), in PR [#5097](https://github.com/microsoft/BotFramework-WebChat/issues/pull/5097)
- Fixes [#5111](https://github.com/microsoft/BotFramework-WebChat/issues/5111). Fixed keyboard help screen to use HTML description list, by [@compulim](https://github.com/compulim), in PR [#5116](https://github.com/microsoft/BotFramework-WebChat/issues/pull/5116)

### Changed

Expand Down
4 changes: 3 additions & 1 deletion packages/component/src/Styles/StyleSet/KeyboardHelp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ export default function createKeyboardHelpStyleSet({ paddingRegular, primaryFont
},

'& .webchat__keyboard-help__notes': {
marginBottom: paddingRegular
marginBottom: paddingRegular,
marginTop: 0
},

'& .webchat__keyboard-help__notes-header': {
fontWeight: 'bold',
margin: 0
},

Expand Down
12 changes: 6 additions & 6 deletions packages/component/src/Transcript/KeyboardHelp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import React, { useCallback, useState } from 'react';

import type { FC } from 'react';

import useUniqueId from '../hooks/internal/useUniqueId';
import useFocus from '../hooks/useFocus';
import useStyleSet from '../hooks/useStyleSet';
import useUniqueId from '../hooks/internal/useUniqueId';

const { useLocalizer } = hooks;

Expand All @@ -17,16 +17,16 @@ type NotesBodyProps = {
};

const Notes: FC<NotesBodyProps> = ({ header, text }) => (
<section className="webchat__keyboard-help__notes">
<h4 className="webchat__keyboard-help__notes-header">{header}</h4>
<dl className="webchat__keyboard-help__notes">
<dt className="webchat__keyboard-help__notes-header">{header}</dt>
{text.split('\n').map((line, index) => (
// We are splitting lines into paragraphs, index as key is legitimate here.
// eslint-disable-next-line react/no-array-index-key
<p className="webchat__keyboard-help__notes-text" key={index}>
<dd className="webchat__keyboard-help__notes-text" key={index}>
{line}
</p>
</dd>
))}
</section>
</dl>
);

Notes.propTypes = {
Expand Down

0 comments on commit 136b5a4

Please sign in to comment.