-
Notifications
You must be signed in to change notification settings - Fork 961
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
feat(web): Update information copy and CTAs #7568
Merged
tonypls
merged 11 commits into
master
from
tonyvanswet/tig-26-update-in-app-descriptions
Dec 20, 2024
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ff8857b
feat(web): Update information copy and CTAs
tonypls 5764f77
update subheader and search placeholder
tonypls 5d8f4f4
feedback v1
tonypls d82d82b
feedback updates
tonypls 181739f
Merge branch 'master' into tonyvanswet/tig-26-update-in-app-descriptions
tonypls 3f6a4fd
Update web/src/components/buttons/ApiButton.tsx
tonypls 28583e7
Update web/src/components/buttons/ApiButton.tsx
madsnedergaard 8f9b71d
Merge branch 'master' into tonyvanswet/tig-26-update-in-app-descriptions
tonypls 11126fc
PR feedback
tonypls 886e787
remove unused imports
tonypls 20fbd71
inline cta
tonypls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Button, ButtonProps } from 'components/Button'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
interface ApiButtonProps | ||
extends Omit< | ||
ButtonProps, | ||
'icon' | 'children' | 'href' | 'onClick' | 'backgroundClasses' | 'foregroundClasses' | ||
> { | ||
iconSize?: number; | ||
} | ||
|
||
export function ApiButton({ ...restProps }: ApiButtonProps) { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Button | ||
href={ | ||
'https://electricitymaps.com/pricing?utm_source=app.electricitymaps.com&utm_medium=referral&utm_campaign=api-cta' | ||
} | ||
{...restProps} | ||
> | ||
{t('button.api')} | ||
</Button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Button, ButtonProps } from 'components/Button'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
interface DocsButtonProps | ||
extends Omit< | ||
ButtonProps, | ||
'icon' | 'children' | 'href' | 'onClick' | 'backgroundClasses' | 'foregroundClasses' | ||
> { | ||
iconSize?: number; | ||
} | ||
|
||
export function DocumentationButton({ ...restProps }: DocsButtonProps) { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Button href={'https://docs.electricitymaps.com/'} {...restProps}> | ||
{t('button.docs')} | ||
</Button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import { Link } from 'components/Link'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
export default function InfoText() { | ||
const { t } = useTranslation(); | ||
return ( | ||
<div className="prose dark:prose-invert prose-p:my-1 prose-p:leading-snug prose-a:no-underline hover:prose-a:underline"> | ||
<p className="mb-4">{t('info.text')}</p> | ||
<p | ||
dangerouslySetInnerHTML={{ | ||
__html: t('info.open-source-text', { | ||
link: 'https://github.com/electricitymaps/electricitymaps-contrib', | ||
}), | ||
}} | ||
/> | ||
<p className="mb-4"> | ||
<Link href="https://electricitymaps.com/?utm_source=app.electricitymaps.com&utm_medium=referral&utm_campaign=about-section"> | ||
Electricity Maps | ||
</Link>{' '} | ||
{t('info.text')} | ||
</p> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { Capacitor } from '@capacitor/core'; | ||
import useGetZone from 'api/getZone'; | ||
import { CommercialApiButton } from 'components/buttons/CommercialApiButton'; | ||
import { HorizontalDivider } from 'components/Divider'; | ||
import LoadingSpinner from 'components/LoadingSpinner'; | ||
import BarBreakdownChart from 'features/charts/bar-breakdown/BarBreakdownChart'; | ||
import { useAtomValue, useSetAtom } from 'jotai'; | ||
|
@@ -85,7 +86,7 @@ export default function ZoneDetails(): JSX.Element { | |
<div | ||
id="panel-scroller" | ||
className={twMerge( | ||
'mb-3 h-full scroll-pt-5 overflow-y-scroll px-3 pt-2.5 sm:h-full sm:pb-60', | ||
'mb-3 h-full scroll-pt-5 overflow-y-scroll px-3 pt-2.5 sm:h-full sm:pb-64', | ||
isIosCapacitor ? 'pb-72' : 'pb-48' | ||
)} | ||
> | ||
|
@@ -118,13 +119,12 @@ export default function ZoneDetails(): JSX.Element { | |
displayByEmissions={displayByEmissions} | ||
/> | ||
)} | ||
|
||
<MethodologyCard /> | ||
<HorizontalDivider /> | ||
<div className="mb-1 text-sm font-semibold">Looking for forecast data?</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, this was quite a speculative change, we can remove it or try on the same line |
||
<CommercialApiButton /> | ||
<Attribution zoneId={zoneId} /> | ||
{isMobile ? ( | ||
<CommercialApiButton backgroundClasses="mt-3" /> | ||
) : ( | ||
<div className="p-2" /> | ||
)} | ||
</ZoneDetailsContent> | ||
</div> | ||
</> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this little change increased the bundle size by 7.3 kb and that the subtitle is constantly re-rendering on a datetime change.
I am fixing it in: #7647
Oh and this also broke the Title size flow on the ranking panel as there is no h2 anymore but there is a h1 and h3. This is bad for SEO and accessibility.