You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Desktop: Clickable tags in Tag Bar (#5956)
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							89184a3f9f
						
					
				
				
					commit
					a683f12622
				
			| @@ -1,14 +1,15 @@ | ||||
| const React = require('react'); | ||||
| const { connect } = require('react-redux'); | ||||
| const { themeStyle } = require('@joplin/lib/theme'); | ||||
| const CommandService = require('@joplin/lib/services/CommandService').default; | ||||
|  | ||||
| class TagItemComponent extends React.Component { | ||||
| 	render() { | ||||
| 		const theme = themeStyle(this.props.themeId); | ||||
| 		const style = Object.assign({}, theme.tagStyle); | ||||
| 		const title = this.props.title; | ||||
| 		const { title, id } = this.props; | ||||
|  | ||||
| 		return <span style={style}>{title}</span>; | ||||
| 		return <button style={style} onClick={() => CommandService.instance().execute('openTag', id)}>{title}</button>; | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -42,6 +42,7 @@ function TagList(props: Props) { | ||||
| 		for (let i = 0; i < tags.length; i++) { | ||||
| 			const props = { | ||||
| 				title: tags[i].title, | ||||
| 				id: tags[i].id, | ||||
| 				key: tags[i].id, | ||||
| 			}; | ||||
| 			output.push(<TagItem {...props} />); | ||||
|   | ||||
| @@ -227,6 +227,7 @@ function addExtraStyles(style: any) { | ||||
| 		justifyContent: 'center', | ||||
| 		marginRight: 8, | ||||
| 		borderRadius: 100, | ||||
| 		borderWidth: 0, | ||||
| 	}; | ||||
|  | ||||
| 	style.toolbarStyle = { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user