From 1a5736a498ba5661e93b005b05cea745703ae6db Mon Sep 17 00:00:00 2001 From: Piotr Janosz Date: Wed, 24 Jul 2019 17:03:25 +0200 Subject: [PATCH] [WIP] Filtering for tools upgrades --- .../website/ts/components/docs/feature_link.tsx | 7 +++---- .../ts/components/docs/sidebar/filters.tsx | 6 +++++- .../ts/components/docs/sidebar/filters_group.tsx | 1 + packages/website/ts/pages/docs/tools.tsx | 15 --------------- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/packages/website/ts/components/docs/feature_link.tsx b/packages/website/ts/components/docs/feature_link.tsx index ddfc72d928..0d475c4c9b 100644 --- a/packages/website/ts/components/docs/feature_link.tsx +++ b/packages/website/ts/components/docs/feature_link.tsx @@ -11,19 +11,18 @@ import { Heading, Paragraph } from 'ts/components/text'; import { colors } from 'ts/style/colors'; interface IFeatureLinkProps { - heading: string; - icon: string; + title: string; description?: string; url: string; } export const FeatureLink: React.FC = props => ( - +
- {props.heading} + {props.title} {props.description} diff --git a/packages/website/ts/components/docs/sidebar/filters.tsx b/packages/website/ts/components/docs/sidebar/filters.tsx index 726e24b572..480fca92f8 100644 --- a/packages/website/ts/components/docs/sidebar/filters.tsx +++ b/packages/website/ts/components/docs/sidebar/filters.tsx @@ -1,5 +1,7 @@ import React from 'react'; +import _ from 'lodash'; + import { FiltersGroup } from 'ts/components/docs/sidebar/filters_group'; import { styled } from 'ts/style/theme'; @@ -13,10 +15,12 @@ interface IFiltersGroupProps { customLabel?: string; } +const transformItems = (items: IFiltersGroupProps[]) => _.orderBy(items, 'label', 'asc'); + export const Filters: React.FC = ({ filters }) => ( {filters.map((filter: IFiltersGroupProps, index: number) => ( - + ))} ); diff --git a/packages/website/ts/components/docs/sidebar/filters_group.tsx b/packages/website/ts/components/docs/sidebar/filters_group.tsx index 6b2a77dc2f..eac412a205 100644 --- a/packages/website/ts/components/docs/sidebar/filters_group.tsx +++ b/packages/website/ts/components/docs/sidebar/filters_group.tsx @@ -11,6 +11,7 @@ interface IFilterListProps { customLabel?: string; items: IFilterProps[]; refine: (value: string) => void; + transformItems: (items: IFilterProps[]) => void; } const FiltersList: React.FC = ({ items, customLabel, heading, refine }) => { diff --git a/packages/website/ts/pages/docs/tools.tsx b/packages/website/ts/pages/docs/tools.tsx index 9bccee23e5..ea71fdbc3f 100644 --- a/packages/website/ts/pages/docs/tools.tsx +++ b/packages/website/ts/pages/docs/tools.tsx @@ -80,18 +80,3 @@ const filters = [ { attribute: 'difficulty', heading: 'Level' }, { attribute: 'isCommunity', heading: 'Community Maintained', customLabel: 'Include Community Maintained' }, ]; - -const featuredLinks = [ - { - heading: '0x Code Sandbox', - description: 'A description could possibly go here but could be tight.', - icon: 'flexibleIntegration', - url: 'https://0x.org', - }, - { - heading: '0x Code Sandbox', - description: 'A description could possibly go here but could be tight.', - icon: 'flexibleIntegration', - url: 'https://0x.org', - }, -];