Add in loader spinners within each button in the Logs page. Currently it takes a very long time to load players/stats/etc. This is understandable given the amount of data. While the query is going on behind the scenes, please add loaders into the buttons — Player, Stats, Min/Max Timestamps (and make them non-clickable) — so that is it clear what the user is waiting on. Here is the filter code: import { map } from 'lodash' import React from 'react' import { Button } from 'reactstrap' import * as Dropdowns from './dropdowns' const isSubmittable = filterOptions => { if ( !filterOptions.sport || !filterOptions.schema || !filterOptions.event ) return false return true } const BetFeedFilters = props => { const { metadata, selectedMetadata, updateApiDropdown, filterOptions, events, players, stats, timestamps, submitApiCall, loading } = props if (!metadata) return return ( Query DB ) } export default BetFeedFilters

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Add in loader spinners within each button in the Logs page. Currently it takes a very long time to load players/stats/etc. This is understandable given the amount of data. While the query is going on behind the scenes, please add loaders into the buttons — Player, Stats, Min/Max Timestamps (and make them non-clickable) — so that is it clear what the user is waiting on.

Here is the filter code:

import { map } from 'lodash'
import React from 'react'
import { Button } from 'reactstrap'

import * as Dropdowns from './dropdowns'

const isSubmittable = filterOptions => {
if (
!filterOptions.sport
|| !filterOptions.schema
|| !filterOptions.event
) return false

return true
}

const BetFeedFilters = props => {
const { metadata, selectedMetadata, updateApiDropdown, filterOptions, events, players, stats, timestamps, submitApiCall, loading } = props

if (!metadata) return <div></div>

return (
<div style={{ paddingTop: 10, paddingBottom: 10, display: 'flex', flexDirection: 'column', gap: 20, }}>
<Dropdowns.Single.Sport
updateDropdown={ updateApiDropdown }
value={ filterOptions.sport }
sports={ Object.keys(metadata) }
/>
<Dropdowns.Single.Schema
updateDropdown={ updateApiDropdown }
value={ filterOptions.schema }
sport={ filterOptions.sport }
metadata={ metadata }
/>
<Dropdowns.Single.Event
updateDropdown={ updateApiDropdown }
sport={ filterOptions.sport }
events={ events }
value={ filterOptions.event }
/>
<div style={{ borderBottom: '1px solid #ccc' }}></div>
<Dropdowns.Single.Player
updateDropdown={ updateApiDropdown }
sport={ filterOptions.sport }
players={ players }
value={ filterOptions.player }
selectedMetadata={ selectedMetadata }
/>
<Dropdowns.Multi.Stats
updateDropdown={ updateApiDropdown }
sport={ filterOptions.sport }
stats={ stats }
value={ filterOptions.stats }
selectedMetadata={ selectedMetadata }
/>
<Dropdowns.Single.Timestamp
updateDropdown={ updateApiDropdown }
minOrMax='Min'
timestamps={ timestamps }
value={ filterOptions.timestampMin }
selectedMetadata={ selectedMetadata }
/>
<Dropdowns.Single.Timestamp
updateDropdown={ updateApiDropdown }
minOrMax='Max'
timestamps={ timestamps }
value={ filterOptions.timestampMax }
selectedMetadata={ selectedMetadata }
/>
<div style={{ borderBottom: '1px solid #ccc' }}></div>
<Button
color="primary"
disabled={!isSubmittable(filterOptions) || loading}
onClick={submitApiCall}
>Query DB</Button>
</div>
)
}

export default BetFeedFilters

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Concept of Threads
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education