-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add optional color for slide-toggle when unactivated #90
feat: add optional color for slide-toggle when unactivated #90
Conversation
add optional color for slide0toggle when it is unactivated, also created storybook for each case
{ | ||
cod: "3", | ||
checked: false, | ||
title: "UNACTIVATE COLOR", |
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.
Shouldn't the title be 'Inactive'?
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.
Or maybe 'unchecked', to keep consistency with component property
@@ -9,6 +9,7 @@ import { FormControl } from "@angular/forms"; | |||
export class SlideToggleComponent implements OnInit { | |||
checked = true; | |||
colorFormControl = new FormControl("#08B25A"); | |||
uncheckedColorFormControl = new FormControl("#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.
missing ;
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.
Also, please add the access modifier for these properties
type="color" | ||
placeholder="Unchecked Color" | ||
[formControl]="uncheckedColorFormControl" | ||
/> |
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.
/>
could be moved to the previous line
[title]="toggle?.title" | ||
(toggleChange)="toggleChange(toggle?.cod, $event)" | ||
ngDefaultControl | ||
></gor-slide-toggle> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</ng-container> | ||
</ng-container> |
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.
Missing newline at end of file
<span class="slider-before" [ngClass]="{ active: checked }"></span> | ||
</span> | ||
</label> | ||
<span class="title">{{ title }}</span> | ||
</div> | ||
</div> |
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.
Missing newline at end of file
* @Optional | ||
*/ | ||
color?: 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.
Please remove extra empty line
) | ||
.addDecorator(withKnobs) | ||
.add( | ||
'three different cases about slide-toggle', |
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.
Summary should be descriptive of functionality being demonstrated - in this case, color configurations
storiesOf('slide-toggle', module) | ||
.addDecorator( | ||
moduleMetadata({ | ||
imports: [CommonModule], |
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.
Check if this import is necessary
@@ -0,0 +1,74 @@ | |||
import { storiesOf, moduleMetadata } from '@storybook/angular'; |
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.
Nice stories, keep up the good work
checked: false, | ||
title: "UNACTIVATE COLOR", | ||
color: "", | ||
uncheckedColor: "#456888" |
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.
Check code identation in all this file
{ | ||
cod: "3", | ||
checked: false, | ||
title: "UNACTIVATE COLOR", |
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.
Keep text capitalization consistent across titles
> | ||
</gor-slide-toggle> | ||
` | ||
})); |
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.
Missing newline at end of file
fix some sintax and identation erros, also add acess modifier for some properties
.prettierignore
Outdated
@@ -4,3 +4,4 @@ | |||
**/*.md | |||
**/*.scss | |||
**/*.html | |||
**/*.stories.ts |
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.
Missing newline at end of file
public colorFormControl = new FormControl('#08B25A'); | ||
public uncheckedColorFormControl = new FormControl('#000000'); | ||
public disabled = false; | ||
public titleFormControl = new FormControl('click me'); | ||
|
||
constructor() {} | ||
|
||
ngOnInit() {} |
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.
Empty methods can be removed
styleUrls: ["./slide-toggle.component.scss"] | ||
selector: 'gorilainvest-slide-toggle', | ||
templateUrl: './slide-toggle.component.html', | ||
styleUrls: ['./slide-toggle.component.scss'] | ||
}) | ||
export class SlideToggleComponent implements OnInit { |
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.
OnInit interface can be removed
{ | ||
cod: '3', | ||
checked: false, | ||
title: 'UNCHEKED COLOR', |
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.
Please correct typo in title
const labels = ['title']; | ||
|
||
return { | ||
|
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 extra empty line
[labels]='${JSON.stringify(labels)}' | ||
> | ||
</gor-slide-toggle-group> | ||
` |
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.
Check identation
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.
Nice job, thanks for this new feature! Just one little thing before we can go... Can you check story name? We don't use the component selector to name stories... Also, can you too check the plural of examples titles?
…mponents into feature/unchecked-color-slidetoggle
Two more things before merge the PR:
|
add optional color for slide0toggle when it is unactivated, also created
storybook for each case