Skip to content

Commit

Permalink
Styled date limit inputs on dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
rayceramsay committed Aug 27, 2024
1 parent 11dce23 commit d5d876d
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 4 deletions.
28 changes: 24 additions & 4 deletions frontend/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,30 @@ function Dashboard() {
<Navbar />
<main className={styles.wrapper}>
<form className={styles.dateLimitsForm}>
<input type='date' value={startDate} onChange={(e) => setStartDate(e.target.value)} />
<input type='date' value={endDate} onChange={(e) => setEndDate(e.target.value)} />
<button type='button' onClick={() => getPageData({ variables: { startDate, endDate } })}>
Get Data
<label className={styles.dateLimitInputContainer}>
<span className={styles.dateLimitInputLabel}>Start Date</span>
<input
type='date'
value={startDate}
onChange={(e) => setStartDate(e.target.value)}
className={styles.dateLimitInput}
/>
</label>
<label className={styles.dateLimitInputContainer}>
<span className={styles.dateLimitInputLabel}>End Date</span>
<input
type='date'
value={endDate}
onChange={(e) => setEndDate(e.target.value)}
className={styles.dateLimitInput}
/>
</label>
<button
type='button'
onClick={() => getPageData({ variables: { startDate, endDate } })}
className={styles.dateLimitSubmit}
>
Get Analytics
</button>
</form>
<div className={styles.charts}>
Expand Down
65 changes: 65 additions & 0 deletions frontend/styles/Dashboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,71 @@
}

.dateLimitsForm {
display: flex;
justify-content: right;
align-items: end;
padding-left: 4rem;
padding-right: 4rem;
margin-bottom: 1rem;
}

.dateLimitInputContainer {
color: #ddd;
display: flex;
flex-direction: column;
align-items: center;
margin-right: 1rem;
}

.dateLimitInputLabel,
.dateLimitInput,
.dateLimitSubmit {
color: inherit;
font-family: inherit;
font-size: 0.85rem;
}

.dateLimitInput,
.dateLimitSubmit {
padding: 0 1rem;
height: 2.2rem;
transition-duration: 150ms;
transition-property: border-color;
}

.dateLimitInputLabel {
margin-bottom: 0.25rem;
}

.dateLimitInput {
background-color: transparent;
border: 1px solid #333;
border-radius: 0.5rem;
cursor: text;
}

.dateLimitInput:hover {
border-color: #666;
}

.dateLimitInput::-webkit-calendar-picker-indicator {
cursor: pointer;
}

.dateLimitSubmit {
height: 2.2rem;
padding: 0 2rem;
cursor: pointer;
background-color: #333;
border-width: 2px;
border-style: solid;
border-color: #555;
border-radius: 0.25rem;
font-weight: bold;
}

.dateLimitSubmit:hover {
border-color: #888;
}

.charts {
Expand Down

0 comments on commit d5d876d

Please sign in to comment.