-
Notifications
You must be signed in to change notification settings - Fork 1
Initial commit #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial commit #1
Conversation
Signed-off-by: Satvik Shubham Singh <58393226+satvikshubham@users.noreply.github.com>
**** | ||
For using bhlib in your app, add the below dependency in the entry/package.json | ||
``` | ||
"dependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add dependency command like this
npm i @ohos/bhlib
*/ | ||
|
||
export class Business { | ||
private workingDays: boolean[] = [false, false, false, false, false, false, false]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add properties in custom component using model class
|
||
@CustomDialog | ||
export struct TimeSelectorDialog { | ||
time: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add properties in custom component using model class
|
||
@Component | ||
export struct BusinessHoursWeekView { | ||
private showBusinessModel: Business = undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add properties in custom component using model class
dayInd: number | ||
format: number | ||
callback: (selIndex, where, dayInd) => void | ||
arr12: string [] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add these arr12 & arr24 variables in separate constant file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@CustomDialog | ||
export struct TimeSelectorDialog { | ||
time: string | ||
where: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time, where, dayInd, format
add these properties in model class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
.textAlign(TextAlign.Center) | ||
.backgroundColor(0xFFFFFF) | ||
.onClick(() => { | ||
this.callback(item, this.where, this.dayInd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle null & undefined validations on callback variable
.textAlign(TextAlign.Center) | ||
.backgroundColor(0xFFFFFF) | ||
.onClick(() => { | ||
this.callback(item, this.where, this.dayInd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle null & undefined validations on callback variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
} | ||
|
||
bhTextColor: string = '#000000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create a model class for BusinessDayAndTime component and add all variables from this component in model class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@Component | ||
export struct BusinessHoursWeekView { | ||
private showBusinessModel: BusinessModel = undefined | ||
isToday = new Date().getDay() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create a model class for BusinessHoursWeekView component and add all variables from this component in model class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
|
||
setWorkingDay = (day: number, v: boolean): void => { | ||
this.workingDays[day - 1] = v; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle null & undefined validations before assigning values to a variable in all setter methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
export struct BusinessPicker { | ||
@Link selectedBusinessModel: BusinessModel | ||
day: string [] = BusinessModel.dayArr | ||
arr: number[] = [0, 1, 2, 3, 4, 5, 6] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create a model class for BusinessPicker component and add all variables from this component in model class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,8 @@ | |||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add copyright text here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Add Copyright text in all ts/ets files |
ForEach(this.arr24, (item) => { | ||
ListItem() { | ||
Text(item) | ||
.fontSize(16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark all fontsizes as fp and dimentions as vp, recheck in all files and handle.
package.json
Outdated
"hypium": "^1.0.0", | ||
"@ohos/hvigor": "1.0.6", | ||
"@ohos/hvigor-ohos-plugin": "1.0.6", | ||
"@ohos/bhlib": "file:./bhlib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the bhlib dependency from here and add at entry's package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls check the comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Signed-off-by: Satvik Shubham Singh 58393226+satvikshubham@users.noreply.github.com