docker: initial container creation
This commit is contained in:
parent
d0cb74bea8
commit
4615f11cfa
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
FROM node:18.17.1-alpine
|
||||||
|
|
||||||
|
WORKDIR /ttc
|
||||||
|
|
||||||
|
ADD . .
|
||||||
|
|
||||||
|
RUN npm i
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD [ "npm","start" ]
|
14
app/client.tsx
Normal file
14
app/client.tsx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { TTCMD } from "@/components/ttcmd";
|
||||||
|
import { FC, use } from "react";
|
||||||
|
|
||||||
|
export const HomeClient: FC<{ body: Promise<string> }> = ({ body }) => {
|
||||||
|
const text = use(body);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TTCMD
|
||||||
|
body={text}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
11
app/page.tsx
11
app/page.tsx
@ -1,9 +1,12 @@
|
|||||||
|
import { readMD } from "@/actions/readMD";
|
||||||
import { TTCMD } from "@/components/ttcmd";
|
import { TTCMD } from "@/components/ttcmd";
|
||||||
import { readFile } from "fs/promises";
|
import { readFile } from "fs/promises";
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
|
import { HomeClient } from "./client";
|
||||||
|
import { Loader } from "@/components/loader";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const body = readFile("./md/home.md", "utf-8");
|
const body = readMD("./md/home.md");
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section className="heading">
|
<section className="heading">
|
||||||
@ -132,10 +135,8 @@ export default function Home() {
|
|||||||
</cite>
|
</cite>
|
||||||
</section> */
|
</section> */
|
||||||
}
|
}
|
||||||
<Suspense>
|
<Suspense fallback={<Loader />}>
|
||||||
<TTCMD
|
<HomeClient body={body} />
|
||||||
body={body}
|
|
||||||
/>
|
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
7
hooks/types.d.ts
vendored
Normal file
7
hooks/types.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export type InputBinder = {
|
||||||
|
name: string;
|
||||||
|
value: string | number;
|
||||||
|
onChange: (
|
||||||
|
e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>,
|
||||||
|
) => void;
|
||||||
|
};
|
@ -1,5 +1,5 @@
|
|||||||
import React, { ChangeEvent, useCallback, useState } from "react";
|
import React, { ChangeEvent, useCallback, useState } from "react";
|
||||||
import { InputBinder } from "../types/inputBinder";
|
import { InputBinder } from "./types";
|
||||||
|
|
||||||
type ObjectStateHookConfig = {
|
type ObjectStateHookConfig = {
|
||||||
disallowSpaces?: boolean;
|
disallowSpaces?: boolean;
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
import { useEffect, useRef } from 'react'
|
|
||||||
import { QueryParams } from '../utils/queryParams'
|
|
||||||
|
|
||||||
export const useQueryParams = (options?: {clean: boolean}) => {
|
|
||||||
const queryParams = useRef(new QueryParams(options))
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log(queryParams.current.get('test'))
|
|
||||||
}, [queryParams.current])
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user