From 8f44607956d9f5dd6583bed5d5e8263d1f02440c Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 7 Sep 2020 23:09:11 -0500 Subject: [PATCH] Main page done. --- package.json | 2 +- src/shared/components/data-type-select.tsx | 1 - src/shared/components/listing-type-select.tsx | 18 ++ src/shared/components/main.tsx | 199 +++++++++++------- src/shared/components/navbar.tsx | 1 - src/shared/components/sort-select.tsx | 8 +- src/shared/routes.ts | 8 +- src/shared/utils.ts | 56 ++--- yarn.lock | 8 +- 9 files changed, 188 insertions(+), 113 deletions(-) diff --git a/package.json b/package.json index 137e4cce..4ddde803 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "eslint-plugin-jane": "^8.0.4", "husky": "^4.2.5", "jest": "^26.4.2", - "lemmy-js-client": "^1.0.8", + "lemmy-js-client": "^1.0.9", "lint-staged": "^10.1.3", "mini-css-extract-plugin": "^0.11.0", "node-sass": "^4.12.0", diff --git a/src/shared/components/data-type-select.tsx b/src/shared/components/data-type-select.tsx index 06285f76..c3e1fc60 100644 --- a/src/shared/components/data-type-select.tsx +++ b/src/shared/components/data-type-select.tsx @@ -23,7 +23,6 @@ export class DataTypeSelect extends Component< constructor(props: any, context: any) { super(props, context); this.state = this.emptyState; - console.log(this.state); } static getDerivedStateFromProps(props: any): DataTypeSelectProps { diff --git a/src/shared/components/listing-type-select.tsx b/src/shared/components/listing-type-select.tsx index 3d12d434..f7d8cc3b 100644 --- a/src/shared/components/listing-type-select.tsx +++ b/src/shared/components/listing-type-select.tsx @@ -6,6 +6,7 @@ import { i18n } from '../i18next'; interface ListingTypeSelectProps { type_: ListingType; + showLocal?: boolean; onChange?(val: ListingType): any; } @@ -31,6 +32,7 @@ export class ListingTypeSelect extends Component< static getDerivedStateFromProps(props: any): ListingTypeSelectProps { return { type_: props.type_, + showLocal: props.showLocal, }; } @@ -53,6 +55,22 @@ export class ListingTypeSelect extends Component< /> {i18n.t('subscribed')} + {this.props.showLocal && ( + + )}