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

Enable keyboard navigation for stats tabs by converting list elements to button elements #2526

Merged
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
12 changes: 6 additions & 6 deletions assets/js/dashboard/stats/devices/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,21 @@ export default class Devices extends React.Component {

if (isActive) {
return (
<li
<button
className="inline-block h-5 font-bold text-indigo-700 active-prop-heading dark:text-indigo-500"
>
{name}
</li>
</button>
)
}

return (
<li
<button
className="cursor-pointer hover:text-indigo-600"
onClick={this.setMode(mode)}
>
{name}
</li>
</button>
)
}

Expand All @@ -188,11 +188,11 @@ export default class Devices extends React.Component {
>
<div className="flex justify-between w-full">
<h3 className="font-bold dark:text-gray-100">Devices</h3>
<ul className="flex text-xs font-medium text-gray-500 dark:text-gray-400 space-x-2">
<div className="flex text-xs font-medium text-gray-500 dark:text-gray-400 space-x-2">
{ this.renderPill('Size', 'size') }
{ this.renderPill('Browser', 'browser') }
{ this.renderPill('OS', 'os') }
</ul>
</div>
</div>
{ this.renderContent() }
</div>
Expand Down
12 changes: 6 additions & 6 deletions assets/js/dashboard/stats/locations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,21 @@ export default class Locations extends React.Component {

if (isActive) {
return (
<li
<button
className="inline-block h-5 text-indigo-700 dark:text-indigo-500 font-bold active-prop-heading"
>
{name}
</li>
</button>
)
}

return (
<li
<button
className="hover:text-indigo-600 cursor-pointer"
onClick={this.setMode(mode)}
>
{name}
</li>
</button>
)
}

Expand All @@ -177,12 +177,12 @@ export default class Locations extends React.Component {
<h3 className="font-bold dark:text-gray-100">
{labelFor[this.state.mode] || 'Locations'}
</h3>
<ul className="flex font-medium text-xs text-gray-500 dark:text-gray-400 space-x-2">
<div className="flex font-medium text-xs text-gray-500 dark:text-gray-400 space-x-2">
{ this.renderPill('Map', 'map') }
{ this.renderPill('Countries', 'countries') }
{ this.renderPill('Regions', 'regions') }
{ this.renderPill('Cities', 'cities') }
</ul>
</div>
</div>
{ this.renderContent() }
</div>
Expand Down
12 changes: 6 additions & 6 deletions assets/js/dashboard/stats/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,21 @@ export default class Pages extends React.Component {

if (isActive) {
return (
<li
<button
className="inline-block h-5 text-indigo-700 dark:text-indigo-500 font-bold active-prop-heading"
>
{name}
</li>
</button>
)
}

return (
<li
<button
className="hover:text-indigo-600 cursor-pointer"
onClick={this.setMode(mode)}
>
{name}
</li>
</button>
)
}

Expand All @@ -147,11 +147,11 @@ export default class Pages extends React.Component {
<h3 className="font-bold dark:text-gray-100">
{labelFor[this.state.mode] || 'Page Visits'}
</h3>
<ul className="flex font-medium text-xs text-gray-500 dark:text-gray-400 space-x-2">
<div className="flex font-medium text-xs text-gray-500 dark:text-gray-400 space-x-2">
{ this.renderPill('Top Pages', 'pages') }
{ this.renderPill('Entry Pages', 'entry-pages') }
{ this.renderPill('Exit Pages', 'exit-pages') }
</ul>
</div>
</div>
{/* Main Contents */}
{ this.renderContent() }
Expand Down