From 8fa0a4637b8fa10e2087f72191637d008ff7ed04 Mon Sep 17 00:00:00 2001 From: Clinton Date: Mon, 7 Jun 2021 16:14:50 -0500 Subject: [PATCH] feat: make form controls more responsive. refactor form controls for more control over style --- src/components/Select.js | 94 +++++++++++++++ src/pages/observability-packs.js | 197 ++++++++++++++----------------- 2 files changed, 182 insertions(+), 109 deletions(-) create mode 100644 src/components/Select.js diff --git a/src/components/Select.js b/src/components/Select.js new file mode 100644 index 000000000..c14983a01 --- /dev/null +++ b/src/components/Select.js @@ -0,0 +1,94 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { css } from '@emotion/react'; + +const Select = ({ disabled, ...props }) => ( +
+ { + setSortState(e.target.value); + }} > - {sortState} - - - { - setSortState('Alphabetical'); - }} - > - Alphabetical - - { - setSortState('Reverse'); - }} - > - Reverse - - { - setSortState('Popularity'); - }} - > - Popularity - - - + {sortOptionValues.map((sortOption) => ( + + ))} + +
- - Filter packs containing - - - + + +
@@ -304,4 +252,35 @@ export const pageQuery = graphql` } `; +const Label = ({ children, htmlFor }) => ( + +); + +Label.propTypes = { + children: PropTypes.node, + htmlFor: PropTypes.string, +}; + +const FormControl = ({ children }) => ( +
+ {children} +
+); + export default ObservabilityPacksPage;