Skip to content

Commit

Permalink
Fix/#265 added RC_HOST as env variable (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanu-chahal authored Oct 25, 2023
1 parent 6c22307 commit 26f7e3f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ yarn storybook

Till now, storybook should be up and running. You can play around with EmbeddedChat and it's component and see changes in storybook in real-time.

By default, the Rocket Chat server host is http://localhost:3000, in case you have Rocket Chat server running on any other port/server you can try set up custom url as ```STORYBOOK_RC_HOST=<your-custom-url>``` variable by creating a ``.env`` file in ```packages/react``` directory or simply run this commmand in ```packages/react```:

```bash
STORYBOOK_RC_HOST=<your-custom-url> yarn storybook
```

### Working with api and auth packages.

#### Starting auth dev environment
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const EmbeddedChat = ({
moreOpts = false,
width = '100%',
height = '50vh',
host = 'http://localhost:3000',
host = process.env.STORYBOOK_RC_HOST || 'http://localhost:3000',
roomId = 'GENERAL',
channelName,
anonymousMode = false,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/stories/EmbeddedChat.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
export const Simple = {
args: {
host: 'http://localhost:3000',
host: process.env.STORYBOOK_RC_HOST || 'http://localhost:3000',
roomId: 'GENERAL',
GOOGLE_CLIENT_ID: '',
isClosable: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
export const Simple = {
args: {
host: 'http://localhost:3000',
host: process.env.STORYBOOK_RC_HOST || 'http://localhost:3000',
roomId: 'GENERAL',
GOOGLE_CLIENT_ID: '',
isClosable: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/stories/EmbeddedChatTheme.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
export const WithTheme = {
args: {
host: 'http://localhost:3000',
host: process.env.STORYBOOK_RC_HOST || 'http://localhost:3000',
roomId: 'GENERAL',
GOOGLE_CLIENT_ID: '',
isClosable: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
export const Simple = {
args: {
host: 'http://localhost:3000',
host: process.env.STORYBOOK_RC_HOST || 'http://localhost:3000',
roomId: 'GENERAL',
GOOGLE_CLIENT_ID: '',
isClosable: true,
Expand Down

0 comments on commit 26f7e3f

Please sign in to comment.