-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathToggle.fusion
27 lines (26 loc) · 1.36 KB
/
Toggle.fusion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
prototype(Carbon.Plausible:Component.Toggle) < prototype(Neos.Fusion:Component) {
domain = ${Carbon.Plausible.getDomain(request.httpRequest)}
statusClass = ${null}
buttonClass = ${null}
renderer = afx`
<p style='display:none' class={Carbon.String.merge(props.statusClass, '-plausible-status')}>
<span class='-plausible-disabled'>
{Translation.translate('trackingIsDisabled', 'Tracking for {0} from this browser is disabled.', [props.domain], 'Main', 'Carbon.Plausible')}
</span>
<span class='-plausible-enabled'>
{Translation.translate('trackingIsEnabled', 'Tracking for {0} from this browser is enabled.', [props.domain], 'Main', 'Carbon.Plausible')}
</span>
</p>
<button style='display:none' class={Carbon.String.merge(props.buttonClass, '-plausible-button')} type='button'>
<span class='-plausible-disabled'>
{Translation.translate('enableTracking', 'Enable tracking', [], 'Main', 'Carbon.Plausible')}
</span>
<span class='-plausible-enabled'>
{Translation.translate('disableTracking', 'Disable tracking', [], 'Main', 'Carbon.Plausible')}
</span>
</button>
<script>
{StaticResource.content('Carbon.Plausible', 'Public/Toggle.js')}
</script>
`
}