summaryrefslogtreecommitdiffstats
path: root/ui/src/components/home.tsx
blob: cebe222b7af331565b40dd450090a78fe522e4db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Component } from 'inferno';
import { Main } from './main';
import { ListingType } from '../interfaces';

export class Home extends Component<any, any> {

  constructor(props: any, context: any) {
    super(props, context);
  }

  render() {
    return (
      <Main type={this.listType()}/>
    )
  }

  componentDidMount() {
    document.title = "Lemmy";
  }

  listType(): ListingType { 
    return (this.props.match.path == '/all') ? ListingType.All : ListingType.Subscribed;
  }
}