Skip to content

Commit 0480b46

Browse files
committed
docs: document example chat app layout for v11 docs
1 parent c7ce7bd commit 0480b46

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

Diff for: docusaurus/react_versioned_docs/version-11.x.x/basics/getting-started.mdx

+81
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,87 @@ const App = () => {
6161
};
6262
```
6363

64+
To organize the components in a chat messenger layout, we provide the following CSS:
65+
66+
```css
67+
html,
68+
body,
69+
#root {
70+
margin: unset;
71+
padding: unset;
72+
height: 100%;
73+
}
74+
75+
#root {
76+
display: flex;
77+
height: 100%;
78+
79+
.str-chat-channel-list {
80+
position: fixed;
81+
z-index: 1;
82+
width: 0;
83+
84+
&--open {
85+
width: 100%;
86+
}
87+
}
88+
89+
.str-chat-channel {
90+
width: 100%;
91+
}
92+
93+
.str-chat__thread {
94+
width: 100%;
95+
height: 100%;
96+
position: fixed;
97+
z-index: 1;
98+
}
99+
100+
.str-chat__channel-header .str-chat__header-hamburger {
101+
width: 30px;
102+
height: 38px;
103+
padding: var(--xxs-p);
104+
margin-right: var(--xs-m);
105+
display: flex;
106+
align-items: center;
107+
justify-content: center;
108+
cursor: pointer;
109+
border: none;
110+
background: transparent;
111+
112+
&:hover {
113+
svg path {
114+
fill: var(--primary-color);
115+
}
116+
}
117+
}
118+
119+
@media screen and (min-width: 768px) {
120+
.str-chat-channel-list {
121+
width: 30%;
122+
max-width: 420px;
123+
position: initial;
124+
z-index: 0;
125+
}
126+
127+
.str-chat__thread {
128+
position: initial;
129+
z-index: 0;
130+
}
131+
}
132+
133+
@media screen and (min-width: 1024px) {
134+
.str-chat__thread {
135+
width: 45%;
136+
}
137+
138+
.str-chat__channel-header .str-chat__header-hamburger {
139+
display: none;
140+
}
141+
}
142+
}
143+
```
144+
64145
## Chat Client & Connecting User
65146

66147
To communicate with the Stream Chat API the SDK requires a client with an established connection. The hook mentioned in the code above (`useCreateChatClient`) handles client instantiation, establishes proper connection and handles cleanups and disconnects for you. If you wish to have more control over how all of the previously mentioned is being handled see [Client and User](../guides/client-and-user.mdx) guide.

0 commit comments

Comments
 (0)