mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			36 lines
		
	
	
		
			705 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			705 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| "use strict";
 | |
| 
 | |
| const _ = require("lodash");
 | |
| 
 | |
| const render_pm_list_item = require("../templates/pm_list_item.hbs");
 | |
| 
 | |
| const vdom = require("./vdom");
 | |
| 
 | |
| exports.keyed_pm_li = (convo) => {
 | |
|     const render = () => render_pm_list_item(convo);
 | |
| 
 | |
|     const eq = (other) => _.isEqual(convo, other.convo);
 | |
| 
 | |
|     const key = convo.user_ids_string;
 | |
| 
 | |
|     return {
 | |
|         key,
 | |
|         render,
 | |
|         convo,
 | |
|         eq,
 | |
|     };
 | |
| };
 | |
| 
 | |
| exports.pm_ul = (convos) => {
 | |
|     const attrs = [
 | |
|         ["class", "expanded_private_messages"],
 | |
|         ["data-name", "private"],
 | |
|     ];
 | |
|     return vdom.ul({
 | |
|         attrs,
 | |
|         keyed_nodes: convos.map((convo) => exports.keyed_pm_li(convo)),
 | |
|     });
 | |
| };
 | |
| 
 | |
| window.pm_list_dom = exports;
 |