Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front(fix): Percentage formatter #502

Merged
merged 2 commits into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions app/components/features/show-target-spf-item/component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import cx from 'classnames';
import { format } from 'd3';

import Label from 'components/forms/label';
import InfoButton from 'components/info-button';
Expand All @@ -11,7 +12,7 @@ export const TargetSPFItem: React.FC<ShowTargetSPFItemProps> = ({
className,
type,
name,
target,
target = 0,
fpf,
id,
firstFeature,
Expand Down Expand Up @@ -44,29 +45,29 @@ export const TargetSPFItem: React.FC<ShowTargetSPFItemProps> = ({
TARGET
</Label>
{firstFeature && (
<InfoButton>
<div>
<h4 className="font-heading text-lg mb-2.5">What is a target?</h4>
<div className="space-y-2">
<p>
This value represents how much you want to conserve of a particular
feature. In an ideal conservation, land or sea use plan,
all your features meet their targets.
</p>
<p>
You can set a default
value for all of your features
or you can set individual the targets separately for each feature.
You can set your targets to 100% if you want the whole extent of
your feature to be included in the solution.
</p>
<InfoButton>
<div>
<h4 className="font-heading text-lg mb-2.5">What is a target?</h4>
<div className="space-y-2">
<p>
This value represents how much you want to conserve of a particular
feature. In an ideal conservation, land or sea use plan,
all your features meet their targets.
</p>
<p>
You can set a default
value for all of your features
or you can set individual the targets separately for each feature.
You can set your targets to 100% if you want the whole extent of
your feature to be included in the solution.
</p>
</div>
</div>
</div>
</InfoButton>
</InfoButton>
)}
</div>

<p>{`${target}%`}</p>
<p>{format('.2~%')(target / 100)}</p>
</div>
<div className="flex flex-col justify-between w-24 px-4 border-l">
<div className="flex items-baseline space-x-3">
Expand Down
1 change: 1 addition & 0 deletions app/hoc/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { QueryClient } from 'react-query';

import { getSession } from 'next-auth/client';
import { dehydrate } from 'react-query/hydration';

import USERS from 'services/users';

import { mergeDehydratedState } from './utils';
Expand Down