diff --git a/App.js b/App.js index 798e0d5..c9c8034 100644 --- a/App.js +++ b/App.js @@ -1,7 +1,4 @@ /** - * Sample React Native App - * https://github.com/facebook/react-native - * * @format * @flow strict-local */ @@ -9,58 +6,29 @@ import React from 'react'; import { StyleSheet, - ScrollView, View, - Text, } from 'react-native'; -import { - Header, - LearnMoreLinks, - Colors, -} from 'react-native/Libraries/NewAppScreen'; - class App extends React.Component { render() { return ( - -
- - - Learn More - - Read the docs to discover what to do next: - - - + <> + + + - + ); } }; const styles = StyleSheet.create({ - scrollView: { - backgroundColor: Colors.lighter, - }, - body: { - backgroundColor: Colors.lighter, + mainLayout: { + flex: 1, + flexDirection: "row", }, - sectionTitle: { - fontSize: 24, - paddingHorizontal: 24, - fontWeight: '600', - color: Colors.black, - }, - sectionDescription: { - marginTop: 8, - fontSize: 18, - paddingHorizontal: 24, - fontWeight: '400', - color: Colors.dark, - } }); export default App; diff --git a/index.js b/index.js index a850d03..7eb0ad0 100644 --- a/index.js +++ b/index.js @@ -6,4 +6,8 @@ import {AppRegistry} from 'react-native'; import App from './App'; import {name as appName} from './app.json'; +import NotesMainPanel from './src/NotesMainPanel'; +import UserAccountPanel from './src/UserAccountPanel'; +import ApplicationSettingsPanel from './src/ApplicationSettingsPanel'; + AppRegistry.registerComponent(appName, () => App); diff --git a/src/ApplicationSettingsPanel.js b/src/ApplicationSettingsPanel.js new file mode 100644 index 0000000..f2e932f --- /dev/null +++ b/src/ApplicationSettingsPanel.js @@ -0,0 +1,68 @@ +/** + * @format + * @flow strict-local + */ +import React from 'react'; +import { + AppRegistry, + StyleSheet, + Text, + TouchableHighlight, + View, +} from 'react-native'; + + +class ApplicationSettingsPanel extends React.Component { + constructor(props) { + super(props); + this.state = { + shouldExpand: true + }; + } + + OnResizeButtonPressed = () => { + this.setState( (state) => ({ shouldExpand: state.shouldExpand ? false : true})); + }; + + render() { + return( + + + + Resize + + + + LeftOptionsPanel + + + ); + } +}; + + +const styles = StyleSheet.create({ + panelModeButton: { + margin: 10, + backgroundColor: "grey", + }, + panelContent: { + flex: 1, + flexDirection: "column", + }, + panel: { + width: "20%", + borderWidth: 1, + borderColor: "black", + }, + panelShrinked: { + width: 50, + borderWidth: 1, + borderColor: "black", + } +}); + + +AppRegistry.registerComponent("ApplicationSettingsPanel", () => ApplicationSettingsPanel); + +export default ApplicationSettingsPanel; diff --git a/src/NotesMainPanel.js b/src/NotesMainPanel.js new file mode 100644 index 0000000..12b3cf0 --- /dev/null +++ b/src/NotesMainPanel.js @@ -0,0 +1,33 @@ +/** + * @format + * @flow strict-local + */ + +import React from 'react'; +import { + AppRegistry, + StyleSheet, + Text, + View, +} from 'react-native'; + + +class NotesMainPanel extends React.Component { + + render() { + return( + + NotesMainPanel + + ); + } +}; + + +const styles = StyleSheet.create({ +}); + + +AppRegistry.registerComponent("NotesMainPanel", () => NotesMainPanel); + +export default NotesMainPanel; diff --git a/src/UserAccountPanel.js b/src/UserAccountPanel.js new file mode 100644 index 0000000..64706c2 --- /dev/null +++ b/src/UserAccountPanel.js @@ -0,0 +1,46 @@ +/** + * @format + * @flow strict-local + */ + +import React from 'react'; +import { + AppRegistry, + StyleSheet, + Text, + View, +} from 'react-native'; + + +class UserAccountPanel extends React.Component { + + render() { + return( + + + UserAccountPanel + This panel will have all the features of User's account. +
Further implementation will yet be done!
+
+
+ ); + } +}; + + +const styles = StyleSheet.create({ + panel: { + height: 75, + borderColor: "black", + borderWidth: 1, + }, + panelContent: { + flex: 1, + flexDirection: "column", + } +}); + + +AppRegistry.registerComponent("UserAccountPanel", () => UserAccountPanel); + +export default UserAccountPanel; diff --git a/windows/ReactNativeNotes/ApplicationSettingsPage.cpp b/windows/ReactNativeNotes/ApplicationSettingsPage.cpp new file mode 100644 index 0000000..131ac28 --- /dev/null +++ b/windows/ReactNativeNotes/ApplicationSettingsPage.cpp @@ -0,0 +1,16 @@ +#include "pch.h" +#include "ApplicationSettingsPage.h" +#include "ApplicationSettingsPage.g.cpp" + +#include "App.h" + + +namespace winrt::ReactNativeNotes::implementation +{ + ApplicationSettingsPage::ApplicationSettingsPage() + { + InitializeComponent(); + auto app = Windows::UI::Xaml::Application::Current().as(); + ReactRootView().ReactNativeHost( app->Host() ); + } +} diff --git a/windows/ReactNativeNotes/ApplicationSettingsPage.h b/windows/ReactNativeNotes/ApplicationSettingsPage.h new file mode 100644 index 0000000..75bcf96 --- /dev/null +++ b/windows/ReactNativeNotes/ApplicationSettingsPage.h @@ -0,0 +1,19 @@ +#pragma once + +#include "ApplicationSettingsPage.g.h" + +namespace winrt::ReactNativeNotes::implementation +{ + class ApplicationSettingsPage : public ApplicationSettingsPageT + { + public: + ApplicationSettingsPage(); + }; +} + +namespace winrt::ReactNativeNotes::factory_implementation +{ + class ApplicationSettingsPage : public ApplicationSettingsPageT + { + }; +} diff --git a/windows/ReactNativeNotes/ApplicationSettingsPage.idl b/windows/ReactNativeNotes/ApplicationSettingsPage.idl new file mode 100644 index 0000000..6459091 --- /dev/null +++ b/windows/ReactNativeNotes/ApplicationSettingsPage.idl @@ -0,0 +1,8 @@ +namespace ReactNativeNotes +{ + [default_interface] + runtimeclass ApplicationSettingsPage : Windows.UI.Xaml.Controls.Page + { + ApplicationSettingsPage(); + } +} diff --git a/windows/ReactNativeNotes/ApplicationSettingsPage.xaml b/windows/ReactNativeNotes/ApplicationSettingsPage.xaml new file mode 100644 index 0000000..4656fc1 --- /dev/null +++ b/windows/ReactNativeNotes/ApplicationSettingsPage.xaml @@ -0,0 +1,15 @@ + + + diff --git a/windows/ReactNativeNotes/MainPage.cpp b/windows/ReactNativeNotes/MainPage.cpp index 05f9cae..5499247 100644 --- a/windows/ReactNativeNotes/MainPage.cpp +++ b/windows/ReactNativeNotes/MainPage.cpp @@ -15,6 +15,37 @@ namespace winrt::ReactNativeNotes::implementation { InitializeComponent(); auto app = Application::Current().as(); - ReactRootView().ReactNativeHost(app->Host()); } -} + + void MainPage::TopNavigationPanel_ItemInvoked( Windows::UI::Xaml::Controls::NavigationView const& sender, Windows::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs const& args ) + { + if( args.IsSettingsInvoked() == true ) + { + Navigate( L"ApplicationSettingsPage" ); + } + else if( args.InvokedItemContainer() != nullptr ) + { + auto selectedPageTag = unbox_value_or( args.InvokedItemContainer().Tag(), L"" ); + Navigate( selectedPageTag ); + } + } + + void MainPage::TopNavigationPanel_BackRequested( Windows::UI::Xaml::Controls::NavigationView const& sender, Windows::UI::Xaml::Controls::NavigationViewBackRequestedEventArgs const& args ) + { + } + + void MainPage::Navigate( winrt::hstring pageName ) noexcept + { + auto pageToNavigateTo = Windows::UI::Xaml::Interop::TypeName + { + to_hstring( L"ReactNativeNotes." + pageName ), + Windows::UI::Xaml::Interop::TypeKind::Custom + }; + auto navigationAnimation = Windows::UI::Xaml::Media::Animation::SlideNavigationTransitionInfo(); + navigationAnimation.Effect( Windows::UI::Xaml::Media::Animation::SlideNavigationTransitionEffect::FromLeft ); + ApplicationContentFrame().Navigate( pageToNavigateTo, nullptr, navigationAnimation ); + } +} + + + diff --git a/windows/ReactNativeNotes/MainPage.h b/windows/ReactNativeNotes/MainPage.h index 7e7eed2..e8ea421 100644 --- a/windows/ReactNativeNotes/MainPage.h +++ b/windows/ReactNativeNotes/MainPage.h @@ -1,18 +1,26 @@ #pragma once #include "MainPage.g.h" #include +#include + namespace winrt::ReactNativeNotes::implementation { - struct MainPage : MainPageT + class MainPage : public MainPageT { + public: MainPage(); + void TopNavigationPanel_ItemInvoked( Windows::UI::Xaml::Controls::NavigationView const& sender, Windows::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs const& args ); + void TopNavigationPanel_BackRequested( Windows::UI::Xaml::Controls::NavigationView const& sender, Windows::UI::Xaml::Controls::NavigationViewBackRequestedEventArgs const& args ); + + private: + void Navigate( winrt::hstring pageName ) noexcept; }; } namespace winrt::ReactNativeNotes::factory_implementation { - struct MainPage : MainPageT + class MainPage : public MainPageT { }; } diff --git a/windows/ReactNativeNotes/MainPage.xaml b/windows/ReactNativeNotes/MainPage.xaml index 56e80e8..78cde15 100644 --- a/windows/ReactNativeNotes/MainPage.xaml +++ b/windows/ReactNativeNotes/MainPage.xaml @@ -7,10 +7,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - + Background="Transparent"> + + + + + + + + diff --git a/windows/ReactNativeNotes/NotesPage.cpp b/windows/ReactNativeNotes/NotesPage.cpp new file mode 100644 index 0000000..4d2778f --- /dev/null +++ b/windows/ReactNativeNotes/NotesPage.cpp @@ -0,0 +1,16 @@ +#include "pch.h" +#include "NotesPage.h" +#include "NotesPage.g.cpp" + +#include "App.h" + + +namespace winrt::ReactNativeNotes::implementation +{ + NotesPage::NotesPage() + { + InitializeComponent(); + auto app = Windows::UI::Xaml::Application::Current().as(); + ReactRootView().ReactNativeHost( app->Host() ); + } +} diff --git a/windows/ReactNativeNotes/NotesPage.h b/windows/ReactNativeNotes/NotesPage.h new file mode 100644 index 0000000..0c441f7 --- /dev/null +++ b/windows/ReactNativeNotes/NotesPage.h @@ -0,0 +1,20 @@ +#pragma once + +#include "NotesPage.g.h" +#include + +namespace winrt::ReactNativeNotes::implementation +{ + class NotesPage : public NotesPageT + { + public: + NotesPage(); + }; +} + +namespace winrt::ReactNativeNotes::factory_implementation +{ + class NotesPage : public NotesPageT + { + }; +} diff --git a/windows/ReactNativeNotes/NotesPage.idl b/windows/ReactNativeNotes/NotesPage.idl new file mode 100644 index 0000000..a5b15d7 --- /dev/null +++ b/windows/ReactNativeNotes/NotesPage.idl @@ -0,0 +1,8 @@ +namespace ReactNativeNotes +{ + [default_interface] + runtimeclass NotesPage : Windows.UI.Xaml.Controls.Page + { + NotesPage(); + } +} diff --git a/windows/ReactNativeNotes/NotesPage.xaml b/windows/ReactNativeNotes/NotesPage.xaml new file mode 100644 index 0000000..9a38813 --- /dev/null +++ b/windows/ReactNativeNotes/NotesPage.xaml @@ -0,0 +1,15 @@ + + + diff --git a/windows/ReactNativeNotes/ReactNativeNotes.vcxproj b/windows/ReactNativeNotes/ReactNativeNotes.vcxproj index 76d436c..047a83d 100644 --- a/windows/ReactNativeNotes/ReactNativeNotes.vcxproj +++ b/windows/ReactNativeNotes/ReactNativeNotes.vcxproj @@ -14,7 +14,7 @@ Windows Store 10.0 10.0.18362.0 - 10.0.16299.0 + 10.0.17763.0 ReactNativeNotes_TemporaryKey.pfx 2D6D803E40573C229AE14FFCCBB1DAD20B244DC4 password @@ -71,7 +71,8 @@ false - + + @@ -108,12 +109,24 @@ MainPage.xaml Code + + NotesPage.xaml + Code + App.xaml + + UserAccountPage.xaml + Code + + + ApplicationSettingsPage.xaml + Code + @@ -139,6 +152,10 @@ MainPage.xaml Code + + NotesPage.xaml + Code + @@ -148,6 +165,14 @@ App.xaml + + UserAccountPage.xaml + Code + + + ApplicationSettingsPage.xaml + Code + @@ -157,6 +182,18 @@ MainPage.xaml Code + + NotesPage.xaml + Code + + + UserAccountPage.xaml + Code + + + ApplicationSettingsPage.xaml + Code + @@ -169,6 +206,15 @@ Designer + + Designer + + + Designer + + + Designer + @@ -193,4 +239,4 @@ - + \ No newline at end of file diff --git a/windows/ReactNativeNotes/ReactNativeNotes.vcxproj.filters b/windows/ReactNativeNotes/ReactNativeNotes.vcxproj.filters index 2aa08b7..a0dc1bc 100644 --- a/windows/ReactNativeNotes/ReactNativeNotes.vcxproj.filters +++ b/windows/ReactNativeNotes/ReactNativeNotes.vcxproj.filters @@ -59,5 +59,8 @@ + + + \ No newline at end of file diff --git a/windows/ReactNativeNotes/UserAccountPage.cpp b/windows/ReactNativeNotes/UserAccountPage.cpp new file mode 100644 index 0000000..23536ae --- /dev/null +++ b/windows/ReactNativeNotes/UserAccountPage.cpp @@ -0,0 +1,16 @@ +#include "pch.h" +#include "UserAccountPage.h" +#include "UserAccountPage.g.cpp" + +#include "App.h" + + +namespace winrt::ReactNativeNotes::implementation +{ + UserAccountPage::UserAccountPage() + { + InitializeComponent(); + auto app = Windows::UI::Xaml::Application::Current().as(); + ReactRootView().ReactNativeHost( app->Host() ); + } +} diff --git a/windows/ReactNativeNotes/UserAccountPage.h b/windows/ReactNativeNotes/UserAccountPage.h new file mode 100644 index 0000000..2cc2356 --- /dev/null +++ b/windows/ReactNativeNotes/UserAccountPage.h @@ -0,0 +1,19 @@ +#pragma once + +#include "UserAccountPage.g.h" + +namespace winrt::ReactNativeNotes::implementation +{ + class UserAccountPage : public UserAccountPageT + { + public: + UserAccountPage(); + }; +} + +namespace winrt::ReactNativeNotes::factory_implementation +{ + class UserAccountPage : public UserAccountPageT + { + }; +} diff --git a/windows/ReactNativeNotes/UserAccountPage.idl b/windows/ReactNativeNotes/UserAccountPage.idl new file mode 100644 index 0000000..196446a --- /dev/null +++ b/windows/ReactNativeNotes/UserAccountPage.idl @@ -0,0 +1,8 @@ +namespace ReactNativeNotes +{ + [default_interface] + runtimeclass UserAccountPage : Windows.UI.Xaml.Controls.Page + { + UserAccountPage(); + } +} diff --git a/windows/ReactNativeNotes/UserAccountPage.xaml b/windows/ReactNativeNotes/UserAccountPage.xaml new file mode 100644 index 0000000..0a6161b --- /dev/null +++ b/windows/ReactNativeNotes/UserAccountPage.xaml @@ -0,0 +1,15 @@ + + + diff --git a/windows/ReactNativeNotes/pch.h b/windows/ReactNativeNotes/pch.h index 13f3eec..4c800f1 100644 --- a/windows/ReactNativeNotes/pch.h +++ b/windows/ReactNativeNotes/pch.h @@ -16,6 +16,7 @@ #include #include #include +#include #include