Skip to content

Commit

Permalink
restores split feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgnlez committed Jan 12, 2024
1 parent 11bab04 commit 6d45de4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with
- `NEXT_PUBLIC_FEATURE_FLAGS` (comma-separated list of feature flag strings,
optional, default is an empty list): list features here in order to _enable_
them in the frontend app; features available behind feature flags are:
- `split`: make _split_ functionality available for conservation features in
the frontend app
- `strat`: make _stratification_ functionality available for conservation
features in the frontend app

Expand Down
8 changes: 4 additions & 4 deletions app/components/features/selected-item/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const Item: React.FC<ItemProps> = ({
}: ItemProps) => {
const [splitOpen, setSplitOpen] = useState(!!splitSelected);

const { strat } = useFeatureFlags();
const { split, strat } = useFeatureFlags();

// EVENTS
const onSplitChanged = useCallback(
Expand Down Expand Up @@ -137,7 +137,7 @@ export const Item: React.FC<ItemProps> = ({
<h2 className="font-heading text-sm">{name}</h2>

<div className="mr-3 flex space-x-2">
{editable && !!OPTIONS.length && (
{editable && split && !!OPTIONS.length && (
<Tooltip
arrow
placement="top"
Expand Down Expand Up @@ -204,7 +204,7 @@ export const Item: React.FC<ItemProps> = ({
</div>
</div>

{splitOpen && (
{split && splitOpen && (
<div>
<div className="mt-3 flex items-center space-x-2 font-heading tracking-wide">
<h4 className="text-xxs uppercase text-white">
Expand Down Expand Up @@ -299,7 +299,7 @@ export const Item: React.FC<ItemProps> = ({
)}
</header>

{splitSelected && splitOpen && (
{splitSelected && split && splitOpen && (
<ul className="pl-3">
{splitFeaturesOptions.map((f) => {
const checked =
Expand Down

0 comments on commit 6d45de4

Please sign in to comment.