-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from DHBW-FN-TIT20/KWYG-24-React-Applikation-a…
…n-Guidelines-+-Seitenhierarchie-anpassen Kwyg 24 react applikation an guidelines + seitenhierarchie anpassen
- Loading branch information
Showing
12 changed files
with
45 additions
and
815 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,156 +1,56 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import React from 'react'; | ||
|
||
import { | ||
f7, | ||
f7ready, | ||
App, | ||
Panel, | ||
Views, | ||
View, | ||
Popup, | ||
Page, | ||
Navbar, | ||
Toolbar, | ||
NavRight, | ||
Link, | ||
Block, | ||
BlockTitle, | ||
LoginScreen, | ||
LoginScreenTitle, | ||
List, | ||
ListItem, | ||
ListInput, | ||
ListButton, | ||
BlockFooter | ||
} from 'framework7-react'; | ||
|
||
|
||
import routes from '../js/routes'; | ||
import store from '../js/store'; | ||
|
||
const MyApp = () => { | ||
// Login screen demo data | ||
const [username, setUsername] = useState(''); | ||
const [password, setPassword] = useState(''); | ||
class MyApp extends React.Component { | ||
|
||
// Framework7 Parameters | ||
const f7params = { | ||
f7params = { | ||
name: 'Know Where You Go', // App name | ||
theme: 'auto', // Automatic theme detection | ||
|
||
|
||
|
||
// App store | ||
store: store, | ||
// App routes | ||
routes: routes, | ||
// Register service worker (only on production build) | ||
serviceWorker: process.env.NODE_ENV ==='production' ? { | ||
path: '/service-worker.js', | ||
} : {}, | ||
theme: 'auto', // Automatic theme detection | ||
// App store | ||
store: store, | ||
// App routes | ||
routes: routes, | ||
// Register service worker (only on production build) | ||
serviceWorker: process.env.NODE_ENV === 'production' ? { | ||
path: '/service-worker.js', | ||
} : {}, | ||
}; | ||
const alertLoginData = () => { | ||
f7.dialog.alert('Username: ' + username + '<br>Password: ' + password, () => { | ||
f7.loginScreen.close(); | ||
}); | ||
} | ||
f7ready(() => { | ||
|
||
|
||
// Call F7 APIs here | ||
}); | ||
render() { | ||
|
||
return ( | ||
<App { ...f7params } dark> | ||
return ( | ||
<App {...this.f7params} dark> | ||
|
||
{/* Left panel with cover effect*/} | ||
<Panel left cover dark> | ||
<View> | ||
<Page> | ||
<Navbar title="Left Panel"/> | ||
<Navbar title="Left Panel" /> | ||
<Block>Left panel content goes here</Block> | ||
</Page> | ||
</View> | ||
</Panel> | ||
|
||
|
||
{/* Right panel with reveal effect*/} | ||
<Panel right reveal dark> | ||
<View> | ||
<Page> | ||
<Navbar title="Right Panel"/> | ||
<Block>Right panel content goes here</Block> | ||
</Page> | ||
</View> | ||
</Panel> | ||
|
||
|
||
{/* Views/Tabs container */} | ||
<Views tabs className="safe-areas"> | ||
{/* Tabbar for switching views-tabs */} | ||
<Toolbar tabbar labels bottom> | ||
<Link tabLink="#view-home" tabLinkActive iconIos="f7:house_fill" iconAurora="f7:house_fill" iconMd="material:home" text="Home" /> | ||
<Link tabLink="#view-catalog" iconIos="f7:square_list_fill" iconAurora="f7:square_list_fill" iconMd="material:view_list" text="Catalog" /> | ||
<Link tabLink="#view-settings" iconIos="f7:gear" iconAurora="f7:gear" iconMd="material:settings" text="Settings" /> | ||
</Toolbar> | ||
|
||
{/* Your main view/tab, should have "view-main" class. It also has "tabActive" prop */} | ||
<View id="view-home" main tab tabActive url="/" /> | ||
|
||
{/* Catalog View */} | ||
<View id="view-catalog" name="catalog" tab url="/catalog/" /> | ||
|
||
{/* Settings View */} | ||
<View id="view-settings" name="settings" tab url="/settings/" /> | ||
|
||
</Views> | ||
|
||
{/* Popup */} | ||
<Popup id="my-popup"> | ||
<View> | ||
<Page> | ||
<Navbar title="Popup"> | ||
<NavRight> | ||
<Link popupClose>Close</Link> | ||
</NavRight> | ||
</Navbar> | ||
<Block> | ||
<p>Popup content goes here.</p> | ||
</Block> | ||
</Page> | ||
</View> | ||
</Popup> | ||
|
||
<LoginScreen id="my-login-screen"> | ||
<View> | ||
<Page loginScreen> | ||
<LoginScreenTitle>Login</LoginScreenTitle> | ||
<List form> | ||
<ListInput | ||
type="text" | ||
name="username" | ||
placeholder="Your username" | ||
value={username} | ||
onInput={(e) => setUsername(e.target.value)} | ||
></ListInput> | ||
<ListInput | ||
type="password" | ||
name="password" | ||
placeholder="Your password" | ||
value={password} | ||
onInput={(e) => setPassword(e.target.value)} | ||
></ListInput> | ||
</List> | ||
<List> | ||
<ListButton title="Sign In" onClick={() => alertLoginData()} /> | ||
<BlockFooter> | ||
Some text about login information.<br />Click "Sign In" to close Login Screen | ||
</BlockFooter> | ||
</List> | ||
</Page> | ||
</View> | ||
</LoginScreen> | ||
</App> | ||
) | ||
</App> | ||
) | ||
} | ||
} | ||
|
||
export default MyApp; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.