ucsb-cs156-f23 / proj-happycows-f23-5pm-1

https://ucsb-cs156-f23.github.io/proj-happycows-f23-5pm-1/
0 stars 0 forks source link

FEATURE: Fix UI/UX on Admin Commons List page #12

Closed github-actions[bot] closed 10 months ago

github-actions[bot] commented 11 months ago

User Story

Discussion

The current Admin Commons List page shows a table like this, which requires the user to scroll:

admin-commons-list-scrolling

We can fit more of the data on the screen if we adjust the headers to introduce line breaks:

image

We can fit more of the data on the screen if we adjust the headers to compress the font in cases where the header is wider than the data, and in some cases, abbreviate the headers:

image

Hints on how to do that are listed below:

Acceptance Criteria

Implementation Todos

To add line breaks, we can change this:

        {
            Header:'Cow Price',
            accessor: row => row.commons.cowPrice,
            id: 'commons.cowPrice',
        },

to this, for each header:

       {
            Header: <span>Cow<br />Price</span>,
            accessor: row => row.commons.cowPrice,
            id: 'commons.cowPrice',
        },

The <br /> tag indicates a line break in HTML.

We can also change some of the <span> tags tp <small> tags. Here's what a portion of that code looks like (but only where is makes sense because the data is narrower than the header)

{
            Header: <small>Starting<br />Balance</small>,
            accessor: row => row.commons.startingBalance,
            id: 'commons.startingBalance'
        },
        {
            Header: <span>Starting<br />Date</span>,
            accessor: row => String(row.commons.startingDate).slice(0,10),
            id: 'commons.startingDate'
        },
        {
            Header: <small>Degrad<br />Rate</small>,
            accessor: row => row.commons.degradationRate,
            id: 'commons.degradationRate'
        },