-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: theming-v2 documentation (#1722)
* docs: add scripts to run documentation server locally * docs: add documentation guide for contributors * test: fix channel data generation for ChannelHeader tests * docs: add migration guides folder * docs: add GHComponentLink component to generate Github links * docs: add corrections and review notes to chat.mdx * docs: add corrections and review notes to chat-context.mdx * docs: add corrections and review notes to channel-list.mdx * docs: add corrections and new content to channel-search.mdx * docs: add image assets for channel-search.mdx * docs: add ReviewNote docusaurus component * docs: fix doc string of the VirtualizedMessageList's Message prop * docs: fix doc string of the VirtualizedMessageList's Message prop * docs: add asset message-actions-box-custom-actions.png * docs: review core-components documentation * docs: review contexts documentation * docs: review basics documentation * docs: review message-components documentation * docs: update migration guide v10 * docs: add corrections and snippet to attachment.mdx * docs: add missing migration for the shouldSubmit property * deprecate: useCustomStyles hook * docs: update channel preview example * docs: add deprecation notice to css and theming * docs: fix md table formatting for message-ui.mdx * docs: add prop author to ReviewNote component * docs: fix typo * docs: add missing prop documentation and fix table formatting for reactions.mdx * docs: add missing information to attachment.mdx doc * docs: add missing information to message UI components documentation * fix: remove unused prop displayLeft from MessageOptions * docs: add docstrings to message UI components * docs: document message input props in alpha order * docs: add missing props documentation and fix props name for msg input UI components * docs: add keywords and warning to v1 theming * docs: fix the example in reactions.mdx * docs: fix examples in customization message-ui.mdx * docs: fix mistakes in customization input-ui.mdx * docs: remove dated examples, links, update text in typescript.mdx * docs(examples): update channel users list * docs(examples): update livestream setup * docs: instruct users to use css bundled with stream-chat-react * docs: review code examples for channel-list-preview.mdx Co-authored-by: Anton Arnautov <[email protected]> Co-authored-by: Anton Arnautov <[email protected]>
- Loading branch information
1 parent
bc888ef
commit 03fbe2b
Showing
63 changed files
with
1,737 additions
and
883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Documenting the SDK | ||
|
||
If you are introducing changes impacting the API or behavior of the SDK parts, you should document these. Our documentation is generated with [docusaurus](https://docusaurus.io/docs). We have our own cli tool [stream-chat-docusaurus-cli](https://github.com/GetStream/stream-chat-docusaurus-cli#installation-and-using-the-cli) to run the documentation server locally, so that you can inspect your adjustments. | ||
|
||
## Run the documentation server locally | ||
|
||
1. **Install [stream-chat-docusaurus-cli](https://github.com/GetStream/stream-chat-docusaurus-cli#installation-and-using-the-cli)** | ||
(You will need it to serve the documentation locally) | ||
2. **Run the documentation server** | ||
|
||
|
||
```bash | ||
yarn docs-run | ||
``` | ||
|
||
## Documentation patterns | ||
|
||
To keep the documentation consistent we would like you to adhere to the following recommendations: | ||
|
||
1. todo |
76 changes: 76 additions & 0 deletions
76
docusaurus/docs/React/_docusaurus-components/ReviewNote.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React from 'react'; | ||
import BrowserOnly from '@docusaurus/BrowserOnly'; | ||
|
||
const rootStyle = { | ||
display:'flex', | ||
position: 'relative', | ||
cursor: 'pointer', | ||
padding: '10px 10px', | ||
margin: '10px 0', | ||
borderRadius: "8px", | ||
background: 'gold', | ||
boxShadow: '0 1px 1px rgba(0,0,0,0.15)' | ||
} | ||
|
||
const popupStyle = { | ||
position: 'absolute', | ||
left: 0, | ||
bottom: "60px", | ||
width: '100%', | ||
background: 'white', | ||
boxShadow: '0 4px 4px 4px rgba(0,0,0,0.15)', | ||
padding: '10px 10px', | ||
} | ||
|
||
const ReviewNote = ({author, children, id}) => { | ||
const [display, setDisplay] = React.useState('none'); | ||
const [keepDisplayed, setKeepDisplayed] = React.useState(false); | ||
const [root, setRoot] = React.useState(null); | ||
const handleMouseLeave = React.useCallback(() => { | ||
if (keepDisplayed) return; | ||
setDisplay('none'); | ||
}, [keepDisplayed]); | ||
|
||
React.useEffect(() => { | ||
if (!root) return; | ||
|
||
const handleClick = (event) => { | ||
if (!root.contains(event.target)) { | ||
setKeepDisplayed(false) | ||
} | ||
} | ||
document.addEventListener('click', handleClick); | ||
|
||
return () => { | ||
document.removeEventListener('click', handleClick); | ||
} | ||
}, [root]); | ||
|
||
return ( | ||
<BrowserOnly> | ||
{() => window.location.hostname === 'localhost' ? ( | ||
<div style={rootStyle} | ||
onClick={(event) => { | ||
event.stopPropagation(); | ||
setKeepDisplayed(prev => !prev); | ||
}} | ||
onMouseEnter={() => setDisplay('block')} | ||
onMouseLeave={handleMouseLeave} | ||
ref={setRoot} | ||
> | ||
<div style={{display, ...popupStyle}}> | ||
|
||
<div style={{ width: '100%'}}>{children}</div> | ||
</div> | ||
<div style={{display: 'flex', justifyContent: 'space-between', width: '100%'}}> | ||
<div>Review note {author && <span style={{fontSize: '10px'}}>[author: {author}]</span>}</div>< div style={{fontSize: '10px'}}>[{id}]</div> | ||
|
||
</div> | ||
|
||
</div> | ||
): null} | ||
</BrowserOnly> | ||
); | ||
} | ||
|
||
export default ReviewNote; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.