Skip to content

Commit 2aedea7

Browse files
authored
Merge pull request #444 from talkjs/feat/add-action-button-to-clickable-header-example
Update clickable header tutorial to use action button
2 parents 3948cb5 + 696f35f commit 2aedea7

File tree

12 files changed

+284
-361
lines changed

12 files changed

+284
-361
lines changed

howtos/how-to-make-a-clickable-avatar-in-a-header/public/css/style.css

-171
This file was deleted.

howtos/how-to-make-a-clickable-avatar-in-a-header/public/js/script.js

-64
This file was deleted.

howtos/how-to-make-a-clickable-avatar-in-a-header/views/index.ejs

-51
This file was deleted.

howtos/how-to-make-a-clickable-avatar-in-a-header/views/profile.ejs

-70
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
This is an example project for TalkJS's tutorial on how to make a clickable avatar that links to the user’s profile.
1+
This is an example project for TalkJS's tutorial on how to make a clickable link to the user’s profile.
22

3-
This project uses TalkJS's [custom header feature](https://talkjs.com/docs/Features/Customizations/Creating_Custom_Headers/). The custom header in this example contains a link that leads to user's profile page.
3+
This project uses TalkJS's [custom header feature](https://talkjs.com/docs/Features/Customizations/Creating_Custom_Headers/). The custom header in this example contains a link that leads to user's profile page.
44

5-
The frontend fetches the data from a backend ExpressJS server that returns the list of users, the information about the current user and the current template.
5+
The frontend fetches the data from a backend ExpressJS server that returns the list of users, the information about the current user and the current template.
66

77
## Prerequisites
88

9-
To run this tutorial, you will need:
9+
To run this tutorial, you will need:
1010

1111
- A [TalkJS account](https://talkjs.com/dashboard/login)
1212
- [Node.js](https://nodejs.org/en)
@@ -17,4 +17,11 @@ To run this tutorial, you will need:
1717
1. Clone or download the project
1818
2. Replace `<APP_ID>` in `server.js` with the value found in your [TalkJS dashboard](https://talkjs.com/dashboard/login).
1919
3. Run `npm install` to install dependencies.
20-
4. Run `npm start` to start the server.
20+
4. Run `npm start` to start the server.
21+
5. Add an action button to the chat header of your theme:
22+
1. Go to the **Themes** tab of the TalkJS dashboard.
23+
2. Select to **Edit** your current theme.
24+
3. In the list of **Built-in Components**, select **ChatHeader**.
25+
4. Find the code for displaying the user's name in the header (something like `<span>{{user.name}}</span>`) and replace it with the following:
26+
`<span><ActionButton action="goToProfile" data-userId="{{user.id}}">{{user.name}}</ActionButton></span>`
27+
5. If you are in Live mode, select **Copy to live**.

0 commit comments

Comments
 (0)