]> Untitled Git - lemmy.git/blob - ui/src/components/cake-day.tsx
Updates to PR as requested
[lemmy.git] / ui / src / components / cake-day.tsx
1 import { Component } from 'inferno';
2 import { i18n } from '../i18next';
3
4 interface CakeDayProps {
5   creator_name: string;
6   is_post_creator?: boolean;
7 }
8
9 export class CakeDay extends Component<CakeDayProps, any> {
10   render() {
11     const { creator_name, is_post_creator } = this.props;
12
13     return (
14       <div
15         className={`mr-lg-2 d-inline-block unselectable pointer${
16           is_post_creator ? ' mx-2' : ''
17         }`}
18         data-tippy-content={this.cakeDayTippy(creator_name)}
19       >
20         <svg class="icon icon-inline">
21           <use xlinkHref="#icon-cake"></use>
22         </svg>
23       </div>
24     );
25   }
26
27   cakeDayTippy(creator_name: string): string {
28     return i18n.t('cake_day_info', { creator_name });
29   }
30 }