Skip to content

Instantly share code, notes, and snippets.

View PCreations's full-sized avatar

Pierre Criulanscy PCreations

View GitHub Profile
@PCreations
PCreations / a4a319fe4028.diff
Created September 16, 2024 19:26
a4a319fe4028.diff
-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;
@PCreations
PCreations / d0a9964a4d9d.diff
Created September 16, 2024 19:26
d0a9964a4d9d.diff
-0,0 +1,64 @@
+import * as elements from 'typed-html';
+
+export const Toast = ({
+ title,
+ message,
+ type,
+}: {
+ title: string;
+ message: string;
@PCreations
PCreations / 0ab626ffbc36.diff
Created September 16, 2024 19:26
0ab626ffbc36.diff
-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" />
@PCreations
PCreations / 95de1299afa7.diff
Created September 16, 2024 19:26
95de1299afa7.diff
-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}
@PCreations
PCreations / d2a4d280d64e.diff
Created September 16, 2024 19:26
d2a4d280d64e.diff
-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;
@PCreations
PCreations / 773446c2c89c.diff
Created September 16, 2024 19:26
773446c2c89c.diff
-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) {}
@PCreations
PCreations / 5c56c9eb81c6.diff
Created September 16, 2024 19:26
5c56c9eb81c6.diff
-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 {
@PCreations
PCreations / 1f1259f8ded7.diff
Created September 16, 2024 19:26
1f1259f8ded7.diff
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
@PCreations
PCreations / 8e0d16b12a1a.diff
Created September 6, 2024 07:26
8e0d16b12a1a.diff
"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",
@PCreations
PCreations / 624676c921c5.diff
Created September 6, 2024 07:26
624676c921c5.diff
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "ES2021",
"sourceMap": true,