Przeglądaj źródła

#52 Artificer template support, statusbar color in Android, and other minor changes

Alex Trofimov 4 lat temu
rodzic
commit
0901f7f76a
7 zmienionych plików z 16943 dodań i 447 usunięć
  1. 16 10
      App.js
  2. 131 4
      Icons.js
  3. 2 2
      Theme.js
  4. 3 3
      ios/Podfile.lock
  5. 4 6
      ios/una.xcodeproj/project.pbxproj
  6. 16179 2
      package-lock.json
  7. 608 420
      yarn.lock

+ 16 - 10
App.js

@@ -68,7 +68,7 @@ type Props = {};
 const BASE_URL = 'https://una.io/'; // site URL
 const MIX_LIGHT = '0'; // template styles mix for light mode
 const MIX_DARK = '0'; // template styles mix for dark mode
-const TEMPLATE = 'protean'; // template name
+const TEMPLATE = 'artificer'; // template name
 const TITLE = 'UNA.IO | Community Management System'; // homepage title
 const ONESIGNALAPPID = ''; // you can obtain one from https://onesignal.com/
 const PAYMENTS_CALLBACK = ''; // empty string means payment functionality is disabled
@@ -645,10 +645,12 @@ export default class App extends Component<Props> {
 
         return (
             <NativeBaseProvider> 
+                <StatusBar animated={true} backgroundColor={useTheme('colors.statusBar')} barStyle={useTheme('barStyle')} />
+
                 {this.state.searchbar ? (
                     <UnaToolbarSearch onSearch={this.onSearch} onSearchCancel={this.onSearchCancelMenu} />
                 ) : (
-                    <UnaToolbar loading={this.state.loading} loggedin={this.state.data.loggedin} backButtonEnabled={this.state.backButtonEnabled} onMainMenu={this.onMainMenu} onHomeMenu={this.onHomeMenu} onSearchMenu={this.onSearchMenu} onBackAndMainMenu={this.onBackAndMainMenu} onBack={this.onBack} onDrawerToggle={this.onDrawerToggle} title={this.state.status} />
+                    <UnaToolbar drawerOpen={this.state.drawerOpen} loading={this.state.loading} loggedin={this.state.data.loggedin} backButtonEnabled={this.state.backButtonEnabled} onMainMenu={this.onMainMenu} onHomeMenu={this.onHomeMenu} onSearchMenu={this.onSearchMenu} onBackAndMainMenu={this.onBackAndMainMenu} onBack={this.onBack} onDrawerToggle={this.onDrawerToggle} title={this.state.status} />
                 ) }
 
                 {this.state.videoCall && this.state.videoCallUri ? (
@@ -706,7 +708,6 @@ function UnaToolbar(o) {
 
     return (
     <View style={{borderBottomColor: useTheme('colors.toolbarBorder'), borderBottomWidth:0.5}}>
-        <StatusBar bg={useTheme('colors.statusBar')} barStyle={useTheme('barStyle')} />
         <Box safeAreaTop bg={useTheme('colors.statusBar')} />
         <HStack bg={useTheme('colors.primary')} px="1" py="1" justifyContent="space-between" alignItems="center" w="100%" style={styles.header}>
             <HStack alignItems="center">
@@ -715,21 +716,26 @@ function UnaToolbar(o) {
                     <ActivityIndicator size="small" color={useTheme('colors.activityIndicator')} style={styles.loadingIndicator} />
                 ):(
                     o.loggedin ? (
-                        (<IconButton icon={<Icons.Back size="lg" color={o.backButtonEnabled ? useTheme('colors.textOnPrimary') : useTheme('colors.textOnPrimaryDisabled')} style={styles.headerIcon} />} onPress={o.onBack} />)
-                    ) : (
-                        <IconButton icon={<Icons.Bars size="lg" color={useTheme('colors.textOnPrimary')} style={styles.headerIcon} />} onPress={o.onDrawerToggle} />
+                        <IconButton icon={<Icons.Back size="lg" color={o.backButtonEnabled ? useTheme('colors.textOnPrimary') : useTheme('colors.textOnPrimaryDisabled')} style={styles.headerIcon} />} onPress={o.onBack} />
+                    ):(
+                        <IconButton icon={o.drawerOpen ? (<Icons.Cross size="lg" color={useTheme('colors.textOnPrimary')} style={styles.headerIcon} />) : (<Icons.Bars size="lg" color={useTheme('colors.textOnPrimary')} style={styles.headerIcon} />)} onPress={o.onDrawerToggle} />
                     )
                 )}
-
-                {!o.title || TITLE == o.title || o.loading ? (
-                    <Image alt="Logo" style={styles.headerImage} source={require('./img/logo.png')} />
-                ) : (
+                
+                {!o.title || TITLE == o.title || o.loading ? (<View>
+                    {/*<Image alt="Logo" style={styles.headerImage} source={require('./img/logo.png')} />*/}
+                    <Icons.Logo size={75} />
+                </View>) : (
                     <Text color={useTheme('colors.textOnPrimary')} numberOfLines={1} ellipsizeMode="tail" style={styles.headerTitle}>{o.title}</Text>
                 )}
+
+
             </HStack>
+
             <HStack>
                 {o.loggedin && (<IconButton icon={<Icons.Search size="lg" color={useTheme('colors.textOnPrimary')} style={styles.headerIcon} />} onPress={o.onSearchMenu} />)}
             </HStack>
+
         </HStack>
     </View>
     );

+ 131 - 4
Icons.js

@@ -1,7 +1,134 @@
 
-import React from 'react';
+import * as React from 'react';
 import { Icon } from 'native-base';
-import { Path, G } from "react-native-svg";
+import Svg, {
+  Defs,
+  ClipPath,
+  Rect,
+  G,
+  LinearGradient,
+  Stop,
+  Path,
+  RadialGradient,
+} from "react-native-svg";
+
+const Logo = (o) => (
+  <Icon size={o.size} viewBox="0 0 3264 1024" style={o.style}>
+    <Path
+      d="M840.961 925.025c-10.369 8.269-10.635 24.061.983 30.457 33.884 18.652 80.294 30.953 126.4 35.03 11.27.996 20.659-8.109 20.751-19.423.18-21.96.59-48.97 1.047-79.089.425-27.979.891-58.641 1.25-90.429.182-16.128-23.798-22.051-32.398-8.407-31.718 50.318-71.697 94.907-118.033 131.861Z"
+      fill="url(#a)"
+    />
+    <Path
+      d="M181.2 100.447c10.709-8.618 10.49-25.144-1.743-31.413-36.658-18.789-83.834-31.207-126.784-35.415C41.4 32.514 32 41.623 32 52.949v170.23c0 16.097 24.036 21.932 32.6 8.302 31.362-49.915 70.847-94.211 116.6-131.034Z"
+      fill="url(#b)"
+    />
+    <Path
+      d="M512 992c265.097 0 480-214.903 480-480 0-135.453-56.107-257.802-146.347-345.074C827.875 149.733 800 163.288 800 188.019V512c0 159.058-128.942 288-288 288-76.388 0-145.831-29.74-197.38-78.273-14.417-13.573-42.62-4.071-42.62 15.73v167.256c0 14.279 7.552 27.593 20.241 34.139C358.087 972.82 432.804 992 512 992Z"
+      fill="url(#c)"
+    />
+    <Path
+      d="M709.38 302.273c14.417 13.573 42.62 4.071 42.62-15.73V119.287c0-14.279-7.552-27.593-20.242-34.139C665.913 51.18 591.196 32 512 32 246.903 32 32 246.903 32 512c0 135.453 56.106 257.802 146.347 345.074C196.125 874.267 224 860.712 224 835.981V512c0-159.058 128.942-288 288-288 76.388 0 145.831 29.74 197.38 78.273Z"
+      fill="url(#d)"
+    />
+    <Path
+      fillRule="evenodd"
+      clipRule="evenodd"
+      d="M1706.33 771.031c-58.89 34.212-111.66 34.212-140.16 34.212-.12 0-.25 0-.38-.003-.12.003-.25.003-.38.003-28.49 0-81.27 0-140.15-34.212-25.88-13.977-49.97-32.239-72.28-54.786-59.32-58.71-88.98-129.783-88.98-213.216V222.21c0-10.274 7.81-18.787 18.08-18.416 26.53.959 75.45 8.453 99.23 48.534 2.97 4.995 4.12 10.828 4.12 16.636v234.065c0 55.242 17.6 92.702 52.83 127.932 35.13 35.137 77.64 52.75 127.53 52.839 49.89-.089 92.4-17.702 127.54-52.839 35.22-35.23 47-70.882 52.83-127.932 5.26-53.878 5.69-126.97 1.11-221.449-.42-8.485 9.23-13.513 15.7-8.008 118.87 101.119 104.61 229.457 104.61 229.457 0 83.433-29.66 154.506-88.98 213.216-22.31 22.547-46.4 40.809-72.27 54.786Z"
+      fill="url(#e)"
+    />
+    <Path
+      fillRule="evenodd"
+      clipRule="evenodd"
+      d="M2123.11 242.93c58.88-34.211 111.66-34.211 140.15-34.211h.76c28.5 0 81.27 0 140.16 34.211 25.87 13.978 49.96 32.239 72.27 54.784 59.33 58.711 88.99 129.784 88.99 213.216v280.82c0 10.273-7.81 18.786-18.08 18.415-26.54-.959-75.46-8.451-99.24-48.532-2.96-4.995-4.11-10.829-4.11-16.636V510.93c0-59.212-17.61-92.702-52.83-127.931-35.14-35.137-77.65-52.75-127.54-52.839-49.89.089-92.4 17.702-127.53 52.839-35.22 35.229-52.83 67.846-52.83 127.931v222.878c0 8.242-9.4 12.833-15.7 7.52-120.07-101.261-105.73-230.398-105.73-230.398 0-83.432 29.66-154.505 88.99-213.216 22.3-22.545 46.39-40.806 72.27-54.784Z"
+      fill="url(#f)"
+    />
+    <Path
+      fillRule="evenodd"
+      clipRule="evenodd"
+      d="M3263.25 501.331c.4 3.024.63 6.222.63 9.601v280.819c0 10.273-7.81 18.786-18.08 18.415-28.18-1.019-81.6-9.406-103.35-56.354.03-.681.06-1.361.11-2.041-50.37 37.764-112.94 60.137-180.74 60.137-166.54 0-301.54-135.029-301.54-301.596 0-166.565 135-301.593 301.54-301.593 163.54 0 296.69 130.201 301.43 292.612ZM2961.82 689.95c99.2 0 179.63-80.425 179.63-179.638 0-99.211-80.43-179.637-179.63-179.637-99.17 0-179.6 80.426-179.6 179.637 0 99.213 80.43 179.638 179.6 179.638Z"
+      fill="url(#g)"
+    />
+    <Defs>
+      <RadialGradient
+        id="a"
+        cx={0}
+        cy={0}
+        r={1}
+        gradientUnits="userSpaceOnUse"
+        gradientTransform="matrix(0 260 -165.059 0 992 732)"
+      >
+        <Stop stopColor="#FB923C" />
+        <Stop offset={1} stopColor="#EF4444" />
+      </RadialGradient>
+      <RadialGradient
+        id="b"
+        cx={0}
+        cy={0}
+        r={1}
+        gradientUnits="userSpaceOnUse"
+        gradientTransform="matrix(0 -260 171.858 0 32 291.999)"
+      >
+        <Stop stopColor="#0EA5E9" />
+        <Stop offset={1} stopColor="#38BDF8" />
+      </RadialGradient>
+      <RadialGradient
+        id="c"
+        cx={0}
+        cy={0}
+        r={1}
+        gradientUnits="userSpaceOnUse"
+        gradientTransform="matrix(0 864 -719.971 0 632 128)"
+      >
+        <Stop stopColor="#38BDF8" />
+        <Stop offset={1} stopColor="#0284C7" />
+      </RadialGradient>
+      <RadialGradient
+        id="d"
+        cx={0}
+        cy={0}
+        r={1}
+        gradientUnits="userSpaceOnUse"
+        gradientTransform="matrix(0 864 -719.971 0 525.5 32)"
+      >
+        <Stop stopColor="#34D399" />
+        <Stop offset={1} stopColor="#059669" />
+      </RadialGradient>
+      <LinearGradient
+        id="e"
+        x1={1566.06}
+        y1={203.675}
+        x2={1566.06}
+        y2={805.243}
+        gradientUnits="userSpaceOnUse"
+      >
+        <Stop stopColor="#F59E0B" />
+        <Stop offset={1} stopColor="#F97316" />
+      </LinearGradient>
+      <LinearGradient
+        id="f"
+        x1={2263.38}
+        y1={208.719}
+        x2={2263.38}
+        y2={810.284}
+        gradientUnits="userSpaceOnUse"
+      >
+        <Stop stopColor="#F59E0B" />
+        <Stop offset={1} stopColor="#F97316" />
+      </LinearGradient>
+      <LinearGradient
+        id="g"
+        x1={2962.08}
+        y1={208.719}
+        x2={2962.08}
+        y2={811.908}
+        gradientUnits="userSpaceOnUse"
+      >
+        <Stop stopColor="#F59E0B" />
+        <Stop offset={1} stopColor="#F97316" />
+      </LinearGradient>
+    </Defs>
+  </Icon>
+);
 
 function Home(o) {
     return (
@@ -106,7 +233,7 @@ function Cross(o) {
 function In(o) {
     return (
         <Icon size={o.size} viewBox="0 0 24 24" style={o.style}>
-            <G fill="none" stroke-width="1.5" stroke={o.color} className="w-6 h-6">
+            <G fill="none" strokeWidth={1.5} stroke={o.color} className="w-6 h-6">
                 <Path stroke-linecap="round" stroke-linejoin="round" d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9" />
             </G>
         </Icon>
@@ -133,4 +260,4 @@ function Question(o) {
     );
 }
 
-export {Home, Apps, Bell, Plus, Chat, User, Bars, Search, Back, Cross, In, PlusCircle, Question};
+export {Logo, Home, Apps, Bell, Plus, Chat, User, Bars, Search, Back, Cross, In, PlusCircle, Question};

+ 2 - 2
Theme.js

@@ -13,7 +13,7 @@ const themeDark = {
         drawerBackground: '#F3F4F6',
         drawerText: '#1890ff',
         drawerBorder: '#475569',
-        statusBar: '#000000',
+        statusBar: '#000',
         activityIndicator: '#e2e8f0',
         searchInputBackground: '#000000',
         searchInputBorder: '#475569',
@@ -32,7 +32,7 @@ const themeLight = {
         drawerBackground: '#F3F4F6',
         drawerText: '#1890ff',
         drawerBorder: '#cbd5e1',
-        statusBar: '#fff',
+        statusBar: '#eee',
         activityIndicator: '#334155',
         searchInputBackground: '#F7F9FC',
         searchInputBorder: '#cbd5e1',

+ 3 - 3
ios/Podfile.lock

@@ -510,10 +510,10 @@ SPEC CHECKSUMS:
   React-jsi: 67747b9722f6dab2ffe15b011bcf6b3f2c3f1427
   React-jsiexecutor: 80c46bd381fd06e418e0d4f53672dc1d1945c4c3
   React-jsinspector: cc614ec18a9ca96fd275100c16d74d62ee11f0ae
-  react-native-onesignal: a4a08bf22290f739df33acf1f45f7a7f9850273b
-  react-native-safe-area-context: e471852c5ed67eea4b10c5d9d43c1cebae3b231d
+  react-native-onesignal: e1f82b98767a9014d2c46f395b083330cfa29cea
+  react-native-safe-area-context: f0906bf8bc9835ac9a9d3f97e8bde2a997d8da79
   react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457
-  react-native-webview: a192040320142d8f10d652a745c46e4f43e37f8c
+  react-native-webview: d33e2db8925d090871ffeb232dfa50cb3a727581
   React-perflogger: 25373e382fed75ce768a443822f07098a15ab737
   React-RCTActionSheet: af7796ba49ffe4ca92e7277a5d992d37203f7da5
   React-RCTAnimation: 6a2e76ab50c6f25b428d81b76a5a45351c4d77aa

+ 4 - 6
ios/una.xcodeproj/project.pbxproj

@@ -608,11 +608,10 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 5B859AAFBC5709131A52C2DF /* Pods-una.debug.xcconfig */;
 			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = una/una.entitlements;
-				CURRENT_PROJECT_VERSION = 2000;
+				CURRENT_PROJECT_VERSION = 2001;
 				DEVELOPMENT_TEAM = 235MTP3MJ2;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = una/Info.plist;
@@ -643,11 +642,10 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = BC773EE98A50F87246B0D807 /* Pods-una.release.xcconfig */;
 			buildSettings = {
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = una/una.entitlements;
-				CURRENT_PROJECT_VERSION = 2000;
+				CURRENT_PROJECT_VERSION = 2001;
 				DEVELOPMENT_TEAM = 235MTP3MJ2;
 				INFOPLIST_FILE = una/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
@@ -705,7 +703,7 @@
 				COPY_PHASE_STRIP = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
-				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_NO_COMMON_BLOCKS = YES;
@@ -770,7 +768,7 @@
 				COPY_PHASE_STRIP = YES;
 				ENABLE_NS_ASSERTIONS = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
-				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;

Plik diff jest za duży
+ 16179 - 2
package-lock.json


Plik diff jest za duży
+ 608 - 420
yarn.lock


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików