Skip to content

Commit

Permalink
Merge branch 'codeforboston:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
thatoldplatitude authored Jan 3, 2024
2 parents 0cff8e7 + d8c5553 commit bd18b28
Show file tree
Hide file tree
Showing 16 changed files with 118 additions and 31 deletions.
18 changes: 0 additions & 18 deletions heat-stack/app/components/CaseSummary.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Checkbox } from '../../../components/ui/checkbox.tsx'
import { Checkbox } from '../../../../components/ui/checkbox.tsx'

import {
Table,
Expand All @@ -7,7 +7,7 @@ import {
TableHead,
TableHeader,
TableRow,
} from '../../../components/ui/table.tsx'
} from '../../../../components/ui/table.tsx'

const months = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Form } from '@remix-run/react'
import { Input } from '../input.tsx'
import { Label } from '../label.tsx'
import { Input } from '../../input.tsx'
import { Label } from '../../label.tsx'

export function HomeInformation() {
const name = 'Pietro Schirano'
Expand Down
32 changes: 23 additions & 9 deletions heat-stack/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
json,
type LinksFunction,
} from '@remix-run/node'
import { Links, Scripts } from '@remix-run/react'
import { CaseSummary } from './components/CaseSummary.tsx'
import { Links, Scripts, Outlet } from '@remix-run/react'
import { href as iconsHref } from './components/ui/icon.tsx'
import fontStyleSheetUrl from './styles/font.css'
import tailwindStyleSheetUrl from './styles/tailwind.css'
Expand All @@ -18,7 +17,11 @@ import { prisma } from './utils/db.server.ts'
import { getEnv } from './utils/env.server.ts'
import { combineHeaders, getDomainUrl } from './utils/misc.tsx'
import { useNonce } from './utils/nonce-provider.ts'

Check warning on line 19 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

'useNonce' is defined but never used
import { combineServerTimings, makeTimings, time } from './utils/timing.server.ts'
import {
combineServerTimings,
makeTimings,
time,
} from './utils/timing.server.ts'
// Hints may not be required. Double check.
import { WeatherExample } from './components/WeatherExample.tsx'

Check warning on line 26 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`./components/WeatherExample.tsx` import should occur before import of `./styles/font.css`

Check warning on line 26 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

'WeatherExample' is defined but never used
import { Weather } from './WeatherExample.js'

Check warning on line 27 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

All imports in the declaration are only used as types. Use `import type`
Expand Down Expand Up @@ -115,18 +118,25 @@ export async function loader({ request }: DataFunctionArgs) {
)
}

/**
* Step 4 of making Server Timings
* https://github.com/epicweb-dev/epic-stack/blob/main/docs/server-timing.md
/**
* Step 4 of making Server Timings
* https://github.com/epicweb-dev/epic-stack/blob/main/docs/server-timing.md
*/
export const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {
return {
'Server-Timing': combineServerTimings(parentHeaders, loaderHeaders),
}
}

export default function HeatStack({ env = {} }) {
const nonce = useNonce()
export default function HeatStack({
children,
env = {},
nonce,
}: {
children: React.ReactNode
nonce: string
env?: Record<string, string>
}) {
return (
<html lang="en" className={`${'light'} h-full overflow-x-hidden`}>
<head>
Expand All @@ -135,7 +145,11 @@ export default function HeatStack({ env = {} }) {
<Links />
</head>
<body className="bg-background text-foreground">
<CaseSummary />
<div>Site header</div>
<br />
<Outlet />
<br />
<div>Site footer</div>
<script
nonce={nonce}
dangerouslySetInnerHTML={{
Expand Down
18 changes: 18 additions & 0 deletions heat-stack/app/routes/_heat+/CaseSummary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { CurrentHeatingSystem } from '../../components/ui/heat/CaseSummaryComponents/CurrentHeatingSystem.tsx'
import { EnergyUseHistory } from '../../components/ui/heat/CaseSummaryComponents/EnergyUseHistory.tsx'
import { Graphs } from '../../components/ui/heat/CaseSummaryComponents/Graphs.tsx'
import { HomeInformation } from '../../components/ui/heat/CaseSummaryComponents/HomeInformation.tsx'

export default function CaseSummary() {
return (
<main className="main-container">
<div>
<h1 className="page-title">Case Summary</h1>
<HomeInformation />
<CurrentHeatingSystem />
<EnergyUseHistory />
<Graphs />
</div>
</main>
)
}
17 changes: 17 additions & 0 deletions heat-stack/app/routes/_heat+/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default function Home() {
return (
<div>
<h1>
This is the Heat Home page - the first page a user will see when
starting the app
</h1>

<h1>Some paths with placeholder pages are:</h1>
<ul>
<li>/casesummary - see an example case summary</li>
<li>/cases - see a list of cases</li>
<li>/epicstack - information about the Epic Stack</li>
</ul>
</div>
)
}
File renamed without changes.
35 changes: 35 additions & 0 deletions heat-stack/app/routes/cases+/$analysisid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { json, type DataFunctionArgs } from '@remix-run/node'
import { Outlet, useLoaderData } from '@remix-run/react'
import { Fragment } from 'react'

export async function loader({ params }: DataFunctionArgs) {
// // From the database:
// const user = await prisma.user.findFirst({
// select: {
// id: true,
// name: true,
// username: true,
// createdAt: true,
// image: { select: { id: true } },
// },
// where: {
// username: params.username,
// },
// })

return json({
id: params.analysisid
})
}

export default function Analysis () {
const data = useLoaderData<typeof loader>()
const id = data?.id

return (
<Fragment>
<h1>{ id }</h1>
{/* <Outlet /> */}
</Fragment>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Outlet } from '@remix-run/react'

export default function Cases() {
return(
<div className="w-100p h-100p bk-primary">
<h1>Case name</h1>
<Outlet/>
</div>
)
}
11 changes: 11 additions & 0 deletions heat-stack/app/routes/cases+/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default function Cases() {
return(
<div className="w-96 bg-slate-400 ">
<h1>Cases</h1>
<ul>
<li>Case 1</li>
<li>Case 2</li>
</ul>
</div>
)
}

0 comments on commit bd18b28

Please sign in to comment.