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

feat(natds-search-tokens): add analytics G4 end change tabs label #484

Merged
merged 1 commit into from
Feb 19, 2024
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
20 changes: 11 additions & 9 deletions packages/natds-token-search/index.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<html>

<head>
<title>Natds token search</title>
<title>GaYa - Search Design Tokens </title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
</head>

<body>
<div id="app-root"></div>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-178265276-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-J050LS3PSE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-179267459-1');
</script>
<script src="src/index.js" defer></script>
gtag('config', 'G-J050LS3PSE');
</script>
<script src="src/index.js" defer></script>
</body>

</html>
29 changes: 28 additions & 1 deletion packages/natds-token-search/src/Radio.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
import { createElement } from './helpers'

const brandsLabel = {
avon: 'Avon',
avon_v2: 'Avon v2',
biome: 'Biome',
natura: 'Natura',
theBodyShop: 'The Body Shop',
consultoriaDeBeleza: 'Consultoria de Beleza',
natura_v2: 'Natura v2',
casaEestilo: 'Casa & estilo'
}
const platformsLabel = {
android: 'Android',
ios: 'IOS',
reactNative: 'React Native',
web: 'Web'
}
const LabelParse = (name, value) => {
switch (name) {
case 'brand':
return brandsLabel[value]
case 'platform':
return platformsLabel[value]
default:
return value
}
}

export const Radio = (name, value, checked) => {
const label = createElement('label', { for: value }, value)
const label = createElement('label', { for: value }, LabelParse(name, value))

const input = createElement('input', {
id: value,
Expand Down
Loading