Adding Simple URL-based feature flags (#117)

* Fixes #66: As a developer, I want to limit the audience
that sees new features, so that we can control
the message and positioning of our tool.
Implements simple feature flagging via URL parameters.
Provide "?flags=x,y,z" to enable flags x, y, and z.
* Fixing type to use Location instead of URL
* Updating README with info on how to use feature flags
This commit is contained in:
Nat Hillard 2021-06-09 15:32:59 -04:00 committed by GitHub
commit 7ab14c7f3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 202 additions and 31 deletions

View file

@ -20,9 +20,12 @@ import pollutionIcon // @ts-ignore
import washIcon from '/node_modules/uswds/dist/img/usa-icons/wash.svg';
import J40Aside from '../components/J40Aside';
interface IndexPageProps {
location: Location;
};
// markup
const IndexPage = () => {
const IndexPage = ({location}: IndexPageProps) => {
const readMoreList: (any | string)[][] = [
[ecoIcon, 'Clean energy and energy efficiency'],
[busIcon, 'Clean transit'],
@ -33,7 +36,7 @@ const IndexPage = () => {
];
return (
<Layout>
<Layout location={location}>
<main id="main-content" role="main">
<div className={'grid-row grid-gap-2'}>
<section className={'grid-container usa-section'}>