alexander bt fixed
This commit is contained in:
parent
61118a7423
commit
8f8fc3107d
46 changed files with 1109 additions and 304 deletions
|
@ -0,0 +1,11 @@
|
|||
import { Result } from "../../core/helper/result";
|
||||
|
||||
export class NumberTriviaModel {
|
||||
constructor() {}
|
||||
isValid(): Result<string, void> {
|
||||
return Result.ok();
|
||||
}
|
||||
static empty() {
|
||||
return new NumberTriviaModel();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
export class {{name.pascalCase()}}Repository {
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
import { observer } from "mobx-react-lite";
|
||||
import { {{name.pascalCase()}}Store } from "./{{name.snakeCase()}}_store";
|
||||
import React from "react";
|
||||
|
||||
export const {{name.pascalCase()}}ScreenPath = "/auth";
|
||||
|
||||
export const {{name.pascalCase()}}Screen = observer(() => {
|
||||
const [store] = React.useState(() => new {{name.pascalCase()}}Store());
|
||||
return <></>;
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
import makeAutoObservable from "mobx-store-inheritance";
|
||||
|
||||
export class {{name.pascalCase()}}Store {
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
}
|
16
ui/bricks/base_feature/brick.yaml
Normal file
16
ui/bricks/base_feature/brick.yaml
Normal file
|
@ -0,0 +1,16 @@
|
|||
name: base_feature
|
||||
description: A brick to create Clean Architecture Feature
|
||||
|
||||
version: 0.0.1
|
||||
|
||||
# The following defines the environment for the current brick.
|
||||
# It includes the version of mason that the brick requires.
|
||||
environment:
|
||||
mason: ">=0.1.0-dev.26 <0.1.0"
|
||||
|
||||
vars:
|
||||
name:
|
||||
type: string
|
||||
description: The feature name
|
||||
default: my feature
|
||||
prompt: What's your feature name (e.g. dance school)
|
|
@ -0,0 +1,11 @@
|
|||
import { Result } from "../../../../../../core/helper/result";
|
||||
|
||||
export class NumberTriviaModel {
|
||||
constructor() {}
|
||||
isValid(): Result<string, void> {
|
||||
return Result.ok();
|
||||
}
|
||||
static empty() {
|
||||
return new NumberTriviaModel();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import React from "react";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { {{ name.pascalCase() }}Store } from "./{{name.snakeCase()}}_store";
|
||||
import { IPropsForm } from "../forms";
|
||||
import { NumberTriviaModel } from "./number_trivia";
|
||||
|
||||
export const {{ name.pascalCase()}} = observer((props: IPropsForm<Partial<NumberTriviaModel>>) => {
|
||||
const [store] = React.useState(() => new {{ name.pascalCase() }}Store());
|
||||
React.useEffect(() => {
|
||||
store.init();
|
||||
}, [store]);
|
||||
|
||||
return <></>;
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
import { HttpRepository } from "../../../../../../core/repository/http_repository";
|
||||
|
||||
export class {{name.pascalCase()}}HttpRepository extends HttpRepository {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
import makeAutoObservable from "mobx-store-inheritance";
|
||||
import { NavigateFunction } from "react-router-dom";
|
||||
import { NumberTriviaModel } from "./number_trivia";
|
||||
import { FormState, CoreError } from "../../../../../../core/store/base_store";
|
||||
import { {{name.pascalCase()}}HttpRepository } from "./{{name.snakeCase()}}_http_repository";
|
||||
|
||||
export class {{name.pascalCase()}}Store extends FormState<NumberTriviaModel, CoreError> {
|
||||
constructor() {
|
||||
super();
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
viewModel: NumberTriviaModel = NumberTriviaModel.empty();
|
||||
cameraDeviceHttpRepository: {{name.pascalCase()}}HttpRepository = new {{name.pascalCase()}}HttpRepository();
|
||||
errorHandingStrategy = (error: CoreError) => { }
|
||||
init = async (navigate?: NavigateFunction | undefined) => {
|
||||
|
||||
}
|
||||
|
||||
}
|
16
ui/bricks/form/brick.yaml
Normal file
16
ui/bricks/form/brick.yaml
Normal file
|
@ -0,0 +1,16 @@
|
|||
name: form
|
||||
description: A brick to create form at behavior_tree_builder
|
||||
|
||||
version: 0.0.1
|
||||
|
||||
# The following defines the environment for the current brick.
|
||||
# It includes the version of mason that the brick requires.
|
||||
environment:
|
||||
mason: ">=0.1.0-dev.26 <0.1.0"
|
||||
|
||||
vars:
|
||||
name:
|
||||
type: string
|
||||
description: The feature name
|
||||
default: my feature
|
||||
prompt: What's your feature name (e.g. dance school)
|
Loading…
Add table
Add a link
Reference in a new issue