This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-12,15 +12,17 @@ const meta = { | |
}, | |
argTypes: { | |
name: { control: 'color' }, | |
+ type: { control: 'text' }, | |
}, | |
-} satisfies Meta<{ name: string }>; | |
+} satisfies Meta<{ name: string; type: string }>; | |
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-0,0 +1,64 @@ | |
+import * as elements from 'typed-html'; | |
+ | |
+export const Toast = ({ | |
+ title, | |
+ message, | |
+ type, | |
+}: { | |
+ title: string; | |
+ message: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-0,0 +1,39 @@ | |
+import * as elements from 'typed-html'; | |
+ | |
+export const Layout = ({ children }: elements.Attributes) => { | |
+ return ( | |
+ <html> | |
+ <head> | |
+ <title>Crafty Reads</title> | |
+ <meta charset="UTF-8" /> | |
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-1,10 +1,10 @@ | |
import * as elements from 'typed-html'; | |
-export const Button = ({ name }: { name: string }) => { | |
+export const Button = ({ name, type }: { name: string; type: string }) => { | |
return ( | |
<button | |
class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" | |
- type="submit" | |
+ type={type} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-0,0 +1,46 @@ | |
+import * as elements from 'typed-html'; | |
+import { Button } from './button'; | |
+import { Toast } from './toast'; | |
+ | |
+export const AddBookForm = ({ | |
+ inputPlaceholder, | |
+ toast, | |
+}: { | |
+ inputPlaceholder: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-0,0 +1,47 @@ | |
+import * as elements from 'typed-html'; | |
+import { Body, Controller, Get, Post } from '@nestjs/common'; | |
+import { AddBookUseCase } from './add-book.usecase'; | |
+import { Layout } from './components/layout'; | |
+import { AddBookForm } from './components/add-book-form'; | |
+ | |
+@Controller() | |
+export class AppController { | |
+ constructor(private readonly addBookUseCase: AddBookUseCase) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-1,91 +0,0 @@ | |
-import { Body, Controller, Get, Post } from '@nestjs/common'; | |
-import { AddBookUseCase } from './add-book.usecase'; | |
- | |
-@Controller() | |
-export class AppController { | |
- constructor(private readonly addBookUseCase: AddBookUseCase) {} | |
- | |
- @Get() | |
- index(): string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/app.controller.ts b/src/app.controller.ts | |
deleted file mode 100644 | |
index 5e59a92..0000000 | |
--- a/src/app.controller.ts | |
+++ /dev/null | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"test:e2e": "jest --config ./test/jest-e2e.json", | |
"storybook": "storybook dev -p 6006", | |
"build-storybook": "storybook build", | |
- "postinstall": "patch-package" | |
+ "postinstall": "patch-package && rm -rf node_modules/@types/react" | |
}, | |
"dependencies": { | |
"@nestjs/common": "^10.0.0", | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"declaration": true, | |
"removeComments": true, | |
"emitDecoratorMetadata": true, | |
"experimentalDecorators": true, | |
"allowSyntheticDefaultImports": true, | |
"target": "ES2021", | |
"sourceMap": true, |
NewerOlder