Skip to content

Commit

Permalink
reorder ui options (transcend-io#169)
Browse files Browse the repository at this point in the history
* reorder ui options
  • Loading branch information
csmccarthy authored Jun 25, 2024
1 parent cdf3fb8 commit 777d10c
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/transcend-io/consent-manager-ui.git"
},
"homepage": "https://github.com/transcend-io/consent-manager-ui",
"version": "4.15.0",
"version": "4.15.1",
"license": "MIT",
"main": "build/ui",
"files": [
Expand Down
8 changes: 4 additions & 4 deletions src/components/AcceptAllOrMoreChoices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ export function AcceptAllOrMoreChoices({
role="group"
aria-label={formatMessage(messages.buttonGroupAriaDescription)}
>
<Button
primaryText={formatMessage(messages.acceptAllButtonPrimary)}
handleClick={handleAcceptAll}
/>
<Button
primaryText={formatMessage(messages.moreChoicesButtonPrimary)}
handleClick={handleMoreChoices}
initialFocus
/>
<Button
primaryText={formatMessage(messages.acceptAllButtonPrimary)}
handleClick={handleAcceptAll}
/>
</div>
</div>
);
Expand Down
10 changes: 5 additions & 5 deletions src/components/AcceptOrRejectAdvertising.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ export function AcceptOrRejectAdvertising({
aria-label={formatMessage(messages.buttonGroupAriaDescription)}
>
<Button
primaryText={formatMessage(messages.rejectAdvertising)}
primaryText={formatMessage(messages.acceptAdvertising)}
handleClick={(event) => {
event.preventDefault();
airgap.setConsent(event, { Advertising: false }, CONSENT_OPTIONS);
airgap.setConsent(event, { Advertising: true }, CONSENT_OPTIONS);
handleSetViewState('close');
}}
initialFocus
/>
<Button
primaryText={formatMessage(messages.acceptAdvertising)}
primaryText={formatMessage(messages.rejectAdvertising)}
handleClick={(event) => {
event.preventDefault();
airgap.setConsent(event, { Advertising: true }, CONSENT_OPTIONS);
airgap.setConsent(event, { Advertising: false }, CONSENT_OPTIONS);
handleSetViewState('close');
}}
initialFocus
/>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/AcceptOrRejectAll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ export function AcceptOrRejectAll({
role="group"
aria-label={formatMessage(messages.buttonGroupAriaDescription)}
>
<Button
primaryText={formatMessage(messages.acceptAllButtonPrimary)}
handleClick={handleAcceptAll}
/>
<Button
primaryText={formatMessage(messages.rejectAllButtonPrimary)}
handleClick={handleRejectAll}
initialFocus
/>
<Button
primaryText={formatMessage(messages.acceptAllButtonPrimary)}
handleClick={handleAcceptAll}
/>
</div>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions src/components/AcceptOrRejectAllOrMoreChoices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ export function AcceptOrRejectAllOrMoreChoices({
role="group"
aria-label={formatMessage(messages.buttonGroupAriaDescription)}
>
<Button
primaryText={formatMessage(messages.acceptAllButtonPrimary)}
handleClick={handleAcceptAll}
/>
<Button
primaryText={formatMessage(messages.rejectAllButtonPrimary)}
handleClick={handleRejectAll}
initialFocus
/>
<Button
primaryText={formatMessage(messages.acceptAllButtonPrimary)}
handleClick={handleAcceptAll}
/>
<Button
primaryText={formatMessage(messages.moreChoicesButtonPrimary)}
handleClick={handleMoreChoices}
Expand Down
10 changes: 5 additions & 5 deletions src/components/AcceptOrRejectAnalytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ export function AcceptOrRejectAnalytics({
aria-label={formatMessage(messages.buttonGroupAriaDescription)}
>
<Button
primaryText={formatMessage(messages.rejectAnalytics)}
primaryText={formatMessage(messages.acceptAnalytics)}
handleClick={(event) => {
event.preventDefault();
airgap.setConsent(event, { Analytics: false }, CONSENT_OPTIONS);
airgap.setConsent(event, { Analytics: true }, CONSENT_OPTIONS);
handleSetViewState('close');
}}
initialFocus
/>
<Button
primaryText={formatMessage(messages.acceptAnalytics)}
primaryText={formatMessage(messages.rejectAnalytics)}
handleClick={(event) => {
event.preventDefault();
airgap.setConsent(event, { Analytics: true }, CONSENT_OPTIONS);
airgap.setConsent(event, { Analytics: false }, CONSENT_OPTIONS);
handleSetViewState('close');
}}
initialFocus
/>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/CompleteOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export function CompleteOptions({
handleClick={handleSave}
primaryText={formatMessage(completeOptionsMessages.saveButtonPrimary)}
type="submit"
{...(orderedSelections.length === 0 ? { initialFocus: true } : {})}
/>
</form>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/CompleteOptionsInverted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export function CompleteOptionsInverted({
<Button
handleClick={handleSave}
primaryText={formatMessage(completeOptionsMessages.saveButtonPrimary)}
{...(orderedSelections.length === 0 ? { initialFocus: true } : {})}
/>
</form>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/CompleteOptionsToggles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function CompleteOptionsToggles({
}}
className="complete-options-toggle-close"
fontColor={fontColor}
{...(orderedSelections.length === 0 ? { initialFocus: true } : {})}
/>
<div>
<div>
Expand Down

0 comments on commit 777d10c

Please sign in to comment.