Skip to content

Commit

Permalink
Convert list elements to button elements for stats tabs in order to e…
Browse files Browse the repository at this point in the history
…nable keyboard navigation (#2526)
  • Loading branch information
djanda97 authored Jan 5, 2023
1 parent 89da676 commit f949278
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
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

0 comments on commit f949278

Please sign in to comment.