-
Notifications
You must be signed in to change notification settings - Fork 959
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(docs): hoc docs and doc-app refactor (#389)
- Loading branch information
Showing
37 changed files
with
599 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
docs/src/app/blocks/components/hoc-params-block/hoc-params-block.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @license | ||
* Copyright Akveo. All Rights Reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
Input, | ||
} from '@angular/core'; | ||
import { NgdMetadataService } from '../../../@theme/services'; | ||
|
||
@Component({ | ||
selector: 'ngd-hoc-params-block', | ||
template: ` | ||
<ngd-prop-block *ngIf="params.length > 0" | ||
[properties]="params" | ||
name="Parameters" | ||
[slag]="slag" | ||
class="widget-block"> | ||
</ngd-prop-block> | ||
`, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class NgdHocParamsBlockComponent { | ||
slag: string; | ||
|
||
params: any[] = []; | ||
|
||
@Input('source') | ||
set setSource(source: any) { | ||
this.params = source.params; | ||
this.slag = source.slag; | ||
} | ||
|
||
constructor(private metadataService: NgdMetadataService) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# React Native UI Kitten Theme Switching | ||
|
||
React Native UI Kitten Theme System allows the developer to change the theme. | ||
To do this, it is enough to replace the configuration object of the `theme` and pass it | ||
through the property into the `ApplicationProvider`. | ||
|
||
<hr> | ||
|
||
### Changing Theme Example | ||
|
||
```tsx | ||
import { mapping } from '@eva/eva'; | ||
import { theme } from '@eva/theme-eva'; | ||
import { customTheme } from './path-to/custom-theme; | ||
import { | ||
ApplicationProvider, | ||
ThemeType, | ||
} from '@kitten/theme'; | ||
import { Application } from './path-to/root.component'; | ||
|
||
interface AppState { | ||
theme: ThemeType; | ||
} | ||
|
||
export default class App extends React.Component<any, State> { | ||
|
||
public state: State = { | ||
theme: theme, | ||
}; | ||
|
||
private changeTheme = (): void => { | ||
this.setState({ theme: customTheme }); | ||
} | ||
|
||
public render(): React.ReactNode { | ||
return ( | ||
<ApplicationProvider | ||
mapping={mapping} | ||
theme={theme}> | ||
<Application/> | ||
</ApplicationProvider> | ||
); | ||
} | ||
} | ||
``` | ||
|
||
<hr> | ||
|
||
### Other theme management options | ||
|
||
This is not the only way to change the `theme` of the application. It is also possible to use one of the libraries that provide state management services, such as: | ||
|
||
- [MobX](https://mobx.js.org/getting-started.html) | ||
- [Redux](https://redux.js.org/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.