Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
steveleetn91 committed Jan 12, 2022
1 parent 9cac96c commit 109bfa1
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 32 deletions.
3 changes: 3 additions & 0 deletions components/header/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="site-logo">
<img src="{{logo}}"/>
</div>
3 changes: 3 additions & 0 deletions components/header/header.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default interface headerInterface {
logo : string;
}
8 changes: 8 additions & 0 deletions components/header/header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.site-logo {
height: 250px;
width: 320px;
margin: auto;
img {
max-width: 100%;
}
}
9 changes: 9 additions & 0 deletions components/header/header.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import VnNative3HTMLElement from "vnnative3-webview/dist/HTMLElement/HTMLElement";
import headerInterface from "./header.interface";
import './header.scss';
export default function header () : string {
const state : headerInterface = {
logo : require('../../assets/images/logo.png').default
};
return (new VnNative3HTMLElement).make(require('./header.html').default,state);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vn-native-3",
"version": "1.3.2",
"version": "1.3.3",
"description": "Vn Native Framework",
"main": "./bin/electron/production.js",
"scripts": {
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion pages/ExamplePage/ExamplePage.State.Interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default interface ExamplePageStateInterface {
title : string;
slogan: string;
logo : string;
header : string;
homePage: string
}
6 changes: 3 additions & 3 deletions pages/ExamplePage/ExamplePage.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div class="info-box">
<div class="site-logo">
<img src="{{logo}}"/>
</div>
{{{header}}}
<div class="box-container">
<h1>{{title}}</h1>
<p>{{slogan}}</p>
<hr/>
<h4>Page feature</h4>
<p>To create new page you can consider <code>IndexPage</code> at <code>./pages</code> directory.</p>
<a href="{{homePage}}">Home Page</a>
<h4>API</h4>
<p>You can easy use fetchjs to subscribe api.</p>
<h4>Documents</h4>
<p>Please see more document at GITHUB : <code>https://github.com/steveleetn91/vn-native-3</code></p>
<h4>Licence</h4>
Expand Down
8 changes: 0 additions & 8 deletions pages/ExamplePage/ExamplePage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ body {
h1 {
color: red;
}
.site-logo {
height: 250px;
width: 320px;
margin: auto;
}
.site-logo img {
max-width: 100%;
}
.box-container {
width: 80%;
margin: auto;
Expand Down
5 changes: 3 additions & 2 deletions pages/ExamplePage/ExamplePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ import VnNative3HTMLElement from 'vnnative3-webview/dist/HTMLElement/index';
import './ExamplePage.scss';
import ExamplePageStateInterface from './ExamplePage.State.Interface';
import VnNative3Location from 'vnnative3-location/dist/index';
import header from '../../components/header/header';
export default class ExamplePage implements HTMLPageInterFace {
state : ExamplePageStateInterface = {
title : "Example page ",
slogan : "Document",
logo : require('../../assets/images/logo.png').default,
header : header(),
homePage : (new VnNative3Location).redirect.goUrl('/index.html',[])
};
constructor() {}
public beforeRender() : void {}
public afterRender() : void {}
public render() : string {
return (new VnNative3HTMLElement).head(this.state).next(() => {
console.log("Hello I'm next action ! You can use a lots actions");
console.log("Hello I'm next action ! You can use a lots of actions");
}).make(require('./ExamplePage.html').default,this.state);
}
}
Empty file.
5 changes: 2 additions & 3 deletions pages/IndexPage/IndexPage.State.Interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import VnNative3Location from 'vnnative3-location/dist/index';
export default interface IndexPageStateInterface {
title : string;
slogan: string;
logo : string;
examplePageUrl : string
examplePageUrl : string,
header : string
}
6 changes: 3 additions & 3 deletions pages/IndexPage/IndexPage.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div class="info-box">
<div class="site-logo">
<img src="{{logo}}"/>
</div>
{{{header}}}
<div class="box-container">
<h1>{{title}}</h1>
<p>{{slogan}}</p>
<hr/>
<h4>Page feature</h4>
<p>To create new page you can consider <code>IndexPage</code> at <code>./pages</code> directory.</p>
<a href="{{examplePageUrl}}">Example page</a>
<h4>API</h4>
<p>You can easy use fetchjs to subscribe api.</p>
<h4>Documents</h4>
<p>Please see more document at GITHUB : <code>https://github.com/steveleetn91/vn-native-3</code></p>
<h4>Licence</h4>
Expand Down
8 changes: 0 additions & 8 deletions pages/IndexPage/IndexPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ body {
h1 {
color: red;
}
.site-logo {
height: 250px;
width: 320px;
margin: auto;
}
.site-logo img {
max-width: 100%;
}
.box-container {
width: 80%;
margin: auto;
Expand Down
7 changes: 4 additions & 3 deletions pages/IndexPage/IndexPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ import VnNative3HTMLElement from 'vnnative3-webview/dist/HTMLElement/index';
import './IndexPage.scss';
import IndexPageStateInterface from './IndexPage.State.Interface';
import VnNative3Location from 'vnnative3-location/dist/index';
import header from '../../components/header/header';
export default class IndexPage implements HTMLPageInterFace {
state : IndexPageStateInterface = {
title : "Vn Native Framework 3 ",
slogan : "Cross platforms - Version 1.3",
logo : require('../../assets/images/logo.png').default,
slogan : "Cross platforms - Version 1.3.3",
header : header(),
examplePageUrl : (new VnNative3Location).redirect.goUrl('/page/example',[])
};
constructor() {}
public beforeRender() : void {}
public afterRender() : void {}
public render() : string {
return (new VnNative3HTMLElement).head(this.state).next(() => {
console.log("Hello I'm next action ! You can use a lots actions");
console.log("Hello I'm next action ! You can use a lots of actions");
}).make(require('./IndexPage.html').default,this.state);
}
}

0 comments on commit 109bfa1

Please sign in to comment.