Skip to content

Commit

Permalink
add interface for record color theme, try training slash
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlettmiss committed Jan 25, 2024
1 parent 6e1a49a commit 66a3913
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ui/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ const nextConfig = {
// reactStrictMode: true,
env: {
// apiUrl: "http://localhost:8080/api",
// apiUrl: "https://mypetjournal-lqkz3.ondigitalocean.app/api",
apiUrl: "/api",
apiUrl: "https://mypetjournal-lqkz3.ondigitalocean.app/api",
// apiUrl: "/api",
},
images: {
unoptimized: true,
},
trailingSlash: true,
distDir: "build",
}

Expand Down
10 changes: 8 additions & 2 deletions ui/src/pages/pet/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ interface RecordColor {
backgroundColor: string
}

interface RecordTheme {
border: string
icon: string
background: string
}

interface PetState {
token?: string
pet?: Pet
Expand Down Expand Up @@ -528,7 +534,7 @@ class PetPage extends BaseComponent<PetProps, PetState> {
)
}

private getRecordTypeColors = (type: string) => {
private getRecordTypeColors = (type: string): RecordTheme => {
let typeColor = {border: "border-indigo-600", icon: "text-indigo-300", background: "bg-indigo-600"}
if (type === RecordType.REMINDER) {
typeColor = {border: "border-teal-600", icon: "text-teal-300", background: "bg-teal-600"}
Expand All @@ -538,7 +544,7 @@ class PetPage extends BaseComponent<PetProps, PetState> {
return typeColor
}

private recordEntry = (r: Record, color: any) => {
private recordEntry = (r: Record, color: RecordTheme) => {
const upcoming = r.administeredBy === undefined
return (
<div
Expand Down

0 comments on commit 66a3913

Please sign in to comment.