1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-04-14 11:18:47 +02:00

Desktop: Clickable tags in Tag Bar (#5956)

This commit is contained in:
Kenichi Kobayashi 2022-01-09 20:32:21 +09:00 committed by GitHub
parent 89184a3f9f
commit a683f12622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -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>;
}
}

View File

@ -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} />);

View File

@ -227,6 +227,7 @@ function addExtraStyles(style: any) {
justifyContent: 'center',
marginRight: 8,
borderRadius: 100,
borderWidth: 0,
};
style.toolbarStyle = {