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

post-merge updates: web2 vs web3 page #7129

Closed
wants to merge 140 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
c82bfb0
Create Event tracking guideline
konopkja Jun 10, 2022
02b8898
Update Event tracking guideline
konopkja Jun 10, 2022
f66fad2
Update Event tracking guideline
konopkja Jun 10, 2022
6896560
Expand Plasma developer docs
emmanuel-awosika Jun 10, 2022
e3024e6
Move to event tracking docs to .md file
samajammin Jun 13, 2022
7778500
Fix typos/grammar
minimalsm Jun 14, 2022
8446748
Update index.md
emmanuel-awosika Jun 14, 2022
d2dd18e
Update event tracking docs
samajammin Jun 16, 2022
93ad3df
Update index.md
emmanuel-awosika Jun 21, 2022
d07548e
Feat(pages/404): Migrated 404.js => 404.tsx
M-Ivan Jun 26, 2022
564cb30
Fix(pages/404): Removed unnecessary round branckets string on 404 page
M-Ivan Jun 26, 2022
7e48a05
Feat(pages/404): Created interface for props and solved type errors
M-Ivan Jun 26, 2022
b7b59a1
Feat(pages/bug-bounty): Created interfaces for the page and improved …
M-Ivan Jun 26, 2022
f8dd080
Feat(pages/community): Community.js => Community.tsx
M-Ivan Jun 26, 2022
a0929e9
Feat(pages/community): Created interfaces for the community hub page
M-Ivan Jun 26, 2022
cb38d06
Apply suggestions from code review
emmanuel-awosika Jun 28, 2022
efd3d4a
Update index.md
emmanuel-awosika Jun 28, 2022
ef3dd90
Update index.md
emmanuel-awosika Jun 29, 2022
8edc7fb
Add links to snark and stark info
jmcook1186 Jun 30, 2022
b1d2636
add further reading links
jmcook1186 Jun 30, 2022
64c5af8
Update src/content/developers/docs/scaling/zk-rollups/index.md
emmanuel-awosika Jun 30, 2022
4c2381e
refactor: migrate PageHero/SkipLink to typescript
didoshotev Jul 4, 2022
3ae4e03
Merge branch 'dev' of https://github.com/didoshotev/ethereum-org-webs…
didoshotev Jul 4, 2022
8c8d376
Fix(git): Merged branch 'dev' into base and solved conflicts
M-Ivan Jul 9, 2022
f8de08a
Fix(bug-bounty): Fixed the declaration of page props and the sort met…
M-Ivan Jul 9, 2022
06bfd9c
Fix(404): Fixed props definition
M-Ivan Jul 9, 2022
2cd06cd
Fix(assets): Fixed the props definition to use PageProps
M-Ivan Jul 9, 2022
556ece2
Fix(assets): Fixed props definition and removed unnecessary GetImage …
M-Ivan Jul 9, 2022
ab44844
Fix(community): Fixed props definition, array type declaration and re…
M-Ivan Jul 9, 2022
9c23674
Fix(bug-bounty): Removed unnecessary export statements
M-Ivan Jul 9, 2022
71c5447
Fix(404): Added extra space
M-Ivan Jul 10, 2022
418819e
Fix type error
vdusart Jul 11, 2022
f2fb8ef
Convert TableOfContents file to TS
vdusart Jul 11, 2022
862ae05
Fix type errors linked to TableOfContents file
vdusart Jul 11, 2022
17137b7
Convert Tooltip file to TS
vdusart Jul 12, 2022
6afe97d
Convert TitleCardList file to TS
vdusart Jul 12, 2022
b58e9ae
Merge pull request #3 from vdusart/convert-file-c-&-s-files
vdusart Jul 13, 2022
214600e
Convert StatsBoxGrid file to TS
vdusart Jul 13, 2022
d6ca9d7
Merge branch 'dev' into convert-s-&-t-files
vdusart Jul 13, 2022
f790f8b
Merge branch 'dev' into review-ivan2
pettinarip Jul 14, 2022
a7c1f76
revert changes on md files
pettinarip Jul 14, 2022
9ac4c16
simplify typing in assetdownload component
pettinarip Jul 14, 2022
c13cf23
Add link to evm.codes
samajammin Jul 14, 2022
30cd7c6
Remove incomplete banner
samajammin Jul 14, 2022
aec7503
minor fixes on types
pettinarip Jul 15, 2022
e6a7b4e
Merge branch 'dev' into review-ivan2
pettinarip Jul 15, 2022
b36d333
Apply suggestions from code review
emmanuel-awosika Jul 15, 2022
76ca96d
Merge pull request #7074 from ethereum/contract-testing-complete
minimalsm Jul 15, 2022
6f1f72f
Merge pull request #7073 from ethereum/add-evm-codes
minimalsm Jul 15, 2022
9ddd7ad
Update docs/event-tracking.md
minimalsm Jul 15, 2022
22c8b11
Add usage example
minimalsm Jul 15, 2022
6c87d47
Copy tweaks
minimalsm Jul 15, 2022
04e29ea
Merge pull request #6630 from ethereum/konopkja-patch-1
minimalsm Jul 15, 2022
64a47f8
Update src/content/developers/docs/scaling/plasma/index.md
minimalsm Jul 15, 2022
ca2d422
Update src/content/developers/docs/scaling/plasma/index.md
minimalsm Jul 15, 2022
cfffc54
Merge pull request #6636 from emmanuel-awosika/patch-14
minimalsm Jul 15, 2022
98cc511
Italian: add "Tutorials I" bucket from Crowdin
minimalsm Jul 15, 2022
04bd221
Remove skill levels
minimalsm Jul 15, 2022
13c28df
Apply suggestions from code review
minimalsm Jul 15, 2022
773ad6e
Italian: add "Tutorials II" bucket from Crowdin
minimalsm Jul 15, 2022
a3d6e6f
Skill > beginner
minimalsm Jul 15, 2022
bd4fdcd
Italian: add "Tutorials III" bucket from Crowdin
minimalsm Jul 15, 2022
ecf33ad
call getImage on header image
pettinarip Jul 15, 2022
8f52438
Fix braking HTML strong tags
minimalsm Jul 15, 2022
9549c72
Merge branch 'italianTutorials02' of https://github.com/ethereum/ethe…
minimalsm Jul 15, 2022
e886b09
fix header tag
corwintines Jul 15, 2022
addfbd3
Merge branch 'dev' into pr/6752
corwintines Jul 15, 2022
68ee3eb
Update src/content/developers/docs/scaling/zk-rollups/index.md
corwintines Jul 15, 2022
375c053
Fix bug
minimalsm Jul 15, 2022
f1bc9fd
Apply suggestions from code review
emmanuel-awosika Jul 16, 2022
651a8ed
Update index.md
emmanuel-awosika Jul 16, 2022
0e53581
Updated broken link + included a guide
0xolishell Jul 16, 2022
38ac628
chore(#6392): types for Search
nikkhielseath Jul 10, 2022
8d11f75
chore(search): add function return types
nikkhielseath Jul 10, 2022
d1fedb8
refactor(PageHit): change function signature
nikkhielseath Jul 14, 2022
2c5c80d
refactor(Input): change prop definition
nikkhielseath Jul 14, 2022
2d87099
fix(ISearchProps): make all props optional
nikkhielseath Jul 14, 2022
9a18902
chore(npm): add @types/react-instantsearch-dom
nikkhielseath Jul 14, 2022
9c1db39
refactor(Results): separate out component
nikkhielseath Jul 14, 2022
596c351
Merge branch 'dev' into review-ivan2
pettinarip Jul 16, 2022
69be560
Merge pull request #6829 from M-Ivan/ts-migration/M-Ivan_assigned-pages
pettinarip Jul 16, 2022
2ffce15
Merge branch 'dev' of https://github.com/didoshotev/ethereum-org-webs…
didoshotev Jul 16, 2022
92a61cc
Merge branch 'dev' of https://github.com/ethereum/ethereum-org-websit…
didoshotev Jul 16, 2022
2dd8720
fix: required ts changes
didoshotev Jul 16, 2022
19f237e
Merge branch 'dev' into review-SNikhill
pettinarip Jul 16, 2022
69237c4
Merge pull request #6994 from SNikhill/refactor/#6392-ts-search
pettinarip Jul 16, 2022
16a81d2
refactor on error & loading message components
pettinarip Jul 16, 2022
fb3a456
adjust some types
pettinarip Jul 16, 2022
2aab5e5
Merge branch 'dev' into review-vdusart3
pettinarip Jul 16, 2022
af7bfa0
more adjustments on types
pettinarip Jul 16, 2022
9c377e3
fix types
pettinarip Jul 16, 2022
de0527e
Merge pull request #7034 from vdusart/convert-s-&-t-files
pettinarip Jul 16, 2022
72e115e
Merge pull request #6909 from didoshotev/ts-migration
pettinarip Jul 16, 2022
27acd51
Add upgrading smart contract page to docs nav
samajammin Jul 16, 2022
28da7c4
Update contract page URLs to match convention
samajammin Jul 16, 2022
36ae188
Add two more DeSci projects to the list
metalc Jul 16, 2022
852cd46
Fix GitHub, MetaMask, and JavaScript typos
minimalsm Jul 17, 2022
778c8ee
Merge pull request #7086 from ethereum/data-availability-header-bug
minimalsm Jul 17, 2022
d6d83f6
Fix typo in how-to-mock-solidity-contracts-for-testing/index.md
eltociear Jul 17, 2022
a37f0b2
Update tokenpocket wallet data
chendatony31 Jul 18, 2022
451f6a5
Update to community-events.json
Tuongg2312 Jul 18, 2022
bad15c7
Update src/data/wallets/wallet-data.ts
minimalsm Jul 18, 2022
1701429
Merge pull request #7100 from chendatony31/dev
minimalsm Jul 18, 2022
f224503
docs: update README.md [skip ci]
allcontributors[bot] Jul 18, 2022
fc781eb
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Jul 18, 2022
922632e
Merge pull request #7102 from ethereum/all-contributors/add-chendatony31
minimalsm Jul 18, 2022
20ec222
Update src/content/developers/docs/scaling/optimistic-rollups/index.md
minimalsm Jul 18, 2022
d633f04
Update src/content/developers/docs/scaling/optimistic-rollups/index.md
minimalsm Jul 18, 2022
283c60c
Merge pull request #7091 from shelleyolivia/shelleyolivia-patch-optim…
minimalsm Jul 18, 2022
6794668
Merge pull request #7080 from ethereum/italianTutorials01
minimalsm Jul 18, 2022
c2ec719
Update src/content/translations/it/developers/tutorials/sending-trans…
minimalsm Jul 18, 2022
c6ea8a7
Update src/content/translations/it/developers/tutorials/erc20-annotat…
minimalsm Jul 18, 2022
b37ed5d
Update src/content/translations/it/developers/tutorials/sending-trans…
minimalsm Jul 18, 2022
8eb7556
Merge pull request #7081 from ethereum/italianTutorials02
minimalsm Jul 18, 2022
98cd5e6
Update src/content/desci/index.md
minimalsm Jul 18, 2022
843f8cd
docs: update README.md [skip ci]
allcontributors[bot] Jul 18, 2022
a73c3d1
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Jul 18, 2022
d432237
Merge pull request #7096 from metalc/patch-2
minimalsm Jul 18, 2022
a224757
Merge pull request #7103 from ethereum/all-contributors/add-metalc
minimalsm Jul 18, 2022
ef9a2e0
Merge pull request #7098 from ethereum/fixGithubAndMetaMaskTypos
minimalsm Jul 18, 2022
14344da
docs: update README.md [skip ci]
allcontributors[bot] Jul 18, 2022
82fb6c2
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Jul 18, 2022
3900209
Merge pull request #7101 from Tuongg2312/patch-1
minimalsm Jul 18, 2022
a39c909
Merge pull request #7104 from ethereum/all-contributors/add-Tuongg2312
minimalsm Jul 18, 2022
6742937
Merge pull request #7099 from eltociear/patch-17
minimalsm Jul 18, 2022
493b1f7
Merge pull request #7095 from ethereum/upgrading-contracts-nav
minimalsm Jul 18, 2022
35bc652
Remove H1
minimalsm Jul 18, 2022
dd4a942
Merge pull request #7082 from ethereum/italianTutorials03
minimalsm Jul 18, 2022
0364883
Fix typo in Ethereum energy consumption page
ErikSaunier Jul 18, 2022
10b1475
Merge pull request #7106 from ethereum/removeH1
minimalsm Jul 18, 2022
efaa242
docs: update README.md [skip ci]
allcontributors[bot] Jul 18, 2022
d12ba44
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Jul 18, 2022
38f21dc
Merge pull request #7110 from ethereum/all-contributors/add-ErikSaunier
minimalsm Jul 18, 2022
050257e
Merge pull request #7108 from ErikSaunier/patch-1
minimalsm Jul 18, 2022
9c485fb
consistent :
corwintines Jul 18, 2022
7397f9c
remove projects added, will add these into layer-2.json as they come in
corwintines Jul 18, 2022
3feae34
casing
corwintines Jul 18, 2022
1061ca3
Merge branch 'dev' into pr/6752
corwintines Jul 18, 2022
b896260
Merge pull request #6752 from emmanuel-awosika/patch-16
corwintines Jul 18, 2022
0670c21
update web2 vs web3 page
jmcook1186 Jul 19, 2022
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
36 changes: 36 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -8142,6 +8142,42 @@
"contributions": [
"doc"
]
},
{
"login": "chendatony31",
"name": "Tony Chen",
"avatar_url": "https://avatars.githubusercontent.com/u/2173383?v=4",
"profile": "https://tokenpocket.pro",
"contributions": [
"doc"
]
},
{
"login": "metalc",
"name": "metalc",
"avatar_url": "https://avatars.githubusercontent.com/u/102876192?v=4",
"profile": "https://github.com/metalc",
"contributions": [
"doc"
]
},
{
"login": "Tuongg2312",
"name": "Tuongg2312",
"avatar_url": "https://avatars.githubusercontent.com/u/107551539?v=4",
"profile": "https://github.com/Tuongg2312",
"contributions": [
"doc"
]
},
{
"login": "ErikSaunier",
"name": "Ξrik Saunier",
"avatar_url": "https://avatars.githubusercontent.com/u/1122363?v=4",
"profile": "https://github.com/ErikSaunier",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,12 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/NachoRoizman"><img src="https://avatars.githubusercontent.com/u/107893772?v=4?s=100" width="100px;" alt=""/><br /><sub><b>NachoRoizman</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=NachoRoizman" title="Documentation">📖</a></td>
<td align="center"><a href="https://linkedin.com/in/miragaya-ivan"><img src="https://avatars.githubusercontent.com/u/72365253?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Iván Miragaya</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=M-Ivan" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/smejak"><img src="https://avatars.githubusercontent.com/u/20759274?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jakub Smékal</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=smejak" title="Documentation">📖</a></td>
<td align="center"><a href="https://tokenpocket.pro"><img src="https://avatars.githubusercontent.com/u/2173383?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tony Chen</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=chendatony31" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/metalc"><img src="https://avatars.githubusercontent.com/u/102876192?v=4?s=100" width="100px;" alt=""/><br /><sub><b>metalc</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=metalc" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Tuongg2312"><img src="https://avatars.githubusercontent.com/u/107551539?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tuongg2312</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=Tuongg2312" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/ErikSaunier"><img src="https://avatars.githubusercontent.com/u/1122363?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ξrik Saunier</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=ErikSaunier" title="Documentation">📖</a></td>
</tr>
</table>

Expand Down
97 changes: 97 additions & 0 deletions docs/event-tracking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Event tracking on ethereum.org

This is a guide on how to prepare event tracking when creating a new page or redesigning an existing page.

## What are events?

Events are user interactions on the application that standard pageviews cannot track within a session. We create custom code snippets in the application in order to trigger these events.

Events are useful for measuring user engagement on the website. Tracking events lets us know when users interact with elements and forms and can help us understand how successful users are at accomplishing their goals.

Event tracking is a great way to validate our design decisions and assumptions. We can create reports in Matomo to gather insights and improve our product.

[View the Matomo guide on event tracking](https://matomo.org/guide/reports/event-tracking/).

## How is event tracking implemented?

ethereum.org uses Matomo, an open-source alternative to Google Analytics, allowing us to protect user privacy by not sharing any analytics with third parties.

We implemented Matomo using the [JavaScript tracking client](https://developer.matomo.org/guides/tracking-javascript-guide) via the [`gatsby-matomo-plugin`](https://github.com/kremalicious/gatsby-plugin-matomo) Gatsby plugin.

## What to measure?

Ideally, ask yourself what design decision/assumptions have been made on the page and should/could be validated by measured performance:

- clicks
- downloads
- site searches
- popups viewed/dismissed
- form fields abandoned
- scroll behavior down a page

This data can be later used to decide whether a feature is being used or is underperforming.

It's helpful to ask yourself how the results of what we track and measure might influence our decision-making. For example, measuring something that won't help us make concrete product decisions is probably not worth tracking.

# How to name events?

Broadly, events should be grouped by specific topic (e.g. L2 page external links, selected bridge, selected cex).

## Each event comprises of 4 hierarchical values:

1. Category (other events may share the same category if one feature has several actions)
2. Action
3. Name (optional)
4. Value (optional, can be number or text)

## Category

Please consider the page's visual position when deciding which events should be grouped together (under the same category). Ideally, all events related to one feature should be grouped together under the same category only if there is also a single position on the page where the event can be triggered. If in doubt, always use a different category when a feature gets used in multiple places on the page.

Example:
Find wallets page redirects to external links (wallets) in two positions: A) through the main list of wallets B) Through a modal window with detailed info about a specific wallet. In this case, we would like to have two separate categories for external links instead of one:

- Matomo list view
- Category: WalletExternalLinkList
- Action: Go to wallet
- eventName: WalletName
- Value: position
- Matomo modal view
- Category: WalletExternalLinkModal
- Action: Go to wallet
- eventName: WalletName
- Value: position

Such division allows us to identify where a user clicked on the page precisely; if all external links were under one category, "ExternalLink", we would not be able to measure the performance difference between the list and the modal window.

## Usage

Ethereum.org has a utility function (`trackCustomEvent`) for easily creating Matomo events.

```javascript
import { trackCustomEvent } from "../utils/matomo"
```

The function requires an object of event options. See the example below.

```javascript
const handleEvent = (): void => {
trackCustomEvent({
eventCategory: `FeedbackWidget toggled`,
eventAction: `Clicked`,
eventName: `Opened feedback widget`,
eventValue: `1`,
})
}
```

## Hidden gem of tracking: Value

Can be used to get more info on the UX.

Examples:

- Use it to track the average position of clicked search result
- What terms are entered into the search field
- Which option is chosen from a dropdown menu
- How many or what filters are applied when filtering the list of wallets
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@types/node": "^17.0.23",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@types/react-instantsearch-dom": "^6.12.3",
"@types/styled-components": "^5.1.25",
"@types/styled-system": "^5.1.15",
"babel-preset-gatsby": "^2.14.0",
Expand Down
8 changes: 8 additions & 0 deletions redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,5 +362,13 @@
{
"fromPath": "/*/contributing/translation-program/content-versions/",
"toPath": "/:splat/contributing/translation-program/content-buckets/"
},
{
"fromPath": "/*/developers/docs/smart-contracts/source-code-verification/",
"toPath": "/:splat/developers/docs/smart-contracts/verifying/"
},
{
"fromPath": "/*/developers/docs/smart-contracts/upgrading-smart-contracts/",
"toPath": "/:splat/developers/docs/smart-contracts/upgrading/"
}
]
Binary file modified src/assets/wallets/tokenpocket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/AssetDownload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface IPropsWithSVG extends IPropsBase {
}
interface IPropsWithImage extends IPropsBase {
svg?: never
image: string
image: any
}

export type IProps = IPropsWithImage | IPropsWithSVG
Expand Down
2 changes: 1 addition & 1 deletion src/components/ButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const SecondaryScrollLink = styled(StyledScrollButton)`
}
`

interface IProps extends ILinkProps, MarginProps {
export interface IProps extends ILinkProps, MarginProps {
toId?: string
isSecondary?: boolean
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const githubUrl = `https://github.com/`

export interface Person {
name: string
username: string
username?: string
score: number
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ const Nav: React.FC<IProps> = ({ handleThemeChange, isDarkTheme, path }) => {
<Menu path={path} sections={linkSections} />
</LeftItems>
<RightItems>
<Search useKeyboardShortcuts />
<Search useKeyboardShortcut />
<ThemeToggle
onClick={handleThemeChange}
aria-label={
Expand Down
39 changes: 34 additions & 5 deletions src/components/PageHero.js → src/components/PageHero.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from "react"
import styled from "styled-components"
import { GatsbyImage } from "gatsby-plugin-image"
import ButtonLink from "./ButtonLink"
import ButtonLink, { IProps as IButtonLinkProps } from "./ButtonLink"
import { Content } from "./SharedStyledComponents"

const HeroContainer = styled.div`
export interface IIsReverse {
isReverse: boolean
}

const HeroContainer = styled.div<IIsReverse>`
display: flex;
justify-content: space-between;
margin-top: 2rem;
Expand Down Expand Up @@ -89,7 +93,32 @@ const StyledButtonLink = styled(ButtonLink)`
}
`

const PageHero = ({ content, children, className, isReverse }) => {
export interface IButton extends Partial<IButtonLinkProps> {
content: string
}

export interface IContent {
buttons?: Array<IButton>
title: string
header: string
subtitle: string
image: string
alt: string
}

export interface IProps {
content: IContent
isReverse?: boolean
children?: React.ReactNode
className?: string
}

const PageHero: React.FC<IProps> = ({
content,
isReverse = false,
children,
className,
}) => {
const { buttons, title, header, subtitle, image, alt } = content
return (
<Content>
Expand All @@ -104,8 +133,8 @@ const PageHero = ({ content, children, className, isReverse }) => {
<StyledButtonLink
isSecondary={button.isSecondary}
key={idx}
to={button.path}
toId={button.pathId}
to={button.to}
toId={button.toId}
>
{button.content}
</StyledButtonLink>
Expand Down
22 changes: 18 additions & 4 deletions src/components/Search/Input.js → src/components/Search/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import React, { ChangeEvent, FormEvent } from "react"
import { useIntl } from "react-intl"
import styled from "styled-components"
import { connectSearchBox } from "react-instantsearch-dom"
Expand Down Expand Up @@ -57,17 +57,31 @@ const SearchSlash = styled.p`
}
`

const Input = ({ query, setQuery, refine, inputRef, ...rest }) => {
interface IInputProps
extends React.ComponentPropsWithoutRef<typeof StyledInput> {
query: string
setQuery: (query: string) => void
refine: (query: string) => void
inputRef: React.MutableRefObject<HTMLInputElement>
}

const Input: React.FC<IInputProps> = ({
query,
setQuery,
refine,
inputRef,
...rest
}) => {
const intl = useIntl()
const searchString = translateMessageId("search", intl)

const handleInputChange = (event) => {
const handleInputChange = (event: ChangeEvent<HTMLInputElement>): void => {
const value = event.target.value
refine(value)
setQuery(value)
}

const handleSubmit = (event) => {
const handleSubmit = (event: FormEvent<HTMLFormElement>): void => {
event.preventDefault()
}

Expand Down
Loading