Skip to content
Open
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
5 changes: 3 additions & 2 deletions src/components/button/button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ export default class Button extends Component {
children,
onClick,
invert,
ariaLabel
ariaLabelledBy
} = props;

return (
<button
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy}
id={id}
class={[style.button, props.class, invert ? style.invert : ''].join(' ')}
onClick={onClick}>
{children}
Expand Down
3 changes: 2 additions & 1 deletion src/components/label/label.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ export default class Label extends Component {
};

render(props, state) {
const { prefix, localizeKey, className, children } = props;
const { prefix, localizeKey, className, children, id } = props;
const key = prefix ? `${prefix}.${localizeKey}` : localizeKey;
const localizedContent = lookup(key);
const style = localizedContent ? "" : "display:none";

return (
<span
id={id}
style={style}
class={props.class || className}
dangerouslySetInnerHTML={localizedContent && {__html: localizedContent}}>
Expand Down
12 changes: 8 additions & 4 deletions src/components/popup/details/details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,14 @@ export default class Details extends Component {
</Panel>
</div>
<div class={style.footer}>
<a aria-label='back' class={style.cancel} onClick={this.handleBack}><LocalLabel prefix={'tabs.tab' + (selectedTab + 1)}
localizeKey='back'>Back</LocalLabel></a>
<Button ariaLabel='save settings and close' class={style.save} onClick={onSaveOrClose}><LocalLabel
prefix={'tabs.tab' + (selectedTab + 1)} localizeKey='save'>Save and Exit</LocalLabel></Button>
<a
class={style.cancel}
onClick={this.handleBack}>
<LocalLabel prefix={'tabs.tab' + (selectedTab + 1)} localizeKey='back'>Back</LocalLabel>
</a>
<Button ariaLabelledBy='save' class={style.save} onClick={onSaveOrClose}>
<LocalLabel prefix={'tabs.tab' + (selectedTab + 1)} id='save' localizeKey='save'>Save and Exit</LocalLabel>
</Button>
</div>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions src/components/popup/intro/intro.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ export default class Intro extends Component {
</div>
<div class={style.options}>
<Button
ariaLabel='go to advanced settings'
class={style.rejectAll}
invert={true}
onClick={onShowPurposes}
ariaLabelledBy="showPurposes"
>
<LocalLabel localizeKey='showPurposes'>Manage your choices</LocalLabel>
<LocalLabel localizeKey='showPurposes' id="showPurposes">Manage your choices</LocalLabel>
</Button>
<Button
ariaLabel='accept and close'
ariaLabelledBy="acceptAll"
class={style.acceptAll}
onClick={onAcceptAll}
>
<LocalLabel localizeKey='acceptAll'>Got it, thanks!</LocalLabel>
<LocalLabel localizeKey='acceptAll' id="acceptAll">Got it, thanks!</LocalLabel>
</Button>
</div>
</div>
Expand Down