Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lifeparticle/binarytree
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeparticle committed Jan 1, 2024
2 parents bb652c2 + a2e4fc6 commit 289325f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
14 changes: 14 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,17 @@ PageName/
- **`PageName.test.tsx`**: Test file for the `PageName` component.

Adopting consistent naming conventions helps in understanding and navigating the codebase.

## 3. How to use scaffdog to create a page

```shell
npx scaffdog generate
```

```shell
? Please select a document. page.md
? Please select the output destination directory. src/pages
? Please enter a page name. Test
```
- You will get **index.tsx**, **PageName.tsx**, **PageName.module.scss** and test folder with **PageName.test.tsx**
10 changes: 5 additions & 5 deletions ui/.scaffdog/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ questions:
# `{{ inputs.value | pascal }}/index.ts`

```typescript
export { default } from "./{{ inputs.value }}";
export { default } from "./{{ inputs.value | pascal }}";
```

# `{{ inputs.value | pascal }}/{{ inputs.value | pascal }}.tsx`
Expand All @@ -20,7 +20,7 @@ import { FC } from "react";
import style from "./{{ inputs.value | pascal }}.module.scss";

const {{ inputs.value | pascal }} : FC = () => {
return <div className={style.{{inputs.value | lower}}}>{{inputs.value}}</div>;
return <div className={style.{{inputs.value | lower | replace " " "" }}}>{{inputs.value}}</div>;
};

export default {{ inputs.value | pascal }};
Expand All @@ -29,7 +29,7 @@ export default {{ inputs.value | pascal }};
# `{{ inputs.value | pascal }}/{{ inputs.value | pascal }}.module.scss`

```scss
.{{inputs.value | lower}} {
.{{inputs.value | lower | replace " " ""}} {

}
```
Expand All @@ -38,11 +38,11 @@ export default {{ inputs.value | pascal }};

```tsx
import { render } from "@testing-library/react";
import {{ inputs.value }} from "pages/{{ inputs.value }}";
import {{ inputs.value | pascal }} from "pages/{{ inputs.value | pascal }}";

describe("{{ inputs.value }} Component", () => {
it("renders correctly", () => {
const { getByText } = render(<{{ inputs.value }} />);
const { getByText } = render(<{{ inputs.value | pascal }} />);
expect(getByText("{{ inputs.value }}")).toBeInTheDocument();
});
});
Expand Down

0 comments on commit 289325f

Please sign in to comment.