Skip to content

Commit

Permalink
Merge pull request #484 from natura-cosmeticos/DSY-4060
Browse files Browse the repository at this point in the history
feat(natds-search-tokens): add analytics G4 end change tabs label
  • Loading branch information
vagnerbarbosant authored Feb 19, 2024
2 parents 28e48a1 + 24c4269 commit 318cffd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
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

0 comments on commit 318cffd

Please sign in to comment.