add file

parent 2d4e0941
/* eslint-disable prettier/prettier */
export const fonts = {
beProLight: 'BeVietnamPro-Light',
beProBlack: 'BeVietnamPro-Black',
beProBlackItalic: 'BeVietnamPro-BlackItalic',
beProBold: 'BeVietnamPro-Bold',
beProBoldItalic: 'BeVietnamPro-BoldItalic',
beProExtraBold: 'BeVietnamPro-ExtraBold',
beProExtraBoldItalic: 'BeVietnamPro-ExtraBoldItalic',
beProExtraLight: 'BeVietnamPro-ExtraLight',
beProExtraLightItalic: 'BeVietnamPro-ExtraLightItalic',
beProItalic: 'BeVietnamPro-Italic',
beProLightItalic: 'BeVietnamPro-LightItalic',
beProMedium: 'BeVietnamPro-Medium',
beProMediumItalic: 'BeVietnamPro-MediumItalic',
beProRegular: 'BeVietnamPro-Regular',
beProSemiBold: 'BeVietnamPro-SemiBold',
beProSemiBoldItalic: 'BeVietnamPro-SemiBoldItalic',
beProThin: 'BeVietnamPro-Thin',
beProThinItalic: 'BeVietnamPro-ThinItalic'
}
\ No newline at end of file
{
"migIndex": 1,
"data": [
{
"path": "src/assets/fonts/BeVietnamPro-Black.ttf",
"sha1": "405a6e7828f292099161bf5cccb5402ec19f1833"
},
{
"path": "src/assets/fonts/BeVietnamPro-BlackItalic.ttf",
"sha1": "cffbcaeae7ec6a4baabdcdd02227beddfaa49d5e"
},
{
"path": "src/assets/fonts/BeVietnamPro-Bold.ttf",
"sha1": "0bd7e256f73efd0a8135c5090d62f150107ff37a"
},
{
"path": "src/assets/fonts/BeVietnamPro-BoldItalic.ttf",
"sha1": "1a5d8555a995733597d706fe3d02a38aa48dcc44"
},
{
"path": "src/assets/fonts/BeVietnamPro-ExtraBold.ttf",
"sha1": "18efb439fa36b6da24cf550de93a94c92cbe8d71"
},
{
"path": "src/assets/fonts/BeVietnamPro-ExtraBoldItalic.ttf",
"sha1": "33ae2a753d95b035cf7534a9af614fde3de2bdc0"
},
{
"path": "src/assets/fonts/BeVietnamPro-ExtraLight.ttf",
"sha1": "2487b745e3b46baa3c249062a48b79efeb48d314"
},
{
"path": "src/assets/fonts/BeVietnamPro-ExtraLightItalic.ttf",
"sha1": "2b61bfae7dc344b368c1a4c95c25f0b2e65ac415"
},
{
"path": "src/assets/fonts/BeVietnamPro-Italic.ttf",
"sha1": "cd74c031ed87c52f81b12e1886133283f36cc44a"
},
{
"path": "src/assets/fonts/BeVietnamPro-Light.ttf",
"sha1": "4c7d4497bc6b506d9fefdc8227418bbb637bc524"
},
{
"path": "src/assets/fonts/BeVietnamPro-LightItalic.ttf",
"sha1": "e6985b646a67ed2885e15c3f5b23dab28246621b"
},
{
"path": "src/assets/fonts/BeVietnamPro-Medium.ttf",
"sha1": "7525dd63d853386f3c192fa78502e547ea620e96"
},
{
"path": "src/assets/fonts/BeVietnamPro-MediumItalic.ttf",
"sha1": "b1d0a7a04e0b02414e50a69d8c7c952e42abea20"
},
{
"path": "src/assets/fonts/BeVietnamPro-Regular.ttf",
"sha1": "03d9e7cd56b446b0585b36a46c3f4b140c6e0026"
},
{
"path": "src/assets/fonts/BeVietnamPro-SemiBold.ttf",
"sha1": "1b8668d1e0f6949d9a702c2a590971ab7946a79f"
},
{
"path": "src/assets/fonts/BeVietnamPro-SemiBoldItalic.ttf",
"sha1": "6d432d0456dfc9f59a091444b5aae82f35c3df2d"
},
{
"path": "src/assets/fonts/BeVietnamPro-Thin.ttf",
"sha1": "629a4d348ac61e1ddabafc63683296ca7e1bfbe5"
},
{
"path": "src/assets/fonts/BeVietnamPro-ThinItalic.ttf",
"sha1": "6d7cc87fe54c683c66d0a791d82c4a10561488b8"
},
{
"path": "src/assets/fonts/fonts.js",
"sha1": "1a48e89032f6926794526e3977050a10666bb856"
}
]
}
......@@ -14,6 +14,25 @@
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
7699B88040F8A987B510C191 /* libPods-anawork_mobile-anawork_mobileTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-anawork_mobile-anawork_mobileTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
8D8D8E98232848DC9E781EDE /* BeVietnamPro-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 02B1E011AE6B4D14B306DA14 /* BeVietnamPro-Black.ttf */; };
7BE32F5E127A4D19A0CDD447 /* BeVietnamPro-BlackItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3B0DEDE977C74AF8AC667C97 /* BeVietnamPro-BlackItalic.ttf */; };
F4227C3FEBEF4EB78BE1AC03 /* BeVietnamPro-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2C3156CF89394755BCFCE7C6 /* BeVietnamPro-Bold.ttf */; };
E4800A1385FC49CEBE54DD11 /* BeVietnamPro-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9997401551DF4D8BA7FB30F9 /* BeVietnamPro-BoldItalic.ttf */; };
CA0DB44AD97B45B580DEB676 /* BeVietnamPro-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F8E3570AF82C44E394EEF6BC /* BeVietnamPro-ExtraBold.ttf */; };
0EB054D8F34B4DF998390FA8 /* BeVietnamPro-ExtraBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9574191E39914378A99F1553 /* BeVietnamPro-ExtraBoldItalic.ttf */; };
563C7BBB847B453C97F1512B /* BeVietnamPro-ExtraLight.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 063A4A389C264A819058DADB /* BeVietnamPro-ExtraLight.ttf */; };
439CB79E381345A9924D588C /* BeVietnamPro-ExtraLightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EEF7326F2094111B3C4154D /* BeVietnamPro-ExtraLightItalic.ttf */; };
91B0D35672B744F289AD3B49 /* BeVietnamPro-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 84DB6B512355491F93C89C1A /* BeVietnamPro-Italic.ttf */; };
BFE6266A84B64ED985E63096 /* BeVietnamPro-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 27AE9C9AFFF2480F882C24AD /* BeVietnamPro-Light.ttf */; };
727E9E77C99C488492A7B701 /* BeVietnamPro-LightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 57B75D149D7A4383B59E97AA /* BeVietnamPro-LightItalic.ttf */; };
BEA1C63716E04F2FA18234BA /* BeVietnamPro-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 89C01356E3FB4432AF1D0B76 /* BeVietnamPro-Medium.ttf */; };
11339524CD874F67BDD96AD3 /* BeVietnamPro-MediumItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E378B0E021CB4CB0B147B8D1 /* BeVietnamPro-MediumItalic.ttf */; };
882004486739444B8467EB6E /* BeVietnamPro-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4560DB0449894D739E2D4B5C /* BeVietnamPro-Regular.ttf */; };
D48E14AD2925454FA5769F94 /* BeVietnamPro-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 72B7765092DC4916AE1F3089 /* BeVietnamPro-SemiBold.ttf */; };
31106FCA23CB4612B3CD13B9 /* BeVietnamPro-SemiBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D45932D4A1314878BBDC9772 /* BeVietnamPro-SemiBoldItalic.ttf */; };
A05F85075E98497689D83FE7 /* BeVietnamPro-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5D72206A13D94A5EB893BB34 /* BeVietnamPro-Thin.ttf */; };
359F3A3490BA4EC8A4177EC9 /* BeVietnamPro-ThinItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DD87D9DDC7AF43FF90D34599 /* BeVietnamPro-ThinItalic.ttf */; };
79D62566F8E742C1A4DC4A64 /* fonts.js in Resources */ = {isa = PBXBuildFile; fileRef = A35441FD4C464536B4C5F875 /* fonts.js */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -45,6 +64,25 @@
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = anawork_mobile/LaunchScreen.storyboard; sourceTree = "<group>"; };
89C6BE57DB24E9ADA2F236DE /* Pods-anawork_mobile-anawork_mobileTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-anawork_mobile-anawork_mobileTests.release.xcconfig"; path = "Target Support Files/Pods-anawork_mobile-anawork_mobileTests/Pods-anawork_mobile-anawork_mobileTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
02B1E011AE6B4D14B306DA14 /* BeVietnamPro-Black.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-Black.ttf"; path = "../src/assets/fonts/BeVietnamPro-Black.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
3B0DEDE977C74AF8AC667C97 /* BeVietnamPro-BlackItalic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-BlackItalic.ttf"; path = "../src/assets/fonts/BeVietnamPro-BlackItalic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
2C3156CF89394755BCFCE7C6 /* BeVietnamPro-Bold.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-Bold.ttf"; path = "../src/assets/fonts/BeVietnamPro-Bold.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
9997401551DF4D8BA7FB30F9 /* BeVietnamPro-BoldItalic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-BoldItalic.ttf"; path = "../src/assets/fonts/BeVietnamPro-BoldItalic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
F8E3570AF82C44E394EEF6BC /* BeVietnamPro-ExtraBold.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-ExtraBold.ttf"; path = "../src/assets/fonts/BeVietnamPro-ExtraBold.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
9574191E39914378A99F1553 /* BeVietnamPro-ExtraBoldItalic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-ExtraBoldItalic.ttf"; path = "../src/assets/fonts/BeVietnamPro-ExtraBoldItalic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
063A4A389C264A819058DADB /* BeVietnamPro-ExtraLight.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-ExtraLight.ttf"; path = "../src/assets/fonts/BeVietnamPro-ExtraLight.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
1EEF7326F2094111B3C4154D /* BeVietnamPro-ExtraLightItalic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-ExtraLightItalic.ttf"; path = "../src/assets/fonts/BeVietnamPro-ExtraLightItalic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
84DB6B512355491F93C89C1A /* BeVietnamPro-Italic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-Italic.ttf"; path = "../src/assets/fonts/BeVietnamPro-Italic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
27AE9C9AFFF2480F882C24AD /* BeVietnamPro-Light.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-Light.ttf"; path = "../src/assets/fonts/BeVietnamPro-Light.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
57B75D149D7A4383B59E97AA /* BeVietnamPro-LightItalic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-LightItalic.ttf"; path = "../src/assets/fonts/BeVietnamPro-LightItalic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
89C01356E3FB4432AF1D0B76 /* BeVietnamPro-Medium.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-Medium.ttf"; path = "../src/assets/fonts/BeVietnamPro-Medium.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
E378B0E021CB4CB0B147B8D1 /* BeVietnamPro-MediumItalic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-MediumItalic.ttf"; path = "../src/assets/fonts/BeVietnamPro-MediumItalic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
4560DB0449894D739E2D4B5C /* BeVietnamPro-Regular.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-Regular.ttf"; path = "../src/assets/fonts/BeVietnamPro-Regular.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
72B7765092DC4916AE1F3089 /* BeVietnamPro-SemiBold.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-SemiBold.ttf"; path = "../src/assets/fonts/BeVietnamPro-SemiBold.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
D45932D4A1314878BBDC9772 /* BeVietnamPro-SemiBoldItalic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-SemiBoldItalic.ttf"; path = "../src/assets/fonts/BeVietnamPro-SemiBoldItalic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
5D72206A13D94A5EB893BB34 /* BeVietnamPro-Thin.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-Thin.ttf"; path = "../src/assets/fonts/BeVietnamPro-Thin.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
DD87D9DDC7AF43FF90D34599 /* BeVietnamPro-ThinItalic.ttf */ = {isa = PBXFileReference; name = "BeVietnamPro-ThinItalic.ttf"; path = "../src/assets/fonts/BeVietnamPro-ThinItalic.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
A35441FD4C464536B4C5F875 /* fonts.js */ = {isa = PBXFileReference; name = "fonts.js"; path = "../src/assets/fonts/fonts.js"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -124,6 +162,7 @@
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
BBD78D7AC51CEA395F1C20DB /* Pods */,
22B1A81D15E8436489474196 /* Resources */,
);
indentWidth = 2;
sourceTree = "<group>";
......@@ -150,6 +189,33 @@
path = Pods;
sourceTree = "<group>";
};
22B1A81D15E8436489474196 /* Resources */ = {
isa = "PBXGroup";
children = (
02B1E011AE6B4D14B306DA14 /* BeVietnamPro-Black.ttf */,
3B0DEDE977C74AF8AC667C97 /* BeVietnamPro-BlackItalic.ttf */,
2C3156CF89394755BCFCE7C6 /* BeVietnamPro-Bold.ttf */,
9997401551DF4D8BA7FB30F9 /* BeVietnamPro-BoldItalic.ttf */,
F8E3570AF82C44E394EEF6BC /* BeVietnamPro-ExtraBold.ttf */,
9574191E39914378A99F1553 /* BeVietnamPro-ExtraBoldItalic.ttf */,
063A4A389C264A819058DADB /* BeVietnamPro-ExtraLight.ttf */,
1EEF7326F2094111B3C4154D /* BeVietnamPro-ExtraLightItalic.ttf */,
84DB6B512355491F93C89C1A /* BeVietnamPro-Italic.ttf */,
27AE9C9AFFF2480F882C24AD /* BeVietnamPro-Light.ttf */,
57B75D149D7A4383B59E97AA /* BeVietnamPro-LightItalic.ttf */,
89C01356E3FB4432AF1D0B76 /* BeVietnamPro-Medium.ttf */,
E378B0E021CB4CB0B147B8D1 /* BeVietnamPro-MediumItalic.ttf */,
4560DB0449894D739E2D4B5C /* BeVietnamPro-Regular.ttf */,
72B7765092DC4916AE1F3089 /* BeVietnamPro-SemiBold.ttf */,
D45932D4A1314878BBDC9772 /* BeVietnamPro-SemiBoldItalic.ttf */,
5D72206A13D94A5EB893BB34 /* BeVietnamPro-Thin.ttf */,
DD87D9DDC7AF43FF90D34599 /* BeVietnamPro-ThinItalic.ttf */,
A35441FD4C464536B4C5F875 /* fonts.js */,
);
name = Resources;
sourceTree = "<group>";
path = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -245,6 +311,25 @@
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
8D8D8E98232848DC9E781EDE /* BeVietnamPro-Black.ttf in Resources */,
7BE32F5E127A4D19A0CDD447 /* BeVietnamPro-BlackItalic.ttf in Resources */,
F4227C3FEBEF4EB78BE1AC03 /* BeVietnamPro-Bold.ttf in Resources */,
E4800A1385FC49CEBE54DD11 /* BeVietnamPro-BoldItalic.ttf in Resources */,
CA0DB44AD97B45B580DEB676 /* BeVietnamPro-ExtraBold.ttf in Resources */,
0EB054D8F34B4DF998390FA8 /* BeVietnamPro-ExtraBoldItalic.ttf in Resources */,
563C7BBB847B453C97F1512B /* BeVietnamPro-ExtraLight.ttf in Resources */,
439CB79E381345A9924D588C /* BeVietnamPro-ExtraLightItalic.ttf in Resources */,
91B0D35672B744F289AD3B49 /* BeVietnamPro-Italic.ttf in Resources */,
BFE6266A84B64ED985E63096 /* BeVietnamPro-Light.ttf in Resources */,
727E9E77C99C488492A7B701 /* BeVietnamPro-LightItalic.ttf in Resources */,
BEA1C63716E04F2FA18234BA /* BeVietnamPro-Medium.ttf in Resources */,
11339524CD874F67BDD96AD3 /* BeVietnamPro-MediumItalic.ttf in Resources */,
882004486739444B8467EB6E /* BeVietnamPro-Regular.ttf in Resources */,
D48E14AD2925454FA5769F94 /* BeVietnamPro-SemiBold.ttf in Resources */,
31106FCA23CB4612B3CD13B9 /* BeVietnamPro-SemiBoldItalic.ttf in Resources */,
A05F85075E98497689D83FE7 /* BeVietnamPro-Thin.ttf in Resources */,
359F3A3490BA4EC8A4177EC9 /* BeVietnamPro-ThinItalic.ttf in Resources */,
79D62566F8E742C1A4DC4A64 /* fonts.js in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -26,14 +26,13 @@
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<string/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
......@@ -48,5 +47,26 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIAppFonts</key>
<array>
<string>BeVietnamPro-Black.ttf</string>
<string>BeVietnamPro-BlackItalic.ttf</string>
<string>BeVietnamPro-Bold.ttf</string>
<string>BeVietnamPro-BoldItalic.ttf</string>
<string>BeVietnamPro-ExtraBold.ttf</string>
<string>BeVietnamPro-ExtraBoldItalic.ttf</string>
<string>BeVietnamPro-ExtraLight.ttf</string>
<string>BeVietnamPro-ExtraLightItalic.ttf</string>
<string>BeVietnamPro-Italic.ttf</string>
<string>BeVietnamPro-Light.ttf</string>
<string>BeVietnamPro-LightItalic.ttf</string>
<string>BeVietnamPro-Medium.ttf</string>
<string>BeVietnamPro-MediumItalic.ttf</string>
<string>BeVietnamPro-Regular.ttf</string>
<string>BeVietnamPro-SemiBold.ttf</string>
<string>BeVietnamPro-SemiBoldItalic.ttf</string>
<string>BeVietnamPro-Thin.ttf</string>
<string>BeVietnamPro-ThinItalic.ttf</string>
</array>
</dict>
</plist>
{
"migIndex": 1,
"data": [
{
"path": "src/assets/fonts/BeVietnamPro-Black.ttf",
"sha1": "405a6e7828f292099161bf5cccb5402ec19f1833"
},
{
"path": "src/assets/fonts/BeVietnamPro-BlackItalic.ttf",
"sha1": "cffbcaeae7ec6a4baabdcdd02227beddfaa49d5e"
},
{
"path": "src/assets/fonts/BeVietnamPro-Bold.ttf",
"sha1": "0bd7e256f73efd0a8135c5090d62f150107ff37a"
},
{
"path": "src/assets/fonts/BeVietnamPro-BoldItalic.ttf",
"sha1": "1a5d8555a995733597d706fe3d02a38aa48dcc44"
},
{
"path": "src/assets/fonts/BeVietnamPro-ExtraBold.ttf",
"sha1": "18efb439fa36b6da24cf550de93a94c92cbe8d71"
},
{
"path": "src/assets/fonts/BeVietnamPro-ExtraBoldItalic.ttf",
"sha1": "33ae2a753d95b035cf7534a9af614fde3de2bdc0"
},
{
"path": "src/assets/fonts/BeVietnamPro-ExtraLight.ttf",
"sha1": "2487b745e3b46baa3c249062a48b79efeb48d314"
},
{
"path": "src/assets/fonts/BeVietnamPro-ExtraLightItalic.ttf",
"sha1": "2b61bfae7dc344b368c1a4c95c25f0b2e65ac415"
},
{
"path": "src/assets/fonts/BeVietnamPro-Italic.ttf",
"sha1": "cd74c031ed87c52f81b12e1886133283f36cc44a"
},
{
"path": "src/assets/fonts/BeVietnamPro-Light.ttf",
"sha1": "4c7d4497bc6b506d9fefdc8227418bbb637bc524"
},
{
"path": "src/assets/fonts/BeVietnamPro-LightItalic.ttf",
"sha1": "e6985b646a67ed2885e15c3f5b23dab28246621b"
},
{
"path": "src/assets/fonts/BeVietnamPro-Medium.ttf",
"sha1": "7525dd63d853386f3c192fa78502e547ea620e96"
},
{
"path": "src/assets/fonts/BeVietnamPro-MediumItalic.ttf",
"sha1": "b1d0a7a04e0b02414e50a69d8c7c952e42abea20"
},
{
"path": "src/assets/fonts/BeVietnamPro-Regular.ttf",
"sha1": "03d9e7cd56b446b0585b36a46c3f4b140c6e0026"
},
{
"path": "src/assets/fonts/BeVietnamPro-SemiBold.ttf",
"sha1": "1b8668d1e0f6949d9a702c2a590971ab7946a79f"
},
{
"path": "src/assets/fonts/BeVietnamPro-SemiBoldItalic.ttf",
"sha1": "6d432d0456dfc9f59a091444b5aae82f35c3df2d"
},
{
"path": "src/assets/fonts/BeVietnamPro-Thin.ttf",
"sha1": "629a4d348ac61e1ddabafc63683296ca7e1bfbe5"
},
{
"path": "src/assets/fonts/BeVietnamPro-ThinItalic.ttf",
"sha1": "6d7cc87fe54c683c66d0a791d82c4a10561488b8"
},
{
"path": "src/assets/fonts/fonts.js",
"sha1": "1a48e89032f6926794526e3977050a10666bb856"
}
]
}
/* eslint-disable prettier/prettier */
module.exports = {
assets: ['./src/assets/fonts'],
};
\ No newline at end of file
import React, {useState} from 'react';
import AppNavigation from './navigation/AppNavigation';
import React, { useState, useEffect } from 'react'
import AsyncStorageKeys from './utils/AsyncStorageKeys'
import AppNavigation from './navigation/AppNavigation'
function Main() {
//TODO: Check whether user is admin or normal user
const [isLogged, setIsLogged] = useState(null);
const [isLogged, setIsLogged] = useState(null)
return <AppNavigation isLogged={isLogged}></AppNavigation>;
return <AppNavigation isLogged={isLogged}></AppNavigation>
}
export default Main;
export default Main
/* eslint-disable prettier/prettier */
import axiosClient from '../network/axios';
const authAPI = {
requestConfirmOTP: ({otp, email}) =>
axiosClient.post('check-otp', {otp, email}),
requestSendMail: email =>
axiosClient.post('users/forgotPassword?username=ntdung899@gmail.com'),
requestChangePassword: payload => axiosClient.post('reset-password', payload),
requestAuthenticate: ({username, password}) => {
return axiosClient.post(
`authenticate/authenticate?username=${username}&password=${password}`,
);
},
requestLogout: ({token}) => axiosClient.post('authenticate/logout', {token}),
};
export default authAPI;
/* eslint-disable prettier/prettier */
import ApiClient from '../network/axios';
const homeAPI = {
requestGetQuotation: () => {
return ApiClient.get(`getAllQuote`);
},
requestGetRandomQuotation: () => {
return ApiClient.get(`getRandomQuotation`);
},
requestGetUsersDirectManagers: () => {
return ApiClient.get(`myDirectManagers`);
},
requestGetBirthdayUser: ({month, year}) =>
ApiClient.get(`users/statistics/birthday?year=${year}'&month=${month}`),
};
export default homeAPI;
/* eslint-disable prettier/prettier */
import {createSlice} from '@reduxjs/toolkit';
const initLoaderState = {
isLoading: false,
loadersCount: 0,
};
const loader = createSlice({
name: 'loader',
initialState: initLoaderState,
reducers: {
startLoading: state => {
state.isLoading = true;
state.loadersCount = state.loadersCount + 1;
},
finishLoading: state => {
const newCount = state.loadersCount - 1;
const stillWaitingOtherComponent = newCount !== 0;
state.isLoading = stillWaitingOtherComponent;
state.loadersCount = newCount;
},
},
});
const {actions, reducer} = loader;
export const {startLoading, finishLoading} = actions;
export default reducer;
/* eslint-disable prettier/prettier */
export const authSelector = state => state.auth;
export const homeSelector = state => state.home;
export const onLeaveSelector = state => state.onLeave;
import {finishLoading, startLoading} from './loaderSlice';
const serviceRequest = async serviceRequestProps => {
const {options, dispatch, serviceMethod, payload} = serviceRequestProps;
try {
if (!options.skipLoader) {
dispatch(startLoading());
}
const serviceRequestResponse = await serviceMethod(payload);
return serviceRequestResponse;
} catch {
} finally {
if (!options.skipLoader) {
dispatch(finishLoading());
}
}
};
export default serviceRequest;
/* eslint-disable prettier/prettier */
import {configureStore} from '@reduxjs/toolkit';
import authReducer from '../screens/authentication/authSlice';
import loaderReducer from './loaderSlice';
import homeReducer from '../screens/home/homeSlice';
import onLeaveReducer from '../screens/onleave/onLeaveSlice';
const rootReducer = {
loader: loaderReducer,
auth: authReducer,
home: homeReducer,
onLeave: onLeaveReducer,
};
const store = configureStore({
reducer: rootReducer,
middleware: getDefaultMiddleware =>
getDefaultMiddleware({
serializableCheck: false,
}),
});
export default store;
/* eslint-disable prettier/prettier */
export const fonts = {
beProLight: 'BeVietnamPro-Light',
beProBlack: 'BeVietnamPro-Black',
beProBlackItalic: 'BeVietnamPro-BlackItalic',
beProBold: 'BeVietnamPro-Bold',
beProBoldItalic: 'BeVietnamPro-BoldItalic',
beProExtraBold: 'BeVietnamPro-ExtraBold',
beProExtraBoldItalic: 'BeVietnamPro-ExtraBoldItalic',
beProExtraLight: 'BeVietnamPro-ExtraLight',
beProExtraLightItalic: 'BeVietnamPro-ExtraLightItalic',
beProItalic: 'BeVietnamPro-Italic',
beProLightItalic: 'BeVietnamPro-LightItalic',
beProMedium: 'BeVietnamPro-Medium',
beProMediumItalic: 'BeVietnamPro-MediumItalic',
beProRegular: 'BeVietnamPro-Regular',
beProSemiBold: 'BeVietnamPro-SemiBold',
beProSemiBoldItalic: 'BeVietnamPro-SemiBoldItalic',
beProThin: 'BeVietnamPro-Thin',
beProThinItalic: 'BeVietnamPro-ThinItalic'
}
\ No newline at end of file
/* eslint-disable prettier/prettier */
import React from 'react';
import {Text} from 'react-native-paper';
import {fonts} from '../../assets/fonts/fonts';
import colors from '../../values/colors';
const FONT_FAMILY = fonts.beProMedium;
const AppText = ({variant, children, style, onPress, color}) => {
const defaultStyle = {
fontFamily: FONT_FAMILY,
color: color ?? colors.textColor,
};
return (
<Text variant={variant} style={[defaultStyle, style]} onPress={onPress}>
{children}
</Text>
);
};
export default AppText;
import React, {useEffect, useState} from 'react';
import {
SafeAreaView,
TouchableOpacity,
Image,
Text,
View,
StyleSheet,
} from 'react-native';
import React from 'react';
import { Image, StyleSheet, TouchableOpacity, View } from 'react-native';
import AppText from './AppText';
export default function ButtonComponent({
text,
style,
......@@ -23,12 +17,12 @@ export default function ButtonComponent({
return (
<TouchableOpacity style={style} disabled={disable} onPress={onPress}>
{leftIcon && <Image source={leftIcon} style={styleIcon} />}
{text && <Text style={textStyle}>{text}</Text>}
{text && <AppText style={textStyle}>{text}</AppText>}
{iconSource && <Image source={iconSource} style={styleIcon} />}
{rightIcon && <Image source={rightIcon} style={styleIcon} />}
{badge && (
<View style={badgeStyle}>
<Text style={{color: 'white', fontSize: 12}}>{badge}</Text>
<AppText style={{color: 'white', fontSize: 12}}>{badge}</AppText>
</View>
)}
</TouchableOpacity>
......
import React from 'react'
/* eslint-disable prettier/prettier */
import React from 'react';
import {
Image,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
KeyboardAvoidingView
} from 'react-native'
import { HelperText } from 'react-native-paper'
import colors from '../values/colors'
import styles from '../screens/authentication/login/styles'
} from 'react-native';
import {HelperText} from 'react-native-paper';
import styles from '../screens/authentication/login/styles';
import colors from '../values/colors';
import AppText from './AppText';
const TextInputComponent = ({
placeholder,
style,
......@@ -36,25 +36,31 @@ const TextInputComponent = ({
noBorder,
autoCompleteType,
borderColor,
type
type,
}) => {
return (
<View style={stylesTextInput.container}>
{label && (
<View style={stylesTextInput.containerLabel}>
<Text
<AppText
children={`${label}`}
style={[stylesTextInput.textLabel, styleLabel]}
/>
{require && <Text children={' *'} style={{ color: colors.red }} />}
{require && <AppText children={' *'} style={{color: colors.red}} />}
</View>
)}
<View style={[noBorder ? stylesTextInput.containerAreaInputNoBorder : stylesTextInput.containerAreaInput, styleAreaInput, { borderColor: borderColor }]}>
<View
style={[
noBorder
? stylesTextInput.containerAreaInputNoBorder
: stylesTextInput.containerAreaInput,
styleAreaInput,
{borderColor: borderColor},
]}>
{leftIcon && (
<TouchableOpacity
onPress={() => {
onPressLeftIcon && onPressLeftIcon()
onPressLeftIcon && onPressLeftIcon();
}}
style={stylesTextInput.leftIcon}>
<Image source={leftIcon} style={stylesTextInput.icon} />
......@@ -74,12 +80,11 @@ const TextInputComponent = ({
onFocus={onFocus}
editable={!disable}
autoComplete={autoCompleteType}
/>
{rightIcon && (
<TouchableOpacity
onPress={() => {
onPressRightIcon && onPressRightIcon()
onPressRightIcon && onPressRightIcon();
}}>
<Image source={rightIcon} style={stylesTextInput.icon} />
</TouchableOpacity>
......@@ -89,9 +94,8 @@ const TextInputComponent = ({
{errors}
</HelperText>
</View>
)
}
);
};
const stylesTextInput = StyleSheet.create({
container: {
width: '100%',
......@@ -145,5 +149,5 @@ const stylesTextInput = StyleSheet.create({
flexDirection: 'row',
alignItems: 'center',
},
})
export default TextInputComponent
});
export default TextInputComponent;
import React, {useEffect, useState} from 'react';
import {
ImageBackground,
Image,
TouchableOpacity,
Text,
View,
} from 'react-native';
import {
DrawerContentScrollView,
DrawerItemList,
} from '@react-navigation/drawer';
import {IMAGES} from '../../values/images';
import styles from './style';
import {useDispatch, useSelector} from 'react-redux';
import {logoutApp} from '../../store/actions/CommonAction';
const CustomDrawer = props => {
const userDetails = useSelector(state => state.UserInfo.userInfo);
const dispatch = useDispatch();
const navigateToLogout = () => {
dispatch(logoutApp());
};
return (
<View style={{flex: 1}}>
<DrawerContentScrollView {...props}>
<ImageBackground style={{padding: 20}} source={IMAGES.BgProfile}>
<Image
style={styles.iconUser}
source={{uri: 'https://meu.anawork.com' + userDetails.avatar}}
/>
<Text style={styles.text}>{`${userDetails.first_name} ${
userDetails.middle_name ? userDetails.middle_name : ''
} ${userDetails.last_name}`}</Text>
</ImageBackground>
<DrawerItemList {...props} />
</DrawerContentScrollView>
<TouchableOpacity onPress={navigateToLogout} style={styles.btnLogout}>
<Image
source={IMAGES.IcLogout}
style={{width: 20, height: 20, marginRight: 10}}
/>
<Text>Đăng xut</Text>
</TouchableOpacity>
</View>
);
};
export default CustomDrawer;
import { StyleSheet, Dimensions } from 'react-native'
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
const styles = StyleSheet.create({
container: {
alignItems: 'center',
justifyContent: 'space-between',
width: width,
height: 50,
flexDirection: 'row'
},
iconUser: {
width: 80,
height: 80,
borderRadius: 40,
},
text: {
fontSize: 18,
//fontFamily: 'Roboto-medium',
color: '#fff',
fontWeight: '500'
},
btnLogout:
{
alignItems: 'center',
position: 'absolute',
bottom: 30,
left: width / 4,
flexDirection: 'row',
justifyContent: 'space-between'
}
})
export default styles
\ No newline at end of file
import React, { useEffect, useState } from 'react';
/* eslint-disable prettier/prettier */
import React, {useEffect, useState} from 'react';
import {
SafeAreaView,
ScrollView,
Image,
TouchableOpacity,
Text,
View,
ImageBackground,
SafeAreaView,
TouchableOpacity,
} from 'react-native';
import { IMAGES } from '../../values/images';
import styles from './style';
import { useDispatch, useSelector } from 'react-redux';
import {
getCompanyInfo
} from '../../store/actions/UserAction'
import {useDispatch} from 'react-redux';
import RootNavigation from '../../navigation/RootNavigation';
import { APP_NAVIGATE_SCREEN } from '../../utils/constant';
import api from '../../network/axios'
import api from '../../network/axios';
import {getCompanyInfo} from '../../store/actions/UserAction';
import {APP_NAVIGATE_SCREEN} from '../../utils/constant';
import {IMAGES} from '../../values/images';
import styles from './style';
const HeaderComponent = props => {
const dispatch = useDispatch();
const [logo, setLogo] = useState()
const userDetails = useSelector(state => state.UserInfo.userInfo);
const [logo, setLogo] = useState();
const navigateHome = () => {
RootNavigation.navigate(APP_NAVIGATE_SCREEN.HOME);
};
const getCompanyLogo = async () => {
const res = await dispatch(getCompanyInfo())
const res = await dispatch(getCompanyInfo());
if (res.success) {
const domain = api.getBaseURL();
const domain = api.getBaseURL()
const arr = domain.split('/', 3)
setLogo(`https://${arr[arr.length - 1]}${res.data.logo}`)
}
const arr = domain.split('/', 3);
setLogo(`https://${arr[arr.length - 1]}${res.data.logo}`);
}
};
useEffect(() => {
getCompanyLogo()
}, [])
getCompanyLogo();
}, []);
return (
<SafeAreaView>
<ImageBackground style={styles.container} source={IMAGES.BgHeader}>
......@@ -48,12 +44,11 @@ const HeaderComponent = props => {
</TouchableOpacity> */}
<TouchableOpacity
onPress={navigateHome}
style={{ flex: 1, alignItems: 'center' }}>
<Image source={{ uri: logo }} style={styles.iconLogo} />
style={{flex: 1, alignItems: 'center'}}>
<Image source={{uri: logo}} style={styles.iconLogo} />
</TouchableOpacity>
{
/* <View
{/* <View
style={{
flexDirection: 'row',
alignItems: 'center',
......
import React from 'react';
import {
SafeAreaView,
View,
Text,
Linking,
StyleSheet,
Dimensions,
Image,
Platform,
} from 'react-native';
import {Linking, Platform, SafeAreaView, StyleSheet} from 'react-native';
//Screen
import {IMAGES} from '../../values/images';
//Values
import string from '../../values/string';
import Alert from 'react-native-awesome-alerts';
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
function NoConnection({isShow}) {
const onOpenSetting = () => {
Platform.OS === 'ios'
......
export default {
apiEndpoint: 'https://meu.anawork.com/api/',
apiEndpoint: 'https://gateway.dev.meu-solutions.com/staginganawork/api/',
//apiEndpoint: 'https://gateway.dev.meu-solutions.com/techport/api/',
imageEndPoint: 'https://techmart.meu-solutions.com',
siteURL: 'https://saigon-business.erp.meu-solutions.com',
......
import * as React from 'react';
import {View, Text, Linking} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import * as React from 'react';
import ForgotPassword from '../screens/authentication/forgot_password/ForgotPasswordContainer';
import IntroScreen from '../screens/authentication/introduction/IntroductionContainer';
import LoginScreen from '../screens/authentication/login/LoginContainer';
import ServerScreen from '../screens/authentication/server/ServerContainer';
import SignUpScreen from '../screens/authentication/signup/SignUpContainer';
import SplashContainer from '../screens/authentication/splash/SlashContainer';
import ProfileContainer from '../screens/profile/ProfileContainer';
import ConfirmedShiftDetail from '../screens/shift/shift-tabs/ConfirmedShiftScreen/ConfirmedShiftDetail/ConfirmedShiftDetailContainer';
import ForgotPassword from '../screens/authentication/forgot_password/ForgotPasswordContainer';
import SalaryScreen from '../screens/salary/SalaryContainer';
import IntroScreen from '../screens/authentication/introduction/IntroductionContainer';
import ServerScreen from '../screens/authentication/server/ServerContainer';
import ConfirmedShiftDetail from '../screens/shift/shift-tabs/ConfirmedShiftScreen/ConfirmedShiftDetail/ConfirmedShiftDetailContainer';
import {APP_NAVIGATE_SCREEN} from '../utils/constant';
import Tabs from './DrawerNavigation';
import BottomTabs from './BottomTabNavigation';
import RootNavigation from './RootNavigation';
import HeaderComponent from '../components/header/HeaderComponent';
const {
INTRO,
......@@ -31,8 +28,8 @@ const {
SALARY,
} = APP_NAVIGATE_SCREEN;
const AppScreen = {
[SERVER]: ServerScreen,
[SPLASH]: SplashContainer,
[SERVER]: ServerScreen,
[LOGIN]: LoginScreen,
[SIGN_UP]: SignUpScreen,
[PROFILE]: ProfileContainer,
......
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import * as React from 'react';
import {useDispatch, useSelector} from 'react-redux';
import {Text, View, Image} from 'react-native';
import ShiftScreen from '../screens/shift/ShiftContainer';
import ProfileScreen from '../screens/profile/ProfileContainer';
import {Image} from 'react-native';
import {useSelector} from 'react-redux';
import {authSelector} from '../app/selectors';
import HeaderComponent from '../components/header/HeaderComponent';
import NotificationScreen from '../screens/notification/NotificationContainer';
import ProfileScreen from '../screens/profile/ProfileContainer';
import {APP_NAVIGATE_SCREEN} from '../utils/constant';
import HeaderComponent from '../components/header/HeaderComponent';
import {IMAGES, IconDrawer} from '../values/images';
import TopTabNavigation from './TopTabNavigation';
import {IconDrawer} from '../values/images';
import DayWageNavigation from './DayWageTopTabNavigation';
import TopTabNavigation from './TopTabNavigation';
const {HOME, SHIFT, PROFILE, DAY_WAGE, Notification} = APP_NAVIGATE_SCREEN;
const AppScreen = {
[HOME]: TopTabNavigation,
[Notification]: NotificationScreen,
[DAY_WAGE]: DayWageNavigation,
// [DAY_WAGE]: DayWageNavigation,
//[SHIFT]: DayWageNavigation,
[PROFILE]: ProfileScreen,
};
......@@ -30,7 +31,7 @@ const AppIcon = {
const Tab = createBottomTabNavigator();
export default function BottomNavigation() {
const userDetails = useSelector(state => state.UserInfo.userInfo);
const userDetails = useSelector(authSelector);
return (
<Tab.Navigator screenOptions={{scrollEnabled: true}}>
{Object.keys(AppScreen).map((item, index) => (
......
import * as React from 'react';
import {Text, View, Image} from 'react-native';
import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs';
import * as React from 'react';
import ShiftScreen from '../screens/shift/ShiftContainer';
import SalaryScreen from '../screens/salary/SalaryContainer';
import ShiftScreen from '../screens/shift/ShiftContainer';
import WorkLoadScreen from '../screens/workload/WorkLoadContainer';
import {APP_NAVIGATE_SCREEN} from '../utils/constant';
......
import {createDrawerNavigator} from '@react-navigation/drawer';
import * as React from 'react';
import {Image} from 'react-native';
import {createDrawerNavigator} from '@react-navigation/drawer';
import HomeScreen from '../screens/home/HomeContainer';
import ShiftScreen from '../screens/shift/ShiftContainer';
import OnLeave from '../screens/onleave/OnLeaveContainer';
import SalaryScreen from '../screens/salary/SalaryContainer';
import Overtime from '../screens/overtime/OvertimeContainer';
import HeaderComponent from '../components/header/HeaderComponent';
import ConfirmDate from '../screens/confirm_date/ConfirmDateContainer';
import HomeScreen from '../screens/home/homeContainer';
import OnLeave from '../screens/onleave/onLeaveContainer';
import Overtime from '../screens/overtime/OvertimeContainer';
import SalaryScreen from '../screens/salary/SalaryContainer';
import ShiftScreen from '../screens/shift/ShiftContainer';
import WorkLoad from '../screens/workload/WorkLoadContainer';
import {APP_NAVIGATE_SCREEN} from '../utils/constant';
import CustomDrawer from '../components/custom_drawer/CustomDrawer';
import HeaderComponent from '../components/header/HeaderComponent';
import {IMAGES, IconDrawer} from '../values/images';
import {IconDrawer} from '../values/images';
const {
HOME,
SHIFT,
......@@ -46,9 +45,7 @@ const Drawer = createDrawerNavigator();
export default function App() {
return (
<Drawer.Navigator
drawerContent={props => <CustomDrawer {...props} />}
initialRouteName={HOME}>
<Drawer.Navigator initialRouteName={HOME}>
{Object.keys(AppScreen).map((item, index) => (
<Drawer.Screen
key={index}
......
/* eslint-disable prettier/prettier */
import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs';
import * as React from 'react';
import { Text, View, Image } from 'react-native';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import HomeScreen from '../screens/home/HomeContainer'
import OnLeave from '../screens/onleave/OnLeaveContainer'
import Overtime from '../screens/overtime/OvertimeContainer'
import ConfirmDate from '../screens/confirm_date/ConfirmDateContainer'
import { APP_NAVIGATE_SCREEN } from '../utils/constant'
import HomeScreen from '../screens/home';
import OnLeave from '../screens/onleave';
import {APP_NAVIGATE_SCREEN} from '../utils/constant';
const {
ON_LEAVE,
OVERTIME,
MAIN,
CONFIRM_DATE
} = APP_NAVIGATE_SCREEN
const {ON_LEAVE, OVERTIME, MAIN, CONFIRM_DATE} = APP_NAVIGATE_SCREEN;
const AppScreen = {
[MAIN]: HomeScreen,
[ON_LEAVE]: OnLeave,
[OVERTIME]: Overtime,
[CONFIRM_DATE]: ConfirmDate
}
// [OVERTIME]: Overtime,
// [CONFIRM_DATE]: ConfirmDate,
};
const Tab = createMaterialTopTabNavigator();
export default function TopTabNavigation() {
return (
<Tab.Navigator screenOptions={{ scrollEnabled: true }}>
{
Object.keys(AppScreen).map((item, index) => (
<Tab.Screen key={index} name={item} component={AppScreen[item]}
<Tab.Navigator screenOptions={{scrollEnabled: true}}>
{Object.keys(AppScreen).map((item, index) => (
<Tab.Screen
key={index}
name={item}
component={AppScreen[item]}
options={{
tabBarActiveTintColor: '#3947e9', // tab text color
scrollEnabled: true,
upperCaseLabel: false,
tabBarLabelStyle: {
fontSize: 9
}
fontSize: 9,
},
// tabBarIcon: ({ focused, size }) => (
// <Image source={AppIcon[item]} style={{ width: 24, height: 24 }} />
// )
}}
/>
))
}
))}
</Tab.Navigator>
);
}
import AsyncStorage from '@react-native-async-storage/async-storage';
import {Alert} from 'react-native';
import RootNavigation from '../navigation/RootNavigation';
import AsyncStorageKeys from '../utils/AsyncStorageKeys';
import AsyncStorageService from '../utils/AsyncStorageService';
import {APP_NAVIGATE_SCREEN} from '../utils/constant';
import {ToastMessage} from '../utils/MessageUtil';
import api from './axios';
const createAPI = () => {
const APIInstant = require('axios').default.create();
APIInstant.defaults.baseURL = api.getBaseURL();
APIInstant.defaults.timeout = 40000;
APIInstant.defaults.headers = {'Content-Type': 'application/json'};
APIInstant.interceptors.request.use(async config => {
config.headers.Authorization =
'Bearer ' + (await AsyncStorageService.getToken()) ?? '';
return config;
}, Promise.reject);
APIInstant.interceptors.response.use(async response => {
const data = response.data;
if (data && data?.code === 401) {
ToastMessage({title: 'Notification', message: data?.message});
await AsyncStorageService.clear().then(() => {
RootNavigation.navigate(APP_NAVIGATE_SCREEN.LOGIN);
});
} else if (data && data.success === false)
// Alert.alert(' ', data.message)
console.log('data.message', data.message);
return response;
});
return APIInstant;
};
let axiosClient = createAPI();
/* Support function */
function handleResult(api) {
return api.then(res => {
return handleResponse(res.data);
});
}
function handleResponse(data) {
if (data && data.success === false) {
return Promise.reject(new Error(data?.message || 'Co loi xay ra'));
}
return Promise.resolve(data);
}
export const ApiClient = {
get: (url, payload) => handleResult(axiosClient.get(url, payload)),
post: (url, payload) => handleResult(axiosClient.post(url, payload)),
put: (url, payload) => handleResult(axiosClient.put(url, payload)),
path: (url, payload) => handleResult(axiosClient.patch(url, payload)),
delete: (url, payload) =>
handleResult(axiosClient.delete(url, {data: payload})),
};
export function refreshApiService() {
axiosClient = createAPI();
}
import {ApiClient} from '../ApiService';
import ApiClient from '../axios';
import ApiUrl from '../api/apiUrl';
export default {
requestConfirmOTP: ({otp, email}) =>
......
import {ApiClient} from '../ApiService';
import ApiClient from '../axios';
import ApiUrl from '../api/apiUrl';
export default {
requestGetMyInfo: () => ApiClient.get(ApiUrl.GET_USER_INFO),
......
/* eslint-disable prettier/prettier */
import ApiClient from '../axios';
export default {
requestGetLeavesDay: ({filter, sort, page, pageSize}) =>
ApiClient.get(
`myLeaveDays?Filters=${filter}&Sorts=${sort}&Page=${page}&PageSize=${pageSize}`,
),
requestGetRestDay: () => ApiClient.get('leaveCategories'),
};
/* eslint-disable no-dupe-keys */
import {ApiClient} from '../ApiService';
import ApiClient from '../axios';
import ApiUrl from '../api/apiUrl';
export default {
requestGetMyInfo: () => ApiClient.get(ApiUrl.GET_USER_INFO),
......
import {create} from 'apisauce';
import {Platform} from 'react-native';
/* eslint-disable prettier/prettier */
import axios from 'axios';
import Utils from '../utils';
import config from '../config';
const api = create({
const axiosClient = axios.create({
baseURL: config.apiEndpoint,
timeout: Platform.OS === 'ios' ? 6000 : 2500,
headers: {
'Content-Type': 'application/json',
},
timeout: config.axiosTimeout,
});
export default api;
axiosClient.interceptors.request.use(async configAxios => {
const auth = await Utils.getData(config.storageKey.AUTH);
if (auth.token) {
configAxios.headers.Authorization = `Bearer ${auth.token}`;
}
return configAxios;
});
axiosClient.interceptors.response.use(
response => {
console.log('response', response);
if (response?.data) {
return response.data;
}
return response;
},
error => {
throw error;
},
);
export default axiosClient;
/* eslint-disable prettier/prettier */
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit';
import serviceRequest from '../../app/serviceRequest';
import Utils from '../../utils';
import authAPI from '../../api/authAPI';
const initialState = {
banners: [],
news: [],
companyInfo: [],
};
export const authenticate = createAsyncThunk(
'auth/authenticate',
async (data, thunkAPI) => {
return serviceRequest({
dispatch: thunkAPI.dispatch,
serviceMethod: authAPI.requestAuthenticate,
payload: data,
options: {
skipLoader: false,
},
});
},
);
const authSlice = createSlice({
name: 'auth',
initialState: initialState,
reducers: {},
extraReducers: builder => {
builder.addCase(authenticate.fulfilled, (state, action) => {
const {success} = Utils.getValues(action, 'payload', false);
console.log('authenticate', action);
if (success) {
}
});
},
});
const {reducer} = authSlice;
export default reducer;
import React, { useEffect, useState } from 'react';
import {
SafeAreaView,
ScrollView,
TextInput,
Image,
Text,
View,
} from 'react-native';
import { BgIntroduce } from '../../../values/images'
import React from 'react';
import {Image, SafeAreaView, View} from 'react-native';
import AppText from '../../../components/AppText';
import ButtonComponent from '../../../components/ButtonComponent';
import TextInputComponent from '../../../components/TextInputComponent';
import styles from './style'
import {BgIntroduce} from '../../../values/images';
import styles from './style';
const ForgotPasswordScreen = ({
email,
txtResponse,
onSubmit,
goBack,
isError,
onChangeText
onChangeText,
}) => {
return (
<SafeAreaView style={{ flex: 1 }}>
<View style={{ flex: 1 }}>
<View style={{ flex: 1 }}>
<Image source={BgIntroduce.BgTop} style={[styles.bgFullWidth,]} />
<SafeAreaView style={{flex: 1}}>
<View style={{flex: 1}}>
<View style={{flex: 1}}>
<Image source={BgIntroduce.BgTop} style={[styles.bgFullWidth]} />
</View>
<View style={{ flex: 3, alignItems: 'center' }}>
<View style={{flex: 3, alignItems: 'center'}}>
<View style={styles.centerView}>
<Text style={styles.txtTitle}>Khôi phc tài khon</Text>
{txtResponse && <Text style={styles.txtResponse}> {txtResponse}</Text>}
<Text style={{ color: 'black', fontWeight: 'bold' }}>Email</Text>
<AppText style={styles.txtTitle}>Khôi phc tài khon</AppText>
{txtResponse && (
<AppText style={styles.txtResponse}> {txtResponse}</AppText>
)}
<AppText style={{color: 'black', fontWeight: 'bold'}}>
Email
</AppText>
<View>
{isError.type && < Text style={{ color: 'red', fontSize: 11 }}>{isError.text}</Text>}
{isError.type && (
<AppText style={{color: 'red', fontSize: 11}}>
{isError.text}
</AppText>
)}
<TextInputComponent
value={email}
placeholder={'Vui lòng nhập email của bạn'}
styleAreaInput={{ backgroundColor: 'white' }}
styleAreaInput={{backgroundColor: 'white'}}
autoCompleteType={'postal-address'}
keyboardType={'email'}
onChangeText={onChangeText}
/>
</View>
<ButtonComponent
style={styles.btnSendRequest}
text={"Gửi yêu cầu"}
textStyle={{ color: 'white' }}
text={'Gửi yêu cầu'}
textStyle={{color: 'white'}}
onPress={onSubmit}
/>
<ButtonComponent
style={styles.btnBack}
text={"Quay lại"}
textStyle={{ color: 'blue' }}
text={'Quay lại'}
textStyle={{color: 'blue'}}
onPress={goBack}
/>
</View>
</View>
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
<Text style={{ marginLeft: 20 }}>2022 @ MeU Solutions, Inc</Text>
<View style={{flex: 1, justifyContent: 'flex-end'}}>
<AppText style={{marginLeft: 20}}>2022 @ MeU Solutions, Inc</AppText>
<Image source={BgIntroduce.BgFtStep1} style={styles.bgFullWidth} />
</View>
</View>
</SafeAreaView >
)
</SafeAreaView>
);
};
export default ForgotPasswordScreen;
......@@ -44,8 +44,8 @@ const IntroductionContainer = props => {
}
};
const navigateToDomain = () => {
RootNavigation.navigate(APP_NAVIGATE_SCREEN.LOGIN)
}
RootNavigation.navigate(APP_NAVIGATE_SCREEN.LOGIN);
};
const introProps = {
indexSwiper,
showsPagination,
......@@ -53,7 +53,7 @@ const IntroductionContainer = props => {
nextView,
preView,
onSwiper,
navigateToDomain
navigateToDomain,
};
return <IntroScreen {...introProps} />;
};
......
import React from 'react';
import {useTranslation} from 'react-i18next';
import {
SafeAreaView,
Dimensions,
Text,
View,
Image,
SafeAreaView,
TouchableOpacity,
View,
} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import Swiper from 'react-native-swiper';
import {IMAGES, BgIntroduce} from '../../../values/images';
import colors from '../../../values/colors';
import AppText from '../../../components/AppText';
import {BgIntroduce, IMAGES} from '../../../values/images';
import string from '../../../values/string';
import styles from './styles';
import LinearGradient from 'react-native-linear-gradient';
import {useTranslation} from 'react-i18next';
const windowHeight = Dimensions.get('window').height;
......@@ -21,10 +20,8 @@ const IntroductionScreen = ({
indexSwiper,
showsPagination,
scroll,
nextView,
preView,
onSwiper,
navigateToDomain
navigateToDomain,
}) => {
const {t, i18n} = useTranslation();
return (
......@@ -65,8 +62,8 @@ const IntroductionScreen = ({
/>
{/* <Text style={styles.text}>{string.TITLE_STEP_1}</Text> */}
<Text style={styles.text}>{t('Overtime_monitoring')}</Text>
<Text style={styles.subText}>{t('Send_req_OT')}</Text>
<AppText style={styles.text}>{t('Overtime_monitoring')}</AppText>
<AppText style={styles.subText}>{t('Send_req_OT')}</AppText>
{/* <TouchableOpacity onPress={nextView} style={[styles.startedBtn, styles.centerBtn]}>
<Text style={styles.txtBtn}>{string.GET_STARTED}</Text>
</TouchableOpacity> */}
......@@ -91,8 +88,8 @@ const IntroductionScreen = ({
}}
/>
<Text style={styles.text}>{t('Manager_Leave')}</Text>
<Text style={styles.subText}>{t('Track_emp_leave')}</Text>
<AppText style={styles.text}>{t('Manager_Leave')}</AppText>
<AppText style={styles.subText}>{t('Track_emp_leave')}</AppText>
{/* <TouchableOpacity onPress={nextView} style={[styles.centerBtn, styles.noBorderBtn]} title="Next" >
<Text style={styles.textPrimary}>{string.NEXT_BUTTON}</Text>
</TouchableOpacity> */}
......@@ -113,13 +110,13 @@ const IntroductionScreen = ({
}}
/>
<Text style={styles.text}>{t('Payroll')}</Text>
<Text style={styles.subText}>{t('Ez_manager_payroll')}</Text>
<AppText style={styles.text}>{t('Payroll')}</AppText>
<AppText style={styles.subText}>{t('Ez_manager_payroll')}</AppText>
<TouchableOpacity
onPress={navigateToDomain}
style={[styles.centerBtn, styles.noBorderBtn]}
title="Next">
<Text style={styles.textPrimary}>{string.NEXT_BUTTON}</Text>
<AppText style={styles.textPrimary}>{string.NEXT_BUTTON}</AppText>
</TouchableOpacity>
</View>
</SafeAreaView>
......
/* eslint-disable prettier/prettier */
import React, {useState} from 'react';
import RootNavigation from '../../../navigation/RootNavigation';
import LoginScreen from './LoginScreen';
......@@ -5,10 +6,9 @@ import LoginScreen from './LoginScreen';
import {useTranslation} from 'react-i18next';
import OneSignal from 'react-native-onesignal';
import {useDispatch} from 'react-redux';
import AuthApi from '../../../network/api/authApi';
import {getMyInfo} from '../../../store/actions/CommonAction';
import AsyncStorageService from '../../../utils/AsyncStorageService';
import {APP_NAVIGATE_SCREEN} from '../../../utils/constant';
import {authenticate} from '../authSlice';
const LoginContainer = props => {
// console.log("props: ", props)
const dispatch = useDispatch();
......@@ -57,26 +57,23 @@ const LoginContainer = props => {
const handleLogin = async () => {
try {
setLoading(true);
// setLoading(true);
if (!handleSetAccount) return;
// const encode_Pass = await encodePass(userAccount.password);
//console.log(encodeURIComponent(userAccount.password));
const res = await AuthApi.requestLoginApp({
name: userAccount.username,
pass: encodeURIComponent(userAccount.password),
dispatch(
authenticate({
username: 'trangbui%40meu-solutions.com',
password: 'trang12345',
}),
).then(response => {
// AsyncStorageService.putToken(res.token);
// sendExternalId();
// RootNavigation.navigate(APP_NAVIGATE_SCREEN.MAIN);
// setLoading(false);
});
//console.log(res)
if (res.success) {
AsyncStorageService.putToken(res.token);
sendExternalId();
RootNavigation.navigate(APP_NAVIGATE_SCREEN.MAIN);
setLoading(false);
}
} catch (e) {
console.log('error login: ', e);
showAlertError('Hệ thống', e.toString());
setLoading(false);
// setLoading(false);
// alertMessage(e.toString())
}
};
......
import React, {useEffect, useState} from 'react';
import {
Button,
SafeAreaView,
Dimensions,
TouchableOpacity,
Text,
View,
Image,
} from 'react-native';
import Swiper from 'react-native-swiper';
import {IMAGES, BgIntroduce} from '../../../values/images';
import colors from '../../../values/colors';
import string from '../../../values/string';
import styles from './styles';
import RootNavigation from '../../../navigation/RootNavigation';
import TextInputComponent from '../../../components/TextInputComponent';
/* eslint-disable prettier/prettier */
import React from 'react';
import {useTranslation} from 'react-i18next';
import {Image, SafeAreaView, View} from 'react-native';
import Alert from 'react-native-awesome-alerts';
import AppText from '../../../components/AppText';
import ButtonComponent from '../../../components/ButtonComponent';
import LoadingProgress from '../../../components/LoadingProgress';
import TextInputComponent from '../../../components/TextInputComponent';
import RootNavigation from '../../../navigation/RootNavigation';
import {APP_NAVIGATE_SCREEN} from '../../../utils/constant';
import LinearGradient from 'react-native-linear-gradient';
import Alert from 'react-native-awesome-alerts';
import {useTranslation} from 'react-i18next';
import SelectDropdown from 'react-native-select-dropdown';
const windowHeight = Dimensions.get('window').height;
import colors from '../../../values/colors';
import {BgIntroduce, IMAGES} from '../../../values/images';
import styles from './styles';
const LoginScreen = ({
loading,
......@@ -35,7 +23,7 @@ const LoginScreen = ({
handleUserName,
handlePassword,
showAlert,
hideAlert
hideAlert,
}) => {
const {t, i18n} = useTranslation();
return (
......@@ -46,10 +34,10 @@ const LoginScreen = ({
</View>
<View style={[styles.loginContainer, {flex: 4, alignItems: 'center'}]}>
<View style={styles.viewLogin}>
<Text style={[styles.textTitleHeader, styles.textBlue]}>
<AppText style={[styles.textTitleHeader, styles.textBlue]}>
{t('Login')}
</Text>
<Text style={{color: 'black'}}>{t('Email')}</Text>
</AppText>
<AppText style={{color: 'black'}}>{t('Email')}</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: colors.white}}
placeholder={t('Enter_your_email')}
......@@ -58,7 +46,7 @@ const LoginScreen = ({
value={userAccount.username}
leftIcon={IMAGES.IcMail}
/>
<Text style={{color: 'black'}}>{t('Password')}</Text>
<AppText style={{color: 'black'}}>{t('Password')}</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: colors.white}}
placeholder={t('Enter_your_password')}
......@@ -71,13 +59,13 @@ const LoginScreen = ({
secureTextEntry={showPass}
leftIcon={IMAGES.IcLock}
/>
<Text
<AppText
style={styles.forgetPassword}
onPress={() => {
RootNavigation.navigate(APP_NAVIGATE_SCREEN.FORGOT_PASS);
}}>
{t('Forgot_password')}
</Text>
</AppText>
<ButtonComponent
style={[
styles.loginScreenBtn,
......@@ -98,7 +86,7 @@ const LoginScreen = ({
</View>
</View>
<View style={{flex: 1, justifyContent: 'flex-end'}}>
<Text style={{marginLeft: 20}}>2022 @ MeU Solutions, Inc</Text>
<AppText style={{marginLeft: 20}}>2022 @ MeU Solutions, Inc</AppText>
<Image source={BgIntroduce.BgFtStep1} style={styles.bgFullWidth} />
</View>
{loading && <LoadingProgress />}
......
import React, {useEffect, useState} from 'react';
import RootNavigation from '../../../navigation/RootNavigation';
import ServerScreen from './ServerScreen';
import RootNavigation from '../../../navigation/RootNavigation';
import {APP_NAVIGATE_SCREEN} from '../../../utils/constant';
import AsyncStorageKeys from '../../../utils/AsyncStorageKeys';
import AsyncStorage from '@react-native-async-storage/async-storage';
import SInfo from 'react-native-sensitive-info';
import Toast from 'react-native-toast-message';
import {useDispatch} from 'react-redux';
import {refreshApiService} from '../../../network/ApiService';
import api from '../../../network/axios';
import AsyncStorageKeys from '../../../utils/AsyncStorageKeys';
import {APP_NAVIGATE_SCREEN} from '../../../utils/constant';
import md5 from '../../../utils/HashService';
import {BgIntroduce} from '../../../values/images';
import {useDispatch, useSelector} from 'react-redux';
import api from '../../../network/axios';
import {IMAGES, BgIntroduce} from '../../../values/images';
import Toast from 'react-native-toast-message';
const ServerContainer = props => {
// console.log("props: ", props)
const dispatch = useDispatch();
......@@ -89,7 +88,6 @@ const ServerContainer = props => {
api.setBaseURL(urlServer);
storeDomain(urlServer);
refreshApiService();
// console.log(api.getBaseURL(urlServer));
setLoading(false);
} else {
......@@ -165,10 +163,6 @@ const ServerContainer = props => {
style: {zIndex: 1001},
visibilityTime: 2000,
});
// setTimeout(() => {
// CodePush.allowRestart();
// CodePush.restartApp();
// }, 3000);
};
useEffect(() => {
......
import React from 'react';
import SignUpScreen from './SignUpScreen';
const SignUpContainer = () => {
return <SignUpScreen />;
};
import React, { useEffect, useState } from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import SignUpScreen from './SignUpScreen'
const SignUpContainer = () => {
return (
<SignUpScreen />
)
};
export default SignUpContainer;
\ No newline at end of file
export default SignUpContainer;
import React, { useEffect } from 'react'
import { Image, StyleSheet, Text, View } from 'react-native'
import LinearGradient from 'react-native-linear-gradient'
import colors from '../../../values/colors'
import { ImageLogo, } from '../../../values/images'
import FastImage from 'react-native-fast-image'
import React from 'react';
import {StyleSheet} from 'react-native';
import FastImage from 'react-native-fast-image';
import LinearGradient from 'react-native-linear-gradient';
import colors from '../../../values/colors';
import {ImageLogo} from '../../../values/images';
const SplashScreen = () => {
return (
<LinearGradient
colors={colors.appTheme}
......@@ -15,11 +13,10 @@ const SplashScreen = () => {
angle={45}>
<FastImage source={ImageLogo.GifLogo} style={styles.iconLogo} />
</LinearGradient>
);
};
)
}
export default SplashScreen
export default SplashScreen;
const styles = StyleSheet.create({
main: {
flex: 1,
......@@ -36,4 +33,4 @@ const styles = StyleSheet.create({
width: 300,
height: 300,
},
})
});
import Moment from 'moment';
import React, {useEffect, useState} from 'react';
import {useDispatch, useSelector} from 'react-redux';
import ConfirmDateScreen from './ConfirmDateScreen';
import RootNavigation from '../../navigation/RootNavigation';
import {
getUserConfirmDay,
getApproveConfirmDay,
getAbsentChart,
getApproveConfirmDay,
getUserConfirmDay,
} from '../../store/actions/UserAction';
import {APP_NAVIGATE_SCREEN} from '../../utils/constant';
import RootNavigation from '../../navigation/RootNavigation';
import Toast from 'react-native-toast-message';
import Moment from 'moment';
import ConfirmModalAddNew from './confirm-modals/ConfirmModalAddNew';
import ConfirmModalDetails from './confirm-modals/ConfirmModalDetails';
const ConfirmDateContainer = () => {
import ConfirmDateScreen from './ConfirmDateScreen';
const ConfirmDateContainer = props => {
const dispatch = useDispatch();
const userDetails = useSelector(state => state.UserInfo.userInfo);
const {userDetails} = props;
const confirmDay = useSelector(state => state.ConfirmDay.confirmDay);
const approveConfirmList = useSelector(
state => state.ApproveDay.approveConfirm,
......
import React, {useEffect, useState} from 'react';
/* eslint-disable prettier/prettier */
import Moment from 'moment';
import React from 'react';
import {
Image,
SafeAreaView,
ScrollView,
TouchableOpacity,
Image,
Text,
View,
ScrollView,
Dimensions,
} from 'react-native';
import styles from './style';
import {IMAGES, GifType} from '../../values/images';
import {ContributionGraph} from 'react-native-chart-kit';
import colors from '../../values/colors';
import Moment from 'moment';
import Alert from 'react-native-awesome-alerts';
import ButtonComponent from '../../components/ButtonComponent';
import {GifType, IMAGES} from '../../values/images';
import styles from './style';
import FastImage from 'react-native-fast-image';
import SelectDropdown from 'react-native-select-dropdown';
import {Calendar, LocaleConfig} from 'react-native-calendars';
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
import AppText from '../../components/AppText';
const ConfirmDateScreen = ({
dataChart,
......@@ -69,9 +64,9 @@ const ConfirmDateScreen = ({
<SafeAreaView>
<ScrollView nestedScrollEnabled={true}>
<View style={{padding: 15, backgroundColor: 'white'}}>
<Text style={[styles.title, {marginBottom: 20}]}>
<AppText style={[styles.title, {marginBottom: 20}]}>
Thng kê xác nhn ngày công ca tôi{' '}
</Text>
</AppText>
<SelectDropdown
data={[
'Tháng 01',
......@@ -121,13 +116,13 @@ const ConfirmDateScreen = ({
borderBottomColor: '#5d78ff',
paddingBottom: 5,
}}>
<Text style={{fontSize: 10}}>T2</Text>
<Text style={{fontSize: 10}}>T3</Text>
<Text style={{fontSize: 10}}>T4</Text>
<Text style={{fontSize: 10}}>T5</Text>
<Text style={{fontSize: 10}}>T6</Text>
<Text style={{fontSize: 10}}>T7</Text>
<Text style={{fontSize: 10}}>CN</Text>
<AppText style={{fontSize: 10}}>T2</AppText>
<AppText style={{fontSize: 10}}>T3</AppText>
<AppText style={{fontSize: 10}}>T4</AppText>
<AppText style={{fontSize: 10}}>T5</AppText>
<AppText style={{fontSize: 10}}>T6</AppText>
<AppText style={{fontSize: 10}}>T7</AppText>
<AppText style={{fontSize: 10}}>CN</AppText>
</View>
{dataChart && dataChart?.data?.length > 0 && (
<ContributionGraph
......@@ -177,24 +172,24 @@ const ConfirmDateScreen = ({
backgroundColor: item.color,
}}
/>
<Text style={{fontSize: 11}}>{item.name}</Text>
<AppText style={{fontSize: 11}}>{item.name}</AppText>
</View>
))}
<View style={{marginTop: 10}}>
{dayPress && <Text>{dayPress}</Text>}
{dayPress && <AppText>{dayPress}</AppText>}
</View>
</View>
</View> */}
<View style={{flexDirection: 'row', marginTop: 20}}>
<View style={styles.viewCalendar}>
<View style={styles.viewDayOfWeek}>
<Text style={{fontSize: 12, fontWeight: 'bold'}}>T2</Text>
<Text style={{fontSize: 12, fontWeight: 'bold'}}>T3</Text>
<Text style={{fontSize: 12, fontWeight: 'bold'}}>T4</Text>
<Text style={{fontSize: 12, fontWeight: 'bold'}}>T5</Text>
<Text style={{fontSize: 12, fontWeight: 'bold'}}>T6</Text>
<Text style={{fontSize: 12, fontWeight: 'bold'}}>T7</Text>
<Text style={{fontSize: 12, fontWeight: 'bold'}}>CN</Text>
<AppText style={{fontSize: 12, fontWeight: 'bold'}}>T2</AppText>
<AppText style={{fontSize: 12, fontWeight: 'bold'}}>T3</AppText>
<AppText style={{fontSize: 12, fontWeight: 'bold'}}>T4</AppText>
<AppText style={{fontSize: 12, fontWeight: 'bold'}}>T5</AppText>
<AppText style={{fontSize: 12, fontWeight: 'bold'}}>T6</AppText>
<AppText style={{fontSize: 12, fontWeight: 'bold'}}>T7</AppText>
<AppText style={{fontSize: 12, fontWeight: 'bold'}}>CN</AppText>
</View>
{dataChart?.data.length > 0 &&
dataChart?.data?.map((item, index) => {
......@@ -234,9 +229,9 @@ const ConfirmDateScreen = ({
margin: 2,
}}>
{
<Text>{`${new Date(
<AppText>{`${new Date(
item.date,
).getDate()}`}</Text>
).getDate()}`}</AppText>
}
</View>
);
......@@ -277,7 +272,11 @@ const ConfirmDateScreen = ({
alignItems: 'center',
margin: 2,
}}>
{<Text>{`${new Date(item.date).getDate()}`}</Text>}
{
<AppText>{`${new Date(
item.date,
).getDate()}`}</AppText>
}
</View>
)}
</View>
......@@ -354,19 +353,19 @@ const ConfirmDateScreen = ({
backgroundColor: item.color,
}}
/>
<Text style={{fontSize: 11}}>{item.name}</Text>
<AppText style={{fontSize: 11}}>{item.name}</AppText>
</View>
))}
<View style={{marginTop: 10}}>
{dayPress && <Text>{dayPress}</Text>}
{dayPress && <AppText>{dayPress}</AppText>}
</View>
</View>
</View>
</View>
<View style={styles.view}>
<Text style={{fontWeight: '500', marginBottom: 10}}>
<AppText style={{fontWeight: '500', marginBottom: 10}}>
Xác nhn ngày công ca bn:{' '}
</Text>
</AppText>
<View style={{alignItems: 'center', justifyContent: 'center'}}>
<ButtonComponent
style={styles.btnConfirm}
......@@ -377,14 +376,16 @@ const ConfirmDateScreen = ({
textStyle={styles.whiteTxt}
/>
</View>
<Text style={{fontWeight: '500', marginBottom: 10, marginTop: 10}}>
<AppText style={{fontWeight: '500', marginBottom: 10, marginTop: 10}}>
Liên kết nhanh:{' '}
</Text>
</AppText>
<TouchableOpacity
style={{flexDirection: 'row'}}
onPress={navigateToDayWage}>
<Image source={IMAGES.IcTask} style={styles.iconPlus} />
<Text style={styles.primary_blue}>Bng chm công ca tôi</Text>
<AppText style={styles.primary_blue}>
Bng chm công ca tôi
</AppText>
</TouchableOpacity>
</View>
{requestApproveArr && (
......@@ -394,7 +395,7 @@ const ConfirmDateScreen = ({
style={{
flexDirection: 'row',
}}>
<Text
<AppText
style={{
fontWeight: 'bold',
marginBottom: 4,
......@@ -403,7 +404,7 @@ const ConfirmDateScreen = ({
alignSelf: 'center',
}}>
Duyt ngày công{' '}
</Text>
</AppText>
<View
style={{
......@@ -461,10 +462,12 @@ const ConfirmDateScreen = ({
/>
<View>
<Text style={styles.title}>
<AppText style={styles.title}>
{item.extend_creator_full_name}
</Text>
<Text>{Moment(item.start).format('DD/MM/YYYY')}</Text>
</AppText>
<AppText>
{Moment(item.start).format('DD/MM/YYYY')}
</AppText>
</View>
</View>
<View
......@@ -474,12 +477,12 @@ const ConfirmDateScreen = ({
alignItems: 'flex-end',
marginLeft: 10,
}}>
<Text>
<AppText>
{item.reason.length > 20
? item.reason.slice(0, 15) + '...'
: item.reason}
</Text>
<Text>{minutesToHours(item.start, item.finish)}</Text>
</AppText>
<AppText>{minutesToHours(item.start, item.finish)}</AppText>
</View>
</TouchableOpacity>
))}
......@@ -503,7 +506,7 @@ const ConfirmDateScreen = ({
style={{
flexDirection: 'row',
}}>
<Text
<AppText
style={{
fontWeight: 'bold',
marginBottom: 4,
......@@ -512,7 +515,7 @@ const ConfirmDateScreen = ({
flex: 2,
}}>
Xác nhn ngày công ca tôi{' '}
</Text>
</AppText>
<View style={{alignItems: 'flex-end', flex: 1, paddingRight: 20}}>
<ButtonComponent
text={'Tải lại'}
......@@ -538,10 +541,10 @@ const ConfirmDateScreen = ({
marginTop: 10,
padding: 20,
}}>
<Text style={{textAlign: 'center'}}>
<AppText style={{textAlign: 'center'}}>
Chưa có ngày công nào 😢 Bn vui lòng thêm ngày công ngay bên
trên nhé!
</Text>
</AppText>
<FastImage
source={GifType.gifConfirm}
style={{width: '90%', height: 250}}
......@@ -560,10 +563,10 @@ const ConfirmDateScreen = ({
},
]}>
<View>
<Text style={styles.title}>
<AppText style={styles.title}>
{item.extend_creator_full_name}
</Text>
<Text>{Moment(item.start).format('DD/MM/YYYY')}</Text>
</AppText>
<AppText>{Moment(item.start).format('DD/MM/YYYY')}</AppText>
</View>
<View
style={{
......@@ -572,12 +575,12 @@ const ConfirmDateScreen = ({
alignItems: 'flex-end',
marginLeft: 10,
}}>
<Text>
<AppText>
{item.reason.length > 20
? item.reason.slice(0, 15) + '...'
: item.reason}
</Text>
<Text>{minutesToHours(item.start, item.finish)}</Text>
</AppText>
<AppText>{minutesToHours(item.start, item.finish)}</AppText>
</View>
</TouchableOpacity>
))}
......
......@@ -4,7 +4,6 @@ import {
ScrollView,
TouchableOpacity,
Image,
Text,
View,
TextInput,
Modal,
......@@ -23,6 +22,7 @@ import ButtonComponent from '../../../components/ButtonComponent';
import {useDispatch, useSelector} from 'react-redux';
import {launchImageLibrary} from 'react-native-image-picker';
import {postUserConfirmDay} from '../../../store/actions/UserAction';
import AppText from '../../../components/AppText';
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
const ConfirmModalAddNew = ({userDetails, onClose}) => {
......@@ -190,7 +190,7 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
<SafeAreaView>
<View style={styles.modalView}>
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<Text style={styles.modalTitle}>Xác nhn ngày công</Text>
<AppText style={styles.modalTitle}>Xác nhn ngày công</AppText>
<TouchableOpacity
onPress={() => {
onClose(null);
......@@ -204,18 +204,18 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
style={styles.ImgAvatar}
/>
<View style={{marginLeft: 15}}>
<Text style={styles.modalTitle}>{`${userDetails.first_name} ${
<AppText style={styles.modalTitle}>{`${userDetails.first_name} ${
userDetails.middle_name ? userDetails.middle_name : ''
} ${userDetails.last_name}`}</Text>
<Text>{userDetails.position}</Text>
} ${userDetails.last_name}`}</AppText>
<AppText>{userDetails.position}</AppText>
</View>
</View>
<View style={styles.bodyHeightCreate}>
<ScrollView>
<View style={{marginTop: 20}}>
<Text style={styles.modalTitle}>Thông tin xác nhn</Text>
<AppText style={styles.modalTitle}>Thông tin xác nhn</AppText>
<View style={styles.rowView}>
<Text style={{flex: 1}}>T ngày</Text>
<AppText style={{flex: 1}}>T ngày</AppText>
<View style={{flex: 1}}>
<TouchableOpacity
onPress={() =>
......@@ -232,9 +232,9 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
justifyContent: 'flex-end',
},
]}>
<Text>
<AppText>
{Moment(confirmDate.since).format('DD/MM/YYYY')}
</Text>
</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{width: 20, height: 20}}
......@@ -264,7 +264,7 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={styles.rowView}>
<Text>Gi</Text>
<AppText>Gi</AppText>
<TouchableOpacity
onPress={() =>
setOpenTimePicker(state => ({
......@@ -273,7 +273,9 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
}))
}
style={{flexDirection: 'row'}}>
<Text>{Moment(confirmDate.hourSince).format('HH:mm')}</Text>
<AppText>
{Moment(confirmDate.hourSince).format('HH:mm')}
</AppText>
<Image
source={IMAGES.IcLockGrey}
style={{width: 20, height: 20}}
......@@ -302,7 +304,7 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
/>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Đến ngày</Text>
<AppText style={{flex: 1}}>Đến ngày</AppText>
<View style={{flex: 1}}>
<TouchableOpacity
onPress={() =>
......@@ -319,9 +321,9 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
justifyContent: 'flex-end',
},
]}>
<Text>
<AppText>
{Moment(confirmDate.finish).format('DD/MM/YYYY')}
</Text>
</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{width: 20, height: 20}}
......@@ -351,7 +353,7 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={styles.rowView}>
<Text>Gi</Text>
<AppText>Gi</AppText>
<TouchableOpacity
onPress={() =>
setOpenTimePicker(state => ({
......@@ -360,9 +362,9 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
}))
}
style={{flexDirection: 'row'}}>
<Text>
<AppText>
{Moment(confirmDate.hourFinish).format('HH:mm')}
</Text>
</AppText>
<Image
source={IMAGES.IcLockGrey}
style={{width: 20, height: 20}}
......@@ -392,13 +394,13 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
</View>
<View style={styles.rowView}>
<Text
<AppText
style={{
flex: 1,
color: confirmDate.reason.length === 0 ? 'red' : 'grey',
}}>
{`Lý do (*)`}
</Text>
</AppText>
<View style={{flex: 1}}>
<TextInput
style={styles.inputText}
......@@ -414,7 +416,7 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Tp đính kèm</Text>
<AppText style={{flex: 1}}>Tp đính kèm</AppText>
<View
style={{
flex: 2,
......@@ -451,7 +453,7 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={{marginTop: 20}}>
<Text
<AppText
style={[
styles.modalTitle,
{
......@@ -459,7 +461,7 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
},
]}>
Người duyt
</Text>
</AppText>
{userManagerList.map((item, index) => (
<View
key={index}
......@@ -476,18 +478,18 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
style={{width: 60, height: 60, borderRadius: 10}}
/>
<View>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>{`${item.extend_user_full_name}`}</Text>
<Text
}}>{`${item.extend_user_full_name}`}</AppText>
<AppText
style={{
fontSize: 13,
fontWeight: '500',
marginLeft: 10,
}}>{`${item?.position} - ${item?.department}`}</Text>
}}>{`${item?.position} - ${item?.department}`}</AppText>
</View>
</View>
<CheckBox
......@@ -513,12 +515,12 @@ const ConfirmModalAddNew = ({userDetails, onClose}) => {
onClose(null);
}}
style={styles.btnCancel}>
<Text style={styles.blueTxt}>Hủy</Text>
<AppText style={styles.blueTxt}>Hủy</AppText>
</TouchableOpacity>
<TouchableOpacity
style={styles.btnSubmit}
onPress={onSubmitConfirmDate}>
<Text style={styles.whiteTxt}>Gửi yêu cầu</Text>
<AppText style={styles.whiteTxt}>Gửi yêu cầu</AppText>
</TouchableOpacity>
</View>
</View>
......
......@@ -4,7 +4,6 @@ import {
ScrollView,
TouchableOpacity,
Image,
Text,
View,
TextInput,
Modal,
......@@ -31,6 +30,7 @@ import {
postComment,
deleteApproveConfirmDay,
} from '../../../store/actions/UserAction';
import AppText from '../../../components/AppText';
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
const ConfirmModalAddNew = ({
......@@ -197,7 +197,9 @@ const ConfirmModalAddNew = ({
<ScrollView showsVerticalScrollIndicator={false}>
<View style={styles.modalViewEdit}>
<View style={styles.headerModalBottom}>
<Text style={styles.titleModalBottom}>Chi tiết ngày công</Text>
<AppText style={styles.titleModalBottom}>
Chi tiết ngày công
</AppText>
<TouchableOpacity
onPress={() => {
onClose(null);
......@@ -226,67 +228,72 @@ const ConfirmModalAddNew = ({
justifyContent: 'space-around',
marginLeft: 16,
}}>
<Text style={{fontSize: 14, fontWeight: '600'}}>
<AppText style={{fontSize: 14, fontWeight: '600'}}>
{confirmDateDetail?.extend_creator_full_name} -{' '}
{confirmDateDetail?.extend_creator_employee_code}
</Text>
<Text>{confirmDateDetail?.extend_creator_position}</Text>
</AppText>
<AppText>
{confirmDateDetail?.extend_creator_position}
</AppText>
</View>
</View>
{confirmDateDetail && (
<View style={{flex: 1, marginTop: 16}}>
<Text
<AppText
style={{
fontWeight: '500',
fontSize: 14,
marginBottom: 12,
}}>
Thông tin chung
</Text>
</AppText>
<View style={styles.commonDetail}>
<Text style={styles.textMediumGrey}>T ngày</Text>
<Text>
<AppText style={styles.textMediumGrey}>T ngày</AppText>
<AppText>
{`${Moment(confirmDateDetail.start).format(
'DD/MM/YYYY HH:mm',
)} `}
</Text>
</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={styles.textMediumGrey}>Đến ngày</Text>
<Text>
<AppText style={styles.textMediumGrey}>
Đến ngày
</AppText>
<AppText>
{`${Moment(confirmDateDetail.finish).format(
'DD/MM/YYYY HH:mm',
)}`}
</Text>
</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={styles.textMediumGrey}>
<AppText style={styles.textMediumGrey}>
Thi gian ngh
</Text>
<Text>
</AppText>
<AppText>
{minutesToHours(
confirmDateDetail.start,
confirmDateDetail.finish,
)}
</Text>
</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={[styles.textMediumGrey, {flex: 1}]}>
<AppText style={[styles.textMediumGrey, {flex: 1}]}>
Lý do
</Text>
<Text
</AppText>
<AppText
style={{
flex: 1,
textAlign: 'right',
}}>
{confirmDateDetail.reason}
</Text>
</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={[styles.textMediumGrey, {fontSize: 12}]}>
<AppText
style={[styles.textMediumGrey, {fontSize: 12}]}>
Tp đính kèm
</Text>
</AppText>
{
<View style={styles.attachment}>
{
......@@ -302,9 +309,9 @@ const ConfirmModalAddNew = ({
))
}
{detailImage.length == 0 && (
<Text style={{fontSize: 13, color: '#757575'}}>
<AppText style={{fontSize: 13, color: '#757575'}}>
Không có tp đính kèm
</Text>
</AppText>
)}
</View>
}
......@@ -312,14 +319,14 @@ const ConfirmModalAddNew = ({
</View>
)}
<View style={{flex: 1, marginTop: 16}}>
<Text
<AppText
style={{
fontWeight: '500',
fontSize: 14,
marginBottom: 12,
}}>
Lch s duyt
</Text>
</AppText>
{confirmDateHistory &&
confirmDateHistory?.map((item, index) => (
<View key={index} style={{flexDirection: 'row'}}>
......@@ -343,7 +350,9 @@ const ConfirmModalAddNew = ({
justifyContent: 'space-between',
marginLeft: 8,
}}>
<Text>{item.extend_approver_full_name}</Text>
<AppText>
{item.extend_approver_full_name}
</AppText>
<View style={{flexDirection: 'row'}}>
{item.extend_approved_status_name ==
'APPROVED' && (
......@@ -367,7 +376,7 @@ const ConfirmModalAddNew = ({
}}
/>
)}
<Text
<AppText
style={{
color: item.extend_approved_status_color,
fontStyle: 'italic',
......@@ -379,18 +388,18 @@ const ConfirmModalAddNew = ({
'PENDING' && 'Đang chờ'}
{item.extend_approved_status_name ==
'REJECTED' && 'Đã từ chối'}
</Text>
</AppText>
</View>
</View>
<Text style={{fontSize: 12, color: '#959595'}}>
<AppText style={{fontSize: 12, color: '#959595'}}>
{Moment(item.created_at).format('DD/MM/YYYY')}
</Text>
</AppText>
</View>
<View style={{marginLeft: 8}}>
{/* {item.comment && (
<Text style={{fontSize: 13, color: '#757575'}}>
<AppText style={{fontSize: 13, color: '#757575'}}>
{item.comment}
</Text>
</AppText>
)} */}
</View>
</View>
......@@ -419,9 +428,9 @@ const ConfirmModalAddNew = ({
justifyContent: 'space-between',
marginLeft: 8,
}}>
<Text>
<AppText>
{confirmDateDetail.extend_approver_full_name}
</Text>
</AppText>
<View style={{flexDirection: 'row'}}>
{confirmDateDetail.extend_approved_status_name ==
'APPROVED' ? (
......@@ -432,7 +441,7 @@ const ConfirmModalAddNew = ({
) : (
<Image source={IMAGES.uMinus} />
)}
<Text
<AppText
style={{
color:
confirmDateDetail.extend_approved_status_color,
......@@ -445,12 +454,12 @@ const ConfirmModalAddNew = ({
'PENDING' && 'Đang chờ'}
{confirmDateDetail.extend_approved_status_name ==
'REJECTED' && 'Đã từ chối'}
</Text>
</AppText>
</View>
</View>
<Text style={{fontSize: 12, color: '#959595'}}>
<AppText style={{fontSize: 12, color: '#959595'}}>
{Moment().format('DD/MM/YYYY')}
</Text>
</AppText>
</View>
<View style={{marginLeft: 8}}>
<View style={styles.wrapperComment}>
......@@ -483,14 +492,14 @@ const ConfirmModalAddNew = ({
onValueChange={value => setIsNextApprover(value)}
lineWidth={2}
/>
<Text
<AppText
style={{
fontSize: 13,
color: '#434349',
marginLeft: 10,
}}>
Chn người duyt tiếp theo
</Text>
</AppText>
</View>
)}
......@@ -510,12 +519,12 @@ const ConfirmModalAddNew = ({
}}
style={styles.avatarApprove}
/>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>{`${item.extend_user_full_name}`}</Text>
}}>{`${item.extend_user_full_name}`}</AppText>
<CheckBox
disabled={false}
value={item.checked}
......@@ -530,14 +539,14 @@ const ConfirmModalAddNew = ({
</View>
))}
<View style={{marginTop: 16}}>
<Text
<AppText
style={{
fontWeight: '500',
fontSize: 14,
marginBottom: 12,
}}>
Bình lun
</Text>
</AppText>
{/*others comment*/}
{confirmDateComment.length > 0 &&
confirmDateComment.map((item, index) => {
......@@ -557,28 +566,29 @@ const ConfirmModalAddNew = ({
flexDirection: 'row',
justifyContent: 'space-between',
}}>
<Text
<AppText
style={{
color: '#434349',
fontSize: 12,
fontWeight: '500',
}}>
{item.extend_staff_full_name}
</Text>
<Text style={{color: '#959595', fontSize: 10}}>
</AppText>
<AppText
style={{color: '#959595', fontSize: 10}}>
{Moment(item.created_at).format(
'DD/MM/YYYY hh:mm',
)}
</Text>
</AppText>
</View>
<Text
<AppText
style={{
color: '#666666',
fontSize: 13,
marginTop: 8,
}}>
{item.content}
</Text>
</AppText>
</View>
</View>
);
......@@ -637,10 +647,10 @@ const ConfirmModalAddNew = ({
<TouchableOpacity
style={styles.btnCancel}
onPress={() => onClose(null)}>
<Text
<AppText
style={{color: '#5d78ff', fontSize: 14, fontWeight: '500'}}>
Hy
</Text>
</AppText>
</TouchableOpacity>
{confirmDateDetail?.approver_id !== userDetails.id &&
detailItem.extend_approved_status_name === 'PENDING' && (
......@@ -670,14 +680,14 @@ const ConfirmModalAddNew = ({
style={{height: 16, width: 16, marginRight: 4}}
source={IMAGES.IcReject}
/>
<Text
<AppText
style={{
color: '#ff0a3a',
fontSize: 14,
fontWeight: '500',
}}>
T chi
</Text>
</AppText>
</TouchableOpacity>
<TouchableOpacity
style={styles.btnAccept}
......@@ -688,14 +698,14 @@ const ConfirmModalAddNew = ({
style={{height: 16, width: 16, marginRight: 4}}
source={IMAGES.IcAccept}
/>
<Text
<AppText
style={{
color: 'white',
fontSize: 14,
fontWeight: '500',
}}>
Duyt yêu cu
</Text>
</AppText>
</TouchableOpacity>
</View>
)}
......
/* eslint-disable prettier/prettier */
import React from 'react';
import {useSelector} from 'react-redux';
import {authSelector} from '../../app/selectors';
import ConfirmDateContainer from './ConfirmDateContainer';
export default function ConfirmDateScreen() {
const userDetails = useSelector(authSelector);
const {isLogin, userLoginInfo} = userDetails;
const homeScreenProps = {
isLogin,
userLoginInfo,
};
return <ConfirmDateContainer {...homeScreenProps} />;
}
import React, {useEffect, useState, useCallback} from 'react';
import {useDispatch, useSelector} from 'react-redux';
import {
getRandomQuotation,
getBirthDayUserByDate,
getUserDirectManagers,
getCompanyInfo,
getPersonnel,
sendNotification,
getNotificationOfUser,
} from '../../store/actions/UserAction';
/* eslint-disable prettier/prettier */
import Moment from 'moment';
import React, {useCallback, useEffect, useState} from 'react';
import {
Platform,
Linking,
BackHandler,
Alert,
View,
Text,
TouchableOpacity,
BackHandler,
Image,
Linking,
Platform,
TouchableOpacity,
View,
} from 'react-native';
import HomeScreen from './HomeScreen';
import Moment from 'moment';
import {launchImageLibrary} from 'react-native-image-picker';
import Swiper from 'react-native-swiper';
import styles from './style';
import {IMAGES, IconProfile} from '../../values/images';
import Toast from 'react-native-toast-message';
import {useDispatch} from 'react-redux';
import AppText from '../../components/AppText';
import {
getBirthDayUserByDate,
getNotificationOfUser,
getPersonnel,
sendNotification,
} from '../../store/actions/UserAction';
import {IMAGES} from '../../values/images';
import ProfileUserComponent from './components/ProfileUserComponent';
import QuotesComponent from './components/QuotesComponent';
import homePropsProvider from './homePropsProvider';
import {
getBirthDayUser,
getRadomQuotation,
getUserDirectManagers,
} from './homeSlice';
import styles from './style';
import HomeMainView from './template/HomeMainView';
// import {CheckInPage} from '@meunpm/imcheckin';
const HomeContainer = () => {
const HomeContainer = props => {
const {userDetails, quotationList, birthdayListInMonth, randomQuotation} =
props;
const dispatch = useDispatch();
const userDetails = useSelector(state => state.UserInfo.userInfo);
const quotation = useSelector(state => state.Quotation.quotation);
const BirthDay = useSelector(state => state.BirthDayUser.birthday);
const [arrPersonnel, setArrPersonnel] = useState([]);
//console.log('userDetails', userDetails);
......@@ -84,15 +85,8 @@ const HomeContainer = () => {
day: '',
managerOpenWish: [],
});
const [chooseSetting, setSettingView] = useState({
isVisible: false,
view: <QuotesComponent quotation={quotation} />,
title: 'Slide personnel',
});
const [openProfileComponent, setOpenProfileComponent] = useState(false);
const [openCheckIn, setOpenCheckIn] = useState(false);
const [imgArr, setImgArr] = useState([]);
const [openProfileComponent, setOpenProfileComponent] = useState(false);
{
/**wish birthday */
}
......@@ -110,18 +104,12 @@ const HomeContainer = () => {
const handleOpenDesBirthday = useCallback(
day => {
// console.log(
// 'bdUserCurrentMonth',
// `${day.day < 10 ? `0${day.day}` : `${day.day}`}-${
// day.month < 10 ? `0${day.month}` : `${day.month}`
// }-${day.year}`,
// );
const formatDate = `${day.day < 10 ? `0${day.day}` : `${day.day}`}-${
day.month < 10 ? `0${day.month}` : `${day.month}`
}-${day.year}`;
let arrBdUser = [];
let lengthKey = [];
for (const [key, value] of Object.entries(BirthDay)) {
for (const [key, value] of Object.entries(birthdayListInMonth)) {
if (key.includes(formatDate)) {
arrBdUser.push(...value);
value.forEach(item => lengthKey.push({enable: false}));
......@@ -135,7 +123,7 @@ const HomeContainer = () => {
managerOpenWish: lengthKey,
});
},
[BirthDay],
[birthdayListInMonth],
);
const handleCloseDesBirthday = useCallback(() => {
setModalVisible({
......@@ -232,16 +220,15 @@ const HomeContainer = () => {
}
};
const formatDateList = async () => {
// const tokenUser = await AsyncStorage.getItem(AsyncStorageKeys.userToken);
//console.log('tokenUser', tokenUser);
var size = Object.keys(BirthDay).length;
if (birthdayListInMonth) {
var size = Object.keys(birthdayListInMonth).length;
const today = new Date();
const formatToday = Moment(today).format('DD-MM-YYYY');
// console.log(formatToday)
// console.log('size', size)
if (size >= 1) {
let lstBdUser = [];
for (const [key, value] of Object.entries(BirthDay)) {
for (const [key, value] of Object.entries(birthdayListInMonth)) {
if (value.length > 0) {
//console.log("key", value)
if ([key].length > 0) {
......@@ -255,7 +242,7 @@ const HomeContainer = () => {
}
}
if (key.includes(formatToday)) {
const lengthObj = BirthDay[key];
const lengthObj = birthdayListInMonth[key];
//console.log("lengthObj", lengthObj);
if (lengthObj.length <= 0) {
} else {
......@@ -270,14 +257,9 @@ const HomeContainer = () => {
const convertArr = Object.assign({}, ...lstBdUser);
setArrBdCurrentMonth(convertArr);
}
}
};
const getBirthDayUserByMonth = () => {
const date = new Date();
const month =
date.getMonth() > 8 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
//console.log(month)
dispatch(getBirthDayUserByDate(month, date.getFullYear()));
};
const onCalendarChangeMonth = time => {
dispatch(getBirthDayUserByDate(time.month, time.year));
};
......@@ -360,12 +342,12 @@ const HomeContainer = () => {
style={styles.imgAvatar}
/>
</TouchableOpacity>
<Text style={{color: 'black', fontSize: 18}}>
<AppText style={{color: 'black', fontSize: 18}}>
{`${item.first_name} ${
item.middle_name ? item.middle_name : ''
} ${item.last_name}`}{' '}
</Text>
<Text style={{marginBottom: 20}}>{item.position}</Text>
</AppText>
<AppText style={{marginBottom: 20}}>{item.position}</AppText>
</View>
);
})}
......@@ -375,12 +357,7 @@ const HomeContainer = () => {
const openCheckInPage = () => {
// setOpenCheckIn(<CheckInPage />);
};
const openSettingView = () => {
setSettingView(prev => ({
...prev,
isVisible: true,
}));
};
const chooseSettingView = () => {
if (chooseSetting.title == 'Slide personnel') {
setSettingView({
......@@ -391,14 +368,12 @@ const HomeContainer = () => {
} else {
setSettingView({
isVisible: false,
view: <QuotesComponent quotation={quotation} />,
view: <QuotesComponent quotation={quotationList} />,
title: 'Slide personnel',
});
}
};
const hideMenu = () => {
setSettingView(prev => ({...prev, isVisible: false}));
};
const OpenProfileUserComponent = info => {
//console.log('info', info);
return setOpenProfileComponent(
......@@ -413,6 +388,27 @@ const HomeContainer = () => {
return setOpenProfileComponent();
};
// fetch data
const fetchQuotations = () => {
dispatch(getRadomQuotation());
};
const fetchDirectManagers = () => {
dispatch(getUserDirectManagers());
};
const fetchBirthDayUser = () => {
const date = new Date();
const month =
date.getMonth() > 8 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
//console.log(month)
dispatch(getBirthDayUser({month, year: date.getFullYear()}));
};
const initialFetchData = () => {
fetchQuotations();
fetchBirthDayUser();
loadWishUser();
loadListPersonnel();
fetchDirectManagers();
};
// useEffect
useEffect(() => {
const backAction = () => {
......@@ -426,50 +422,35 @@ const HomeContainer = () => {
]);
return true;
};
const backHandler = BackHandler.addEventListener(
'hardwareBackPress',
backAction,
);
let time = setTimeout(() => dispatch(getRandomQuotation()), 20000);
getBirthDayUserByMonth();
loadWishUser();
dispatch(getUserDirectManagers());
loadListPersonnel();
initialFetchData();
return () => {
clearTimeout(time);
backHandler.remove();
};
}, []);
useEffect(() => {
BirthDay && formatDateList();
}, [BirthDay]);
// useEffect(() => {
// modalVisible && console.log(modalVisible);
// }, [modalVisible]);
birthdayListInMonth && formatDateList();
}, [birthdayListInMonth]);
//props
const homeProps = {
userDetails,
quotation,
quotationList,
birthdayOfUser,
dataBirthday,
openView,
bdUserCurrentMonth,
BirthDay,
modalVisible,
imgArr,
arrPersonnel,
wishTxt,
wishList,
openProfileComponent,
openCheckIn,
chooseSetting,
randomQuotation,
chooseSettingView,
openSettingView,
hideMenu,
OpenProfileUserComponent,
setWishTxt,
sendWishBirthday,
......@@ -485,7 +466,7 @@ const HomeContainer = () => {
onCalendarChangeMonth,
openCheckInPage,
};
return <HomeScreen {...homeProps} />;
return <HomeMainView {...homePropsProvider(homeProps)} />;
};
export default HomeContainer;
import moment from 'moment';
import React from 'react';
import {
Image,
Modal,
Platform,
SafeAreaView,
ScrollView,
Text,
TextInput,
TouchableOpacity,
View,
} from 'react-native';
import {Calendar} from 'react-native-calendars';
import FastImage from 'react-native-fast-image';
import Swiper from 'react-native-swiper';
import ButtonComponent from '../../components/ButtonComponent';
import colors from '../../values/colors';
import {IMAGES, IconProfile} from '../../values/images';
import styles from './style';
import {
useAnimatedGestureHandler,
useSharedValue,
} from 'react-native-reanimated';
import WishListComponent from './components/WishListComponent';
const HomeeScreen = ({
userDetails,
quotation,
birthdayOfUser,
openView,
openModalHappyBirthday,
closeModalHappyBirthday,
openModalWishBirthday,
closeModalWishBirthday,
dataBirthday,
OpenURLButton,
bdUserCurrentMonth,
handleOpenDesBirthday,
modalVisible,
handleCloseDesBirthday,
addMoreImgFromGallery,
onCalendarChangeMonth,
SlidePersonnel,
arrPersonnel,
sendWishBirthday,
wishTxt,
wishList,
setWishTxt,
openProfileComponent,
openCheckInPage,
openCheckIn,
chooseSetting,
chooseSettingView,
openSettingView,
}) => {
const today = moment(moment()).format('YYYY-MM-DD'); // Today
const translateY = useSharedValue(0);
const panGestureEvent = useAnimatedGestureHandler({
onStart: () => {},
onActive: event => {
translateY.value = event.translationY;
console.log(event.translationY);
},
onEnd: () => {},
});
//console.log('HomeScreen', HomeScreen);
return (
<SafeAreaView style={styles.container}>
{!openCheckIn && (
<ScrollView
style={{
backgroundColor: openProfileComponent ? 'grey' : null,
}}
nestedScrollEnabled={true}>
{/* <View style={{padding: 10}}>
<StoryComponent />
</View> */}
<View>
<View
style={{
padding: 10,
position: 'absolute',
top: 10,
right: 5,
zIndex: 100,
}}>
<ButtonComponent
style={{position: 'absolute', top: 10, right: 10}}
iconSource={IMAGES.IcMore}
styleIcon={{width: 20, height: 20}}
onPress={openSettingView}
/>
{chooseSetting?.isVisible && (
<ButtonComponent
style={{
backgroundColor: 'white',
padding: 10,
position: 'absolute',
top: 30,
right: 10,
}}
text={chooseSetting?.title}
onPress={chooseSettingView}
/>
)}
</View>
{chooseSetting?.view && chooseSetting?.view}
</View>
{/*Calendar*/}
<View style={styles.viewContent}>
<Image source={IMAGES.BgBirthdayHeader} style={styles.BgBirthday} />
{birthdayOfUser && (
<Swiper
style={styles.BgBirthday}
showsButtons={false}
loop={true}
autoplay
index={0}>
{birthdayOfUser &&
birthdayOfUser.length > 0 &&
birthdayOfUser.map((item, index) => {
//console.log("index")
return (
<TouchableOpacity
onPress={() => {
const day = {
day: new Date().getDate(),
month: new Date().getMonth() + 1,
year: new Date().getFullYear(),
};
handleOpenDesBirthday(day);
//console.log(day)
}}
key={item.id}
style={{marginTop: 10}}>
<Text
style={{
fontSize: 13,
color: 'blue',
textAlign: 'center',
}}>
{`Hôm nay là sinh nhật ${item.first_name} ${item.middle_name} ${item.last_name} `}
</Text>
<Text
style={{
fontSize: 13,
color: 'blue',
textAlign: 'center',
}}>
hãy gi li chúc mng nào
</Text>
<Text
style={{
fontSize: 13,
textAlign: 'center',
}}>
💖
</Text>
</TouchableOpacity>
);
})}
</Swiper>
)}
<Calendar
style={styles.calendarHolder}
current={today}
markedDates={bdUserCurrentMonth}
markingType="dot"
onDayPress={day => {
handleOpenDesBirthday(day);
}}
onMonthChange={month => onCalendarChangeMonth(month)}
enableSwipeMonths={false}
theme={{
//day section
textDayFontSize: 13,
textDayFontFamily:
Platform.OS === 'ios' ? 'System' : 'OpenSans',
todayTextColor: colors.green,
dayTextColor: colors.black,
textDisabledColor: 'rgba(0, 0, 0, 0.25)',
textDayFontWeight: '600',
//month section
textMonthFontSize: 18,
textMonthFontFamily:
Platform.OS === 'ios' ? 'System' : 'Montserrat',
monthTextColor: colors.black,
textMonthFontWeight: 'bold',
//header section
textDayHeaderFontSize: 16,
textDayHeaderFontFamily:
Platform.OS === 'ios' ? 'System' : 'OpenSans',
textSectionTitleColor: 'rgba(0, 0, 0, 0.25)',
textDayHeaderFontWeight: '300',
//selected day section
selectedDayBackgroundColor: '#dcf7fc',
selectedDayTextColor: colors.black,
//arrow section
arrowColor: '#fa0000',
//dot section
selectedDotColor: '#dcf7fc',
}}
/>
</View>
{/*wish */}
{wishList.length > 0 && (
<WishListComponent
userDetails={userDetails}
openView={openView}
openModalHappyBirthday={openModalHappyBirthday}
closeModalHappyBirthday={closeModalHappyBirthday}
dataBirthday={wishList}
/>
)}
{/* deep link */}
<View
style={{
justifyContent: 'center',
alignItems: 'center',
marginBottom: 20,
}}>
<ButtonComponent
text={'Bạn đã checkin chưa ?'}
textStyle={{color: 'blue'}}
// onPress={OpenURLButton}
onPress={openCheckInPage}
/>
</View>
<Modal
animationType="slide"
transparent={true}
visible={modalVisible?.isVisible}>
<View
style={{flex: 1, justifyContent: 'flex-end'}}
//activeOpacity={0}
//onPress={handleCloseDesBirthday}
>
<View style={styles.contentContainer}>
<ScrollView>
<ButtonComponent
iconSource={IconProfile.IcCloseBlack}
styleIcon={{width: 20, height: 20}}
style={{
alignSelf: 'flex-end',
marginRight: 10,
marginTop: 10,
}}
onPress={handleCloseDesBirthday}
/>
<Text
style={{color: 'black', fontWeight: 'bold', fontSize: 14}}>
{`Ngày ${modalVisible?.day?.day} tháng ${modalVisible?.day?.month} năm ${modalVisible?.day?.year} 🎉`}
</Text>
{modalVisible?.birthdayArr &&
modalVisible?.birthdayArr?.map((item, index) => {
return (
<View
key={index}
style={[
styles.viewHappyBirthday,
modalVisible?.managerOpenWish[index].enable
? styles.openViewHappyBirthday
: styles.closeViewHappyBirthday,
]}>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
}}>
<View style={{flexDirection: 'row'}}>
<Image
source={{
uri: 'https://meu.anawork.com' + item.avatar,
}}
style={{width: 40, height: 40}}
/>
<View style={{paddingLeft: 10}}>
<Text
style={
styles.txtTitle
}>{`${item.first_name} ${item.middle_name} ${item.last_name}`}</Text>
<Text>{item.position}</Text>
</View>
</View>
{!modalVisible?.managerOpenWish[index].enable && (
<View
style={{
justifyContent: 'center',
alignItems: 'center',
}}>
{new Date(item.birthday).getDate() ===
new Date().getDate() && (
<TouchableOpacity
onPress={() => openModalWishBirthday(index)}
style={styles.btnOpenHappyBirthday}>
<Text
style={{
color: 'blue',
fontWeight: '500',
}}>
Gửi lời chúc
</Text>
</TouchableOpacity>
)}
</View>
)}
</View>
{modalVisible?.managerOpenWish[index].enable && (
<View>
<View style={{marginTop: 10}}>
<TextInput
value={wishTxt}
multiline
numberOfLines={3}
placeholder={'Vui lòng nhập lời chúc tại đây'}
style={{borderWidth: 0.2}}
onChangeText={setWishTxt}
/>
{!wishTxt && (
<Text style={{fontSize: 10, color: 'red'}}>
Vui lòng nhập lời chúc
</Text>
)}
{/** suggest wish */}
<View>
<ButtonComponent
style={styles.btnSuggest}
text={'Chúc bà sinh nhật dui dẻ nha bà 🌺'}
textStyle={{color: 'white'}}
onPress={() =>
setWishTxt(
'Chúc bà sinh nhật dui dẻ nha bà 🌺',
)
}
/>
<ButtonComponent
style={styles.btnSuggest}
text={'Tuổi mới sinh đẹp nhaaaa bà 🌺💃'}
onPress={() =>
setWishTxt(
'Tuổi mới sinh đẹp nhaaaa bà 🌺💃',
)
}
textStyle={{color: 'white'}}
/>
</View>
<View style={{flexDirection: 'row'}}>
{item?.imgArr &&
item?.imgArr.length > 0 &&
item?.imgArr.map((el, position) => {
return (
<View
key={position}
style={{marginRight: 10}}>
<FastImage
source={{
uri: el?.uri,
}}
style={{
width: 60,
height: 60,
marginTop: 10,
}}
/>
</View>
);
})}
{!item.imgArr && (
<View style={styles.viewAddMoreImg}>
<ButtonComponent
iconSource={IMAGES.IcAddMoreImg}
styleIcon={{height: 25, width: 25}}
onPress={() =>
addMoreImgFromGallery(index)
}
/>
</View>
)}
</View>
</View>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
marginTop: 10,
}}>
<TouchableOpacity
onPress={() => closeModalWishBirthday(index)}
style={{alignSelf: 'flex-end'}}>
<Text
style={{color: 'blue', fontWeight: '600'}}>
{' '}
Hủy{' '}
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => sendWishBirthday(item, index)}
style={{alignSelf: 'flex-end'}}>
<Text
style={{color: 'blue', fontWeight: '600'}}>
Gửi
</Text>
</TouchableOpacity>
</View>
</View>
)}
</View>
);
})}
</ScrollView>
</View>
</View>
</Modal>
</ScrollView>
)}
{openProfileComponent && openProfileComponent}
{openCheckIn && openCheckIn}
</SafeAreaView>
// <CheckInPage />
);
};
export default HomeeScreen;
import Moment from 'moment';
import React, {useCallback, useState, useRef} from 'react';
import React from 'react';
import {
Image,
Text,
View,
TouchableOpacity,
Dimensions,
Image,
StyleSheet,
TouchableOpacity,
View,
} from 'react-native';
import FastImage from 'react-native-fast-image';
import ButtonComponent from '../../../components/ButtonComponent';
import {GifType, IMAGES} from '../../../values/images';
import {IMAGES} from '../../../values/images';
import AppText from '../../../components/AppText';
const windowWidth = Dimensions.get('window').width;
const ProfileUserComponent = ({userDetails, onClose}) => {
//console.log('userDetails', userDetails);
......@@ -30,8 +28,8 @@ const ProfileUserComponent = ({userDetails, onClose}) => {
]}>
<Image
source={
(userDetails.cover_image && {
uri: 'https://meu.anawork.com' + userDetails.cover_image,
(userDetails?.cover_image && {
uri: 'https://meu.anawork.com' + userDetails?.cover_image,
}) ||
IMAGES.ImageCoverBg
}
......@@ -45,25 +43,25 @@ const ProfileUserComponent = ({userDetails, onClose}) => {
style={styles.imgAvatar}
/>
</TouchableOpacity>
<Text style={{color: 'black', fontSize: 18}}>
<AppText style={{color: 'black', fontSize: 18}}>
{`${userDetails.extend_user_full_name}`}
</Text>
<Text style={{marginBottom: 20}}>{userDetails.position}</Text>
</AppText>
<AppText style={{marginBottom: 20}}>{userDetails.position}</AppText>
</View>
<View style={[styles.viewContent, {padding: 10}]}>
<View style={{borderBottomWidth: 1}}>
<Text style={{fontSize: 17, color: 'black'}}>
<AppText style={{fontSize: 17, color: 'black'}}>
Thông tin cá nhân
</Text>
</AppText>
</View>
<View style={styles.viewInfo}>
<View style={{flex: 1, flexDirection: 'row'}}>
<Image source={IMAGES.IcInfoGuess} style={{marginRight: 10}} />
<View>
<Text>H và tên</Text>
<Text style={styles.subTxt}>
<AppText>H và tên</AppText>
<AppText style={styles.subTxt}>
{userDetails.extend_user_full_name}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -71,10 +69,10 @@ const ProfileUserComponent = ({userDetails, onClose}) => {
<View style={{flex: 1, flexDirection: 'row'}}>
<Image source={IMAGES.IcInfoGuess} style={{marginRight: 10}} />
<View>
<Text>Gii tính</Text>
<Text style={styles.subTxt}>
<AppText>Gii tính</AppText>
<AppText style={styles.subTxt}>
{userDetails.gender ? 'Nam' : 'Nữ'}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -84,8 +82,8 @@ const ProfileUserComponent = ({userDetails, onClose}) => {
style={{marginRight: 10, height: 20, width: 20}}
/>
<View>
<Text>S đin thoi</Text>
<Text style={styles.subTxt}>{userDetails.cell_phone}</Text>
<AppText>S đin thoi</AppText>
<AppText style={styles.subTxt}>{userDetails.cell_phone}</AppText>
</View>
</View>
<View style={{flexDirection: 'row'}}>
......@@ -94,8 +92,8 @@ const ProfileUserComponent = ({userDetails, onClose}) => {
style={{marginRight: 10, height: 20, width: 20}}
/>
<View>
<Text>Email</Text>
<Text style={styles.subTxt}>{userDetails.email}</Text>
<AppText>Email</AppText>
<AppText style={styles.subTxt}>{userDetails.email}</AppText>
</View>
</View>
</View>
......
import moment from 'moment';
import React, {useCallback, useState, useRef} from 'react';
/* eslint-disable prettier/prettier */
import React from 'react';
import {
Image,
Text,
View,
TouchableOpacity,
Dimensions,
Image,
StyleSheet,
TouchableOpacity,
View,
} from 'react-native';
import FastImage from 'react-native-fast-image';
import {GifType} from '../../../values/images';
import AppText from '../../../components/AppText';
const windowWidth = Dimensions.get('window').width;
const WishListComponent = ({
userDetails,
......@@ -20,7 +20,9 @@ const WishListComponent = ({
}) => {
return (
<View style={styles.viewContent}>
<Text style={[styles.txtTitle, {padding: 10}]}>Li chúc sinh nht</Text>
<AppText style={[styles.txtTitle, {padding: 10}]}>
Li chúc sinh nht
</AppText>
{dataBirthday.map((item, index) => (
<View
......@@ -44,10 +46,10 @@ const WishListComponent = ({
style={{width: 40, height: 40}}
/>
<View style={{paddingLeft: 10}}>
<Text style={styles.txtTitle}>
<AppText style={styles.txtTitle}>
{item.extend_sender_full_name}
</Text>
<Text>{item.position}</Text>
</AppText>
<AppText>{item.position}</AppText>
</View>
</View>
{!openView[index].enable && (
......@@ -55,7 +57,9 @@ const WishListComponent = ({
<TouchableOpacity
onPress={() => openModalHappyBirthday(index)}
style={styles.btnOpenHappyBirthday}>
<Text style={{color: 'blue', fontWeight: '500'}}>Xem</Text>
<AppText style={{color: 'blue', fontWeight: '500'}}>
Xem
</AppText>
</TouchableOpacity>
</View>
)}
......@@ -63,7 +67,7 @@ const WishListComponent = ({
{openView[index].enable && (
<View>
<View style={{marginTop: 10}}>
<Text style={[styles.txtTitle]}>{item?.details}</Text>
<AppText style={[styles.txtTitle]}>{item?.details}</AppText>
{item.image_path && (
<Image
source={{
......@@ -92,7 +96,10 @@ const WishListComponent = ({
<TouchableOpacity
onPress={() => closeModalHappyBirthday(index)}
style={{alignSelf: 'flex-end'}}>
<Text style={{color: 'blue', fontWeight: '600'}}> Đóng</Text>
<AppText style={{color: 'blue', fontWeight: '600'}}>
{' '}
Đóng
</AppText>
</TouchableOpacity>
</View>
)}
......
/* eslint-disable prettier/prettier */
export default function homePropsProvider(props) {
const {
userDetails,
quotationList,
birthdayOfUser,
dataBirthday,
openView,
bdUserCurrentMonth,
modalVisible,
imgArr,
arrPersonnel,
wishTxt,
wishList,
openProfileComponent,
openCheckIn,
chooseSetting,
chooseSettingView,
openSettingView,
hideMenu,
OpenProfileUserComponent,
setWishTxt,
sendWishBirthday,
SlidePersonnel,
openModalHappyBirthday,
closeModalHappyBirthday,
openModalWishBirthday,
closeModalWishBirthday,
OpenURLButton,
handleOpenDesBirthday,
handleCloseDesBirthday,
addMoreImgFromGallery,
onCalendarChangeMonth,
openCheckInPage,
randomQuotation,
} = props;
return {
userDetails,
openView,
openModalHappyBirthday,
closeModalHappyBirthday,
wishList,
openProfileComponent,
openCheckIn,
chooseSetting,
chooseSettingView,
openSettingView,
calendarBirthdayProps: {
birthdayOfUser,
bdUserCurrentMonth,
handleOpenDesBirthday,
onCalendarChangeMonth,
},
randomQuotation,
};
}
/* eslint-disable prettier/prettier */
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit';
import serviceRequest from '../../app/serviceRequest';
import homeAPI from '../../api/homeAPI';
import Utils from '../../utils';
const initialHome = {
quotationList: [],
news: [],
birthdayListInMonth: [],
};
export const getQuotation = createAsyncThunk(
'home/getQuotation',
async (data, thunkAPI) => {
return serviceRequest({
dispatch: thunkAPI.dispatch,
serviceMethod: homeAPI.requestGetQuotation,
payload: data,
options: {
skipLoader: false,
},
});
},
);
export const getRadomQuotation = createAsyncThunk(
'home/getRadomQuotation',
async (data, thunkAPI) => {
return serviceRequest({
dispatch: thunkAPI.dispatch,
serviceMethod: homeAPI.requestGetRandomQuotation,
payload: data,
options: {
skipLoader: false,
},
});
},
);
export const getUserDirectManagers = createAsyncThunk(
'home/getUserDirectManagers',
async (data, thunkAPI) => {
return serviceRequest({
dispatch: thunkAPI.dispatch,
serviceMethod: homeAPI.requestGetUsersDirectManagers,
payload: data,
options: {
skipLoader: false,
},
});
},
);
export const getBirthDayUser = createAsyncThunk(
'home/getBirthDayUser',
async (data, thunkAPI) => {
return serviceRequest({
dispatch: thunkAPI.dispatch,
serviceMethod: homeAPI.requestGetBirthdayUser,
payload: data,
options: {
skipLoader: false,
},
});
},
);
const homeSlice = createSlice({
name: 'home',
initialState: initialHome,
reducers: {},
extraReducers: builder => {
builder.addCase(getQuotation.fulfilled, (state, action) => {
const {success} = Utils.getValues(action, 'payload', false);
console.log('action', action);
if (success) {
state.quotationList = Utils.getValues(
action,
'payload.data.collection',
[],
);
}
});
builder.addCase(getRadomQuotation.fulfilled, (state, action) => {
const {success} = Utils.getValues(action, 'payload', false);
if (success) {
state.randomQuotation = Utils.getValues(action, 'payload.data', null);
}
});
builder.addCase(getBirthDayUser.fulfilled, (state, action) => {
const {success} = Utils.getValues(action, 'payload', false);
console.log('getBirthDayUser', action);
if (success) {
state.birthdayListInMonth = Utils.getValues(
action,
'payload.data.collection',
[],
);
}
});
},
});
const {reducer} = homeSlice;
export default reducer;
/* eslint-disable prettier/prettier */
import React from 'react';
import {useSelector} from 'react-redux';
import HomeContainer from './homeContainer';
import {authSelector, homeSelector} from '../../app/selectors';
export default function HomeScreen() {
const homeSelect = useSelector(homeSelector);
const userDetails = useSelector(authSelector);
const {isLogin, userLoginInfo} = userDetails;
const {quotationList, birthdayListInMonth, randomQuotation} = homeSelect;
const homeScreenProps = {
isLogin,
userLoginInfo,
quotationList,
birthdayListInMonth,
randomQuotation,
};
return <HomeContainer {...homeScreenProps} />;
}
import moment from 'moment';
import React, {useCallback, useState, useRef} from 'react';
/* eslint-disable prettier/prettier */
import React from 'react';
import {
Image,
Modal,
ScrollView,
Text,
TextInput,
Modal,
View,
TouchableOpacity,
View,
} from 'react-native';
import FastImage from 'react-native-fast-image';
import ButtonComponent from '../../../components/ButtonComponent';
import {IMAGES, IconProfile} from '../../../values/images';
import styles from '../style';
import FastImage from 'react-native-fast-image';
const BirthdayModal = ({
modalVisible
}) => {
console.log('modalVisible', modalVisible);
import AppText from '../../../components/AppText';
const BirthdayModal = ({modalVisible}) => {
return (
<Modal animationType="slide" transparent={true} visible={true}>
<View
......@@ -36,9 +33,9 @@ const BirthdayModal = ({
}}
onPress={handleCloseDesBirthday}
/>
<Text style={{color: 'black', fontWeight: 'bold', fontSize: 14}}>
<AppText style={{color: 'black', fontWeight: 'bold', fontSize: 14}}>
{`Ngày ${modalVisible?.day?.day} tháng ${modalVisible?.day?.month} năm ${modalVisible?.day?.year} 🎉`}
</Text>
</AppText>
{modalVisible?.birthdayArr?.map((item, index) => (
<View
key={index}
......@@ -61,11 +58,11 @@ const BirthdayModal = ({
style={{width: 40, height: 40}}
/>
<View style={{paddingLeft: 10}}>
<Text
<AppText
style={
styles.txtTitle
}>{`${item.first_name} ${item.middle_name} ${item.last_name}`}</Text>
<Text>{item.position}</Text>
}>{`${item.first_name} ${item.middle_name} ${item.last_name}`}</AppText>
<AppText>{item.position}</AppText>
</View>
</View>
{!modalVisible?.managerOpenWish[index].enable && (
......@@ -77,9 +74,9 @@ const BirthdayModal = ({
<TouchableOpacity
onPress={() => openModalWishBirthday(index)}
style={styles.btnOpenHappyBirthday}>
<Text style={{color: 'blue', fontWeight: '500'}}>
<AppText style={{color: 'blue', fontWeight: '500'}}>
Gửi lời chúc
</Text>
</AppText>
</TouchableOpacity>
</View>
)}
......@@ -144,17 +141,17 @@ const BirthdayModal = ({
<TouchableOpacity
onPress={() => closeModalWishBirthday(index)}
style={{alignSelf: 'flex-end'}}>
<Text style={{color: 'blue', fontWeight: '600'}}>
<AppText style={{color: 'blue', fontWeight: '600'}}>
{' '}
Hủy{' '}
</Text>
</AppText>
</TouchableOpacity>
<TouchableOpacity
onPress={() => closeModalHappyBirthday(index)}
style={{alignSelf: 'flex-end'}}>
<Text style={{color: 'blue', fontWeight: '600'}}>
<AppText style={{color: 'blue', fontWeight: '600'}}>
Gửi
</Text>
</AppText>
</TouchableOpacity>
</View>
</View>
......
import React, {useEffect, useState, useCallback} from 'react';
import {useDispatch, useSelector} from 'react-redux';
import {
getRandomQuotation,
getBirthDayUserByDate,
getUserDirectManagers,
getCompanyInfo,
} from '../../../store/actions/UserAction';
import {Platform, Linking, BackHandler, Alert} from 'react-native';
import StoryScreen from './StoryScreen';
import Moment from 'moment';
const StoryContainer = () => {
const dispatch = useDispatch();
const userDetails = useSelector(state => state.UserInfo.userInfo);
useEffect(() => {}, []);
//props
const storyProps = {
userDetails,
};
return <StoryScreen {...storyProps} />;
};
export default StoryContainer;
import React, {useEffect, useState} from 'react';
import {
SafeAreaView,
TouchableOpacity,
Image,
Text,
View,
Modal,
TextInput,
ScrollView,
ImageBackground,
Animated,
} from 'react-native';
import {
IMAGES,
IconProfile,
IconSocial,
BgIntroduce,
StoryIc,
} from '../../../values/images';
import Moment from 'moment';
import {viewStyles, btnStyles, txtStyles} from './styles';
import ButtonComponent from '../../../components/ButtonComponent';
const StoreScreen = ({userDetails}) => {
//console.log("userDetails", userDetails)
return (
<View style={{backgroundColor: 'white', padding: 15, flexDirection: 'row'}}>
<TouchableOpacity style={viewStyles.viewItemStory}>
<View style={viewStyles.viewContainImg}>
<Image
source={{
uri: 'https://meu.anawork.com' + userDetails.avatar,
}}
style={viewStyles.imgBackground}
/>
</View>
<ButtonComponent
style={btnStyles.btnCreate}
iconSource={StoryIc.IconAddStory}
styleIcon={{width: 35, height: 35}}
/>
<Text style={txtStyles.txtTitle}>To tin</Text>
</TouchableOpacity>
<TouchableOpacity style={viewStyles.viewItemStory}>
<ImageBackground
source={BgIntroduce.BgStep1}
imageStyle={{
borderRadius: 10,
opacity: 0.8,
backgroundColor: '#E0E0E0',
}}
style={{
height: '100%',
width: '100%',
}}>
{/* <View style={viewStyles.viewContainImg}>
<Image
source={{
uri: 'https://meu.anawork.com' + userDetails.avatar,
}}
style={viewStyles.imgBackground}
/>
</View> */}
<View
style={{
justifyContent: 'space-between',
height: '100%',
paddingLeft: 10,
paddingBottom: 10,
paddingTop: 10,
}}>
<View
style={{
borderRadius: 30,
backgroundColor: '#1876F2',
width: 40,
height: 40,
justifyContent: 'center',
alignItems: 'center',
zIndex: 100,
}}>
<Image
source={{
uri: 'https://meu.anawork.com' + userDetails.avatar,
}}
style={{width: 30, height: 30, borderRadius: 30}}
/>
</View>
<Text style={{color: 'white', textAlign: 'left'}}>
Nguyn Tiến Dũng
</Text>
</View>
</ImageBackground>
</TouchableOpacity>
</View>
);
};
export default StoreScreen;
import {StyleSheet, Dimensions} from 'react-native';
import colors from '../../../values/colors';
const width = Dimensions.get('window').width;
const windowWidth = Dimensions.get('window').height;
export const viewStyles = StyleSheet.create({
container: {
flex: 1,
},
viewItemStory: {
borderRadius: 10,
height: 200,
width: 130,
backgroundColor: 'white',
shadowColor: '#000000',
shadowOffset: {
width: 0,
height: 8,
},
shadowOpacity: 0.1,
shadowRadius: 10,
elevation: 10,
marginLeft: 10,
},
viewContainImg: {
width: '100%',
height: 140,
borderBottomWidth: 0.5,
borderColor: 'grey',
justifyContent: 'center',
alignItems: 'center',
},
imgBackground: {
width: '100%',
height: '100%',
borderTopLeftRadius: 10,
borderTopRightRadius: 10,
},
});
export const btnStyles = StyleSheet.create({
btnCreate: {
justifyContent: 'center',
alignItems: 'center',
alignSelf: 'center',
padding: 5,
borderRadius: 30,
marginTop: -25,
backgroundColor: 'white',
},
});
export const txtStyles = StyleSheet.create({
txtTitle: {textAlign: 'center', fontWeight: '500', color: 'black'},
});
......@@ -5,10 +5,12 @@ const windowWidth = Dimensions.get('window').width;
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 10,
},
viewContent: {
borderRadius: 5,
borderWidth: 1,
width: windowWidth - 20,
width: '100%',
borderColor: 'white',
backgroundColor: 'white',
alignSelf: 'center',
......
/* eslint-disable prettier/prettier */
import React from 'react';
import {SafeAreaView, ScrollView, View} from 'react-native';
import ButtonComponent from '../../../components/ButtonComponent';
import {IMAGES} from '../../../values/images';
import styles from '../style';
import WishListComponent from '../components/WishListComponent';
import CalendarBirthday from './subViews/CalendarBirthday';
import Quotation from './subViews/QuotationList';
const HomeMainView = ({
userDetails,
openView,
openModalHappyBirthday,
closeModalHappyBirthday,
wishList,
openProfileComponent,
openCheckIn,
chooseSetting,
chooseSettingView,
openSettingView,
calendarBirthdayProps,
randomQuotation,
}) => {
return (
<SafeAreaView style={styles.container}>
{!openCheckIn && (
<ScrollView
style={{
backgroundColor: openProfileComponent ? 'grey' : null,
}}
nestedScrollEnabled={true}
showsVerticalScrollIndicator={false}>
<View>
<View
style={{
position: 'absolute',
top: 10,
right: 5,
zIndex: 100,
}}>
<ButtonComponent
style={{position: 'absolute', top: 10, right: 10}}
iconSource={IMAGES.IcMore}
styleIcon={{width: 20, height: 20}}
onPress={openSettingView}
/>
{chooseSetting?.isVisible && (
<ButtonComponent
style={{
backgroundColor: 'white',
padding: 10,
position: 'absolute',
top: 30,
right: 10,
}}
text={chooseSetting?.title}
onPress={chooseSettingView}
/>
)}
</View>
<Quotation quotation={randomQuotation} />
</View>
{/*Calendar*/}
<CalendarBirthday {...calendarBirthdayProps} />
{/*wish */}
{wishList.length > 0 && (
<WishListComponent
userDetails={userDetails}
openView={openView}
openModalHappyBirthday={openModalHappyBirthday}
closeModalHappyBirthday={closeModalHappyBirthday}
dataBirthday={wishList}
/>
)}
</ScrollView>
)}
{openProfileComponent && openProfileComponent}
</SafeAreaView>
);
};
export default HomeMainView;
/* eslint-disable prettier/prettier */
import moment from 'moment';
import React, {memo} from 'react';
import {Image, TouchableOpacity, View} from 'react-native';
import {Calendar} from 'react-native-calendars';
import Swiper from 'react-native-swiper';
import {fonts} from '../../../../assets/fonts/fonts';
import AppText from '../../../../components/AppText';
import colors from '../../../../values/colors';
import {IMAGES} from '../../../../values/images';
import styles from '../../style';
const CalendarBirthday = React.memo(
({
birthdayOfUser,
bdUserCurrentMonth,
handleOpenDesBirthday,
onCalendarChangeMonth,
}) => {
console.log('CalendarBirthday');
const today = moment(moment()).format('YYYY-MM-DD'); // Today
return (
<View style={styles.viewContent}>
<Image source={IMAGES.BgBirthdayHeader} style={styles.BgBirthday} />
{birthdayOfUser && (
<Swiper
style={styles.BgBirthday}
showsButtons={false}
loop={true}
autoplay
index={0}>
{birthdayOfUser &&
birthdayOfUser.length > 0 &&
birthdayOfUser.map((item, index) => {
//console.log("index")
return (
<TouchableOpacity
onPress={() => {
const day = {
day: new Date().getDate(),
month: new Date().getMonth() + 1,
year: new Date().getFullYear(),
};
handleOpenDesBirthday(day);
//console.log(day)
}}
key={item.id}
style={{marginTop: 10}}>
<AppText
style={{
fontSize: 13,
color: 'blue',
textAlign: 'center',
}}>
{`Hôm nay là sinh nhật ${item.first_name} ${item.middle_name} ${item.last_name} `}
</AppText>
<AppText
style={{
fontSize: 13,
color: 'blue',
textAlign: 'center',
}}>
hãy gi li chúc mng nào
</AppText>
<AppText
style={{
fontSize: 13,
textAlign: 'center',
}}>
💖
</AppText>
</TouchableOpacity>
);
})}
</Swiper>
)}
<Calendar
style={styles.calendarHolder}
current={today}
markedDates={bdUserCurrentMonth}
markingType="dot"
onDayPress={day => {
handleOpenDesBirthday(day);
}}
onMonthChange={month => onCalendarChangeMonth(month)}
enableSwipeMonths={false}
theme={{
//day section
textDayFontSize: 13,
textDayFontFamily: fonts.beProMedium,
todayTextColor: colors.green,
dayTextColor: colors.black,
textDisabledColor: 'rgba(0, 0, 0, 0.25)',
textDayFontWeight: '600',
//month section
textMonthFontSize: 18,
textMonthFontFamily: fonts.beProMedium,
monthTextColor: colors.black,
textMonthFontWeight: 'bold',
//header section
textDayHeaderFontSize: 16,
textDayHeaderFontFamily: fonts.beProMedium,
textSectionTitleColor: 'rgba(0, 0, 0, 0.25)',
textDayHeaderFontWeight: '300',
//selected day section
selectedDayBackgroundColor: '#dcf7fc',
selectedDayTextColor: colors.black,
//arrow section
arrowColor: '#fa0000',
//dot section
selectedDotColor: '#dcf7fc',
}}
/>
</View>
);
},
function (prevProps, nextProps) {
return (
prevProps.birthdayOfUser === nextProps.birthdayOfUser ||
prevProps.bdUserCurrentMonth === nextProps.bdUserCurrentMonth
);
},
);
export default memo(CalendarBirthday);
import moment from 'moment';
import React, {useCallback, useState, useRef} from 'react';
import {
Image,
Text,
View,
TouchableOpacity,
Dimensions,
StyleSheet,
} from 'react-native';
import FastImage from 'react-native-fast-image';
import {GifType, IMAGES} from '../../../values/images';
/* eslint-disable prettier/prettier */
import React from 'react';
import {Dimensions, Image, StyleSheet, View} from 'react-native';
import AppText from '../../../../components/AppText';
import {IMAGES} from '../../../../values/images';
const windowWidth = Dimensions.get('window').width;
const QuotesComponent = ({quotation}) => {
const Quotation = ({quotation}) => {
return (
<View
style={{
<View style={styles.quotationContainer}>
<View style={styles.quotationContent}>
<AppText style={styles.textQuote}>
{quotation?.content
? quotation?.content
: `If you cannot do greats things, do small things in a great way`}
</AppText>
<AppText>
{quotation?.name ? '-' + quotation?.name : `-Napoleon Hill`}
</AppText>
</View>
<Image style={styles.bgQuote} source={IMAGES.BgQuote} />
</View>
);
};
const styles = StyleSheet.create({
quotationContainer: {
borderWidth: 1,
borderColor: 'white',
backgroundColor: 'white',
marginTop: 10,
paddingTop: 30,
}}>
<View
style={{
borderRadius: 5,
},
quotationContent: {
justifyContent: 'center',
alignItems: 'center',
padding: 10,
}}>
<Text style={styles.textQuote}>
{quotation.content
? quotation.content
: `If you cannot do greats things, do small things in a great way`}
</Text>
<Text style={{color: 'black'}}>
{quotation.name ? '-' + quotation.name : `-Napoleon Hill`}
</Text>
</View>
<Image style={styles.bgQuote} source={IMAGES.BgQuote} />
</View>
);
};
const styles = StyleSheet.create({
},
bgQuote: {
width: windowWidth - 10,
height: 120,
......@@ -52,4 +46,4 @@ const styles = StyleSheet.create({
textAlign: 'right',
},
});
export default QuotesComponent;
export default Quotation;
......@@ -2,20 +2,17 @@
/* eslint-disable react-hooks/exhaustive-deps */
import Moment from 'moment';
import React, {useEffect, useState} from 'react';
import Toast from 'react-native-toast-message';
import {useDispatch, useSelector} from 'react-redux';
import RootNavigation from '../../navigation/RootNavigation';
import {
deleteNotificationUser,
getNotificationOfUser,
readNotificationUser,
deleteNotificationUser,
getUserInfoById,
} from '../../store/actions/UserAction';
import {Text, View} from 'react-native';
import {APP_NAVIGATE_SCREEN} from '../../utils/constant';
import NotificationScreen from './NotificationScreen';
import Toast from 'react-native-toast-message';
import {IcNotificationList} from '../../values/images';
import ButtonComponent from '../../components/ButtonComponent';
import NotificationScreen from './NotificationScreen';
const NotificationContainer = () => {
const dispatch = useDispatch();
//Reducers
......
/* eslint-disable react/self-closing-comp */
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable react-native/no-inline-styles */
import React, {useState, Suspense} from 'react';
import {
Image,
Modal,
SafeAreaView,
Text,
View,
TouchableOpacity,
} from 'react-native';
import LoadingProgress from '../../components/LoadingProgress';
import Moment from 'moment';
import {IMAGES, IcNotificationList, IconDrawer} from '../../values/images';
import {ScrollView} from 'react-native-virtualized-view';
import styles from './style';
import ButtonComponent from '../../components/ButtonComponent';
/* eslint-disable prettier/prettier */
import React from 'react';
import {Image, SafeAreaView, TouchableOpacity, View} from 'react-native';
import Alert from 'react-native-awesome-alerts';
import {SwipeListView} from 'react-native-swipe-list-view';
import {ScrollView} from 'react-native-virtualized-view';
import AppText from '../../components/AppText';
import ButtonComponent from '../../components/ButtonComponent';
import LoadingProgress from '../../components/LoadingProgress';
import {IcNotificationList} from '../../values/images';
import styles from './style';
const NotificationScreen = ({
userDetails,
notiList,
......@@ -52,13 +44,13 @@ const NotificationScreen = ({
marginRight: 10,
flex: 4,
}}>
<Text style={{color: '#5d78ff', fontWeight: '500'}}>
<AppText style={{color: '#5d78ff', fontWeight: '500'}}>
{item.summary}
</Text>
<Text style={styles.title}>{`${item.details}`}</Text>
<Text style={{fontSize: 10}}>
</AppText>
<AppText style={styles.title}>{`${item.details}`}</AppText>
<AppText style={{fontSize: 10}}>
{calculateTimeNoti(item.created_at)}
</Text>
</AppText>
</View>
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
{
......@@ -111,7 +103,7 @@ const NotificationScreen = ({
);
})}
</View>
<Text style={styles.titleHeader}>Tt c</Text>
<AppText style={styles.titleHeader}>Tt c</AppText>
<View>
{notiList && (
<SwipeListView
......
/* eslint-disable prettier/prettier */
import Moment from 'moment';
import React, {useEffect, useState} from 'react';
import {Alert} from 'react-native';
import OnLeaveScreen from './OnLeaveScreen';
import {useDispatch, useSelector} from 'react-redux';
import {useDispatch} from 'react-redux';
import RootNavigation from '../../navigation/RootNavigation';
import {
getUserLeaves,
getUserLeavesPending,
getUserLeaveDayApproveReq,
getUserLeavesById,
} from '../../store/actions/UserAction';
import RootNavigation from '../../navigation/RootNavigation';
import {APP_NAVIGATE_SCREEN} from '../../utils/constant';
import Moment from 'moment';
import OnLeaveModalAddNew from './modals/OnLeaveModalAddNew';
import OnLeaveModalDetail from './modals/OnLeaveModalDetails';
import {getUserLeavesDay} from './onLeaveSlice';
import OnLeaveMainView from './template/OnLeaveMainView';
const OnLeaveContainer = props => {
const {usersLeavesDayList, userRestDayList, userDetails} = props;
const dispatch = useDispatch();
const userLeaveDays = useSelector(state => state.UserLeaves.userLeaves);
const userRestDays = useSelector(state => state.UserLeaves.restDay);
const userLeaveDaysPending = useSelector(
state => state.UserLeavesPending.userLeavesPending,
);
const userDetails = useSelector(state => state.UserInfo.userInfo);
// const userLeaveDaysPending = useSelector(
// state => state.UserLeavesPending.userLeavesPending,
// );
const [dataChart, setDataChart] = useState();
const initPayloadApprove = {
......@@ -85,9 +83,9 @@ const OnLeaveContainer = props => {
};
const loadDataChart = () => {
// console.log('userRestDays', userRestDays);
if (userRestDays.length > 0) {
if (userRestDayList.length > 0) {
let arrDataChart = [];
userRestDays.map((item, index) => {
userRestDayList.map((item, index) => {
arrDataChart.push({
name: item.name,
from: Number(parseFloat(item.take_days).toFixed(1)),
......@@ -180,12 +178,12 @@ const OnLeaveContainer = props => {
};
const loadLeavesTicketsFromApi = async () => {
const response = await dispatch(
getUserLeaves(
payloadLeaves.filter,
payloadLeaves.sort,
payloadLeaves.page,
payloadLeaves.pageSize,
),
getUserLeavesDay({
filter: payloadLeaves.filter,
sort: payloadLeaves.sort,
page: payloadLeaves.page,
pageSize: payloadLeaves.pageSize,
}),
);
if (response.success) {
const {collection, total} = response.data;
......@@ -293,10 +291,10 @@ const OnLeaveContainer = props => {
};
const formatLeaveLstFromApi = () => {
if (payloadLeaves.isRefresh) {
setLeaveList(userLeaveDays);
setLeaveList(usersLeavesDayList);
return;
}
let merge = [...userLeaveDays, ...leaveList];
let merge = [...usersLeavesDayList, ...leaveList];
let format = merge.filter(
(
......@@ -307,24 +305,24 @@ const OnLeaveContainer = props => {
format.sort((a, b) => Moment(a.created_at) < Moment(b.created_at));
setLeaveList(format);
};
const formatLeaveApproveLstFromApi = () => {
//console.log('formatLeaveApproveLstFromApi');
if (payloadApproveLeaves.isRefresh) {
setLeaveApproveReqList(userLeaveDaysPending);
// const formatLeaveApproveLstFromApi = () => {
// //console.log('formatLeaveApproveLstFromApi');
// if (payloadApproveLeaves.isRefresh) {
// setLeaveApproveReqList(userLeaveDaysPending);
return;
}
let merge = [...leaveApproveReqList, ...userLeaveDaysPending];
// return;
// }
// let merge = [...leaveApproveReqList, ...userLeaveDaysPending];
let format = merge.filter(
(
set => f =>
!set.has(f.id) && set.add(f.id)
)(new Set()),
);
format.sort((a, b) => Moment(a.created_at) < Moment(b.created_at));
setLeaveApproveReqList(format);
};
// let format = merge.filter(
// (
// set => f =>
// !set.has(f.id) && set.add(f.id)
// )(new Set()),
// );
// format.sort((a, b) => Moment(a.created_at) < Moment(b.created_at));
// setLeaveApproveReqList(format);
// };
const minutesToHours = (start, finish) => {
//console.log(start, finish);
......@@ -341,23 +339,43 @@ const OnLeaveContainer = props => {
}
};
const fetchLeavesTicket = () => {
dispatch(
getUserLeavesDay({
filter: payloadLeaves.filter,
sort: payloadLeaves.sort,
page: payloadLeaves.page,
pageSize: payloadLeaves.pageSize,
}),
);
};
const fetchRestDay = () => {
dispatch(
getUserLeaveDayApproveReq(
payloadApproveLeaves.filter,
payloadApproveLeaves.sort,
payloadApproveLeaves.page,
payloadApproveLeaves.pageSize,
),
);
};
// useEffect
useEffect(() => {
userLeaveDays && formatLeaveLstFromApi();
}, [userLeaveDays]);
useEffect(() => {
userLeaveDaysPending && formatLeaveApproveLstFromApi();
}, [userLeaveDaysPending]);
usersLeavesDayList && formatLeaveLstFromApi();
}, [usersLeavesDayList]);
// useEffect(() => {
// userLeaveDaysPending && formatLeaveApproveLstFromApi();
// }, [userLeaveDaysPending]);
useEffect(() => {
userLeaveDays && userRestDays && loadDataChart();
}, [userLeaveDays, userRestDays]);
usersLeavesDayList && userRestDayList && loadDataChart();
}, [usersLeavesDayList, userRestDayList]);
useEffect(() => {
payloadLeaves && loadLeavesTicketsFromApi();
payloadLeaves && fetchLeavesTicket();
}, [payloadLeaves]);
useEffect(() => {
payloadApproveLeaves && loadLeavesApproveReqTicketsFromApi();
payloadApproveLeaves && fetchRestDay();
}, [payloadApproveLeaves]);
useEffect(() => {
......@@ -375,8 +393,7 @@ const OnLeaveContainer = props => {
}, [props?.route?.params]);
// props
const leaveProps = {
userLeaveDays,
userLeaveDaysPending,
usersLeavesDayList,
userDetails,
dataChart,
showAlert,
......@@ -400,7 +417,7 @@ const OnLeaveContainer = props => {
onChangeSelectFilter,
minutesToHours,
};
return <OnLeaveScreen {...leaveProps} />;
return <OnLeaveMainView {...leaveProps} />;
};
export default OnLeaveContainer;
/* eslint-disable prettier/prettier */
import React from 'react';
import {useSelector} from 'react-redux';
import {authSelector, onLeaveSelector} from '../../app/selectors';
import OnLeaveContainer from './onLeaveContainer';
export default function OnLeaveScreen() {
const userDetails = useSelector(authSelector);
const onLeaveSelect = useSelector(onLeaveSelector);
const {usersLeavesDayList = [], userRestDayList = []} = onLeaveSelect;
const onLeaveScreenProps = {
userDetails,
usersLeavesDayList,
userRestDayList,
};
return <OnLeaveContainer {...onLeaveScreenProps} />;
}
import React, {useEffect, useRef, useState, useMemo, useCallback} from 'react';
import CheckBox from '@react-native-community/checkbox';
import Moment from 'moment';
import React, {useEffect, useState} from 'react';
import {
Dimensions,
Image,
Modal,
SafeAreaView,
ScrollView,
StyleSheet,
TextInput,
TouchableOpacity,
Image,
Text,
View,
TextInput,
Modal,
Dimensions,
StyleSheet,
} from 'react-native';
import {IMAGES} from '../../../values/images';
import SelectDropdown from 'react-native-select-dropdown';
import Moment from 'moment';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import Alert from 'react-native-awesome-alerts';
import {launchImageLibrary} from 'react-native-image-picker';
import CheckBox from '@react-native-community/checkbox';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import SelectDropdown from 'react-native-select-dropdown';
import Toast from 'react-native-toast-message';
import {useDispatch, useSelector} from 'react-redux';
import AppText from '../../../components/AppText';
import ButtonComponent from '../../../components/ButtonComponent';
import {
getRangeTimeStart,
getRangeTimeFinish,
getRangeTimeStart,
postUserLeave,
} from '../../../store/actions/UserAction';
import colors from '../../../values/colors';
import ButtonComponent from '../../../components/ButtonComponent';
import {useDispatch, useSelector} from 'react-redux';
import Alert from 'react-native-awesome-alerts';
import Toast from 'react-native-toast-message';
import {IMAGES} from '../../../values/images';
const OnLeaveModalAddNew = ({userDetails, onClose}) => {
const dispatch = useDispatch();
const userDirectManagersList = useSelector(
......@@ -372,7 +372,7 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
flexDirection: 'row',
justifyContent: 'space-between',
}}>
<Text style={styles.modalTitle}>Ngh phép mi</Text>
<AppText style={styles.modalTitle}>Ngh phép mi</AppText>
<TouchableOpacity onPress={() => onClose(null)}>
<Image source={IMAGES.IcClose} />
</TouchableOpacity>
......@@ -385,23 +385,25 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
style={styles.ImgAvatar}
/>
<View style={{marginLeft: 15}}>
<Text style={styles.modalTitle}>{`${userDetails.first_name} ${
userDetails.middle_name ? userDetails.middle_name : ''
} ${userDetails.last_name}`}</Text>
<Text>{userDetails.position}</Text>
<AppText style={styles.modalTitle}>{`${
userDetails.first_name
} ${userDetails.middle_name ? userDetails.middle_name : ''} ${
userDetails.last_name
}`}</AppText>
<AppText>{userDetails.position}</AppText>
</View>
</View>
<View style={{marginTop: 20}}>
<Text style={styles.modalTitle}>Thông tin chung</Text>
<AppText style={styles.modalTitle}>Thông tin chung</AppText>
<View style={styles.rowView}>
<View style={{flex: 1}}>
<Text
<AppText
style={{
flex: 1,
color: leave.id.length === 0 ? 'red' : 'grey',
}}>
Loi ngh phép
</Text>
</AppText>
</View>
<View style={{flex: 1}}>
<SelectDropdown
......@@ -434,7 +436,7 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>T ngày</Text>
<AppText style={{flex: 1}}>T ngày</AppText>
<View style={{flex: 1}}>
<TouchableOpacity
......@@ -454,7 +456,9 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
paddingLeft: 16,
},
]}>
<Text>{Moment(leave.since).format('DD/MM/YYYY')}</Text>
<AppText>
{Moment(leave.since).format('DD/MM/YYYY')}
</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{width: 20, height: 20, marginLeft: 8}}
......@@ -477,7 +481,7 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Gi</Text>
<AppText style={{flex: 1}}>Gi</AppText>
<View style={{flex: 1}}>
<SelectDropdown
data={rangeTimeStart}
......@@ -503,7 +507,7 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Đến ngày</Text>
<AppText style={{flex: 1}}>Đến ngày</AppText>
<View style={{flex: 1}}>
<TouchableOpacity
onPress={() =>
......@@ -522,7 +526,9 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
paddingLeft: 16,
},
]}>
<Text>{Moment(leave.toDate).format('DD/MM/YYYY')}</Text>
<AppText>
{Moment(leave.toDate).format('DD/MM/YYYY')}
</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{width: 20, height: 20, marginLeft: 8}}
......@@ -546,7 +552,7 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Gi</Text>
<AppText style={{flex: 1}}>Gi</AppText>
<View style={{flex: 1}}>
<SelectDropdown
data={rangeTimeFinish}
......@@ -572,22 +578,22 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={styles.rowView}>
<Text
<AppText
style={{
flex: 1,
}}>{`Thời gian nghỉ (*)`}</Text>
}}>{`Thời gian nghỉ (*)`}</AppText>
<View style={styles.takeTimeStyle}>
<Text style={{paddingLeft: 18}}>
<AppText style={{paddingLeft: 18}}>
{durationLeave.stringTime}
</Text>
</AppText>
</View>
</View>
<View style={styles.rowView}>
<Text
<AppText
style={{
flex: 1,
color: leave.reason.length === 0 ? 'red' : 'grey',
}}>{`Lý do(*)`}</Text>
}}>{`Lý do(*)`}</AppText>
<View
style={{
flex: 1,
......@@ -643,7 +649,7 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
/>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Tp đính kèm</Text>
<AppText style={{flex: 1}}>Tp đính kèm</AppText>
<View
style={{
flex: 2,
......@@ -680,7 +686,7 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
</View>
</View>
<View style={{marginTop: 20}}>
<Text
<AppText
style={[
styles.modalTitle,
{
......@@ -688,7 +694,7 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
},
]}>
Người duyt
</Text>
</AppText>
{userManagerList.map((item, index) => (
<View
key={index}
......@@ -710,12 +716,12 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
}}
style={styles.avatarApprove}
/>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>{`${item.extend_user_full_name}`}</Text>
}}>{`${item.extend_user_full_name}`}</AppText>
</View>
<View style={{paddingRight: 10}}>
<CheckBox
......@@ -743,12 +749,12 @@ const OnLeaveModalAddNew = ({userDetails, onClose}) => {
<TouchableOpacity
onPress={() => onClose(null)}
style={styles.btnCancel}>
<Text style={styles.blueTxt}>Hy</Text>
<AppText style={styles.blueTxt}>Hy</AppText>
</TouchableOpacity>
<TouchableOpacity
style={styles.btnSubmit}
onPress={onSubmitLeave}>
<Text style={styles.whiteTxt}>Gi yêu cu</Text>
<AppText style={styles.whiteTxt}>Gi yêu cu</AppText>
</TouchableOpacity>
</View>
</View>
......
import React, {useEffect, useRef, useState, useMemo, useCallback} from 'react';
/* eslint-disable prettier/prettier */
import CheckBox from '@react-native-community/checkbox';
import Moment from 'moment';
import React, {useEffect, useState} from 'react';
import {
Dimensions,
Image,
KeyboardAvoidingView,
Modal,
SafeAreaView,
ScrollView,
StyleSheet,
TextInput,
TouchableOpacity,
Image,
Text,
View,
TextInput,
Modal,
Dimensions,
StyleSheet,
KeyboardAvoidingView,
} from 'react-native';
import {IMAGES} from '../../../values/images';
import SelectDropdown from 'react-native-select-dropdown';
import Moment from 'moment';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import {launchImageLibrary} from 'react-native-image-picker';
import CheckBox from '@react-native-community/checkbox';
import Toast from 'react-native-toast-message';
import {useDispatch, useSelector} from 'react-redux';
import AppText from '../../../components/AppText';
import ButtonComponent from '../../../components/ButtonComponent';
import {
postRejectLeaveDay,
postComment,
getImageByCode,
deleteLeaveTicket,
getCommentByCode,
getImageByCode,
getUserLeaveHistories,
postApproveLeaveDay,
getUserLeavesPending,
deleteLeaveTicket,
postComment,
postRejectLeaveDay,
} from '../../../store/actions/UserAction';
import colors from '../../../values/colors';
import ButtonComponent from '../../../components/ButtonComponent';
import {useDispatch, useSelector} from 'react-redux';
import Toast from 'react-native-toast-message';
import {IMAGES} from '../../../values/images';
const OnLeaveModalDetail = ({
alertMessage,
onClose,
......@@ -221,7 +218,9 @@ const OnLeaveModalDetail = ({
<ScrollView>
<View style={styles.modalViewEdit}>
<View style={styles.headerModalBottom}>
<Text style={styles.titleModalBottom}>Chi tiết ngh phép</Text>
<AppText style={styles.titleModalBottom}>
Chi tiết ngh phép
</AppText>
<TouchableOpacity onPress={() => onClose(null)}>
<Image
style={{height: 20, width: 20}}
......@@ -245,88 +244,94 @@ const OnLeaveModalDetail = ({
justifyContent: 'space-around',
marginLeft: 16,
}}>
<Text style={{fontSize: 14, fontWeight: '600'}}>
<AppText style={{fontSize: 14, fontWeight: '600'}}>
{leaveDayDetail?.extend_creator_full_name} -{' '}
{leaveDayDetail?.extend_creator_employee_code}
</Text>
<Text>{leaveDayDetail?.extend_creator_department}</Text>
</AppText>
<AppText>
{leaveDayDetail?.extend_creator_department}
</AppText>
</View>
</View>
{leaveDayDetail && (
<View style={{marginTop: 16}}>
<Text
<AppText
style={{
fontWeight: '500',
fontSize: 14,
marginBottom: 12,
}}>
Thông tin chung
</Text>
</AppText>
<View style={styles.commonDetail}>
<Text style={styles.textMediumGrey}>Loi ngh phép</Text>
<Text>{leaveDayDetail.extend_category_name}</Text>
<AppText style={styles.textMediumGrey}>
Loi ngh phép
</AppText>
<AppText>{leaveDayDetail.extend_category_name}</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={styles.textMediumGrey}>T ngày</Text>
<Text>
<AppText style={styles.textMediumGrey}>T ngày</AppText>
<AppText>
{Moment(leaveDayDetail.start).format(
'DD/MM/YYYY hh:mm',
)}
</Text>
</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={styles.textMediumGrey}>Đến ngày</Text>
<Text>
<AppText style={styles.textMediumGrey}>Đến ngày</AppText>
<AppText>
{Moment(leaveDayDetail.finish).format(
'DD/MM/YYYY hh:mm',
)}
</Text>
</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={styles.textMediumGrey}>Thi gian ngh</Text>
<Text>{leaveDayDetail.extend_taken_days} ngày</Text>
<AppText style={styles.textMediumGrey}>
Thi gian ngh
</AppText>
<AppText>{leaveDayDetail.extend_taken_days} ngày</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={styles.textMediumGrey}>Lý do</Text>
<Text style={[styles.reason]}>
<AppText style={styles.textMediumGrey}>Lý do</AppText>
<AppText style={[styles.reason]}>
{leaveDayDetail.reason}
</Text>
</AppText>
</View>
<View style={styles.commonDetail}>
<Text style={[styles.textMediumGrey, {fontSize: 12}]}>
<AppText style={[styles.textMediumGrey, {fontSize: 12}]}>
Tp đính kèm
</Text>
</AppText>
<View style={styles.attachment}>
{
//physical_path.slice(30)
detailImage?.length > 0 &&
detailImage.map((item, index) => (
<Text
<AppText
key={index}
numberOfLines={1}
style={{fontSize: 13, color: '#5d78ff'}}>
{item.file_name}
</Text>
</AppText>
))
}
{detailImage?.length == 0 && (
<Text style={{fontSize: 13, color: '#757575'}}>
<AppText style={{fontSize: 13, color: '#757575'}}>
Không có tp đính kèm
</Text>
</AppText>
)}
</View>
</View>
</View>
)}
<View style={{marginTop: 16}}>
<Text
<AppText
style={{
fontWeight: '500',
fontSize: 14,
marginBottom: 12,
}}>
Lch s duyt
</Text>
</AppText>
{leaveHistories.length > 0 &&
leaveHistories.map((item, index) => (
<View key={index} style={{flexDirection: 'row'}}>
......@@ -350,7 +355,9 @@ const OnLeaveModalDetail = ({
justifyContent: 'space-between',
marginLeft: 8,
}}>
<Text>{item.extend_approver_full_name}</Text>
<AppText>
{item.extend_approver_full_name}
</AppText>
<View style={{flexDirection: 'row'}}>
{item.extend_approved_status_name ==
'APPROVED' && (
......@@ -372,7 +379,7 @@ const OnLeaveModalDetail = ({
}}
/>
)}
<Text
<AppText
style={{
color: item.extend_approved_status_color,
fontStyle: 'italic',
......@@ -385,17 +392,17 @@ const OnLeaveModalDetail = ({
'PENDING' &&
'Đang chờ') ||
'Đã từ chối'}
</Text>
</AppText>
</View>
</View>
<Text style={{fontSize: 12, color: '#959595'}}>
<AppText style={{fontSize: 12, color: '#959595'}}>
{Moment(item.created_at).format('DD/MM/YYYY')}
</Text>
</AppText>
</View>
<View style={{marginLeft: 8}}>
<Text style={{fontSize: 13, color: '#757575'}}>
<AppText style={{fontSize: 13, color: '#757575'}}>
{item.comment ? item.comment : ''}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -421,9 +428,9 @@ const OnLeaveModalDetail = ({
justifyContent: 'space-between',
marginLeft: 8,
}}>
<Text>
<AppText>
{leaveDayDetail.extend_approver_full_name}
</Text>
</AppText>
<View style={{flexDirection: 'row'}}>
{leaveDayDetail.extend_approved_status_name ==
'APPROVED' ? (
......@@ -434,7 +441,7 @@ const OnLeaveModalDetail = ({
) : (
<Image source={IMAGES.uMinus} />
)}
<Text
<AppText
style={{
color:
leaveDayDetail.extend_approved_status_color,
......@@ -448,12 +455,12 @@ const OnLeaveModalDetail = ({
'PENDING' &&
'Đang chờ') ||
'Đã từ chối'}
</Text>
</AppText>
</View>
</View>
<Text style={{fontSize: 12, color: '#959595'}}>
<AppText style={{fontSize: 12, color: '#959595'}}>
{Moment().format('DD/MM/YYYY')}
</Text>
</AppText>
</View>
<View style={{marginLeft: 8}}>
<View style={styles.wrapperComment}>
......@@ -490,14 +497,14 @@ const OnLeaveModalDetail = ({
value={isNextApprover}
onValueChange={value => setIsNextApprover(value)}
/>
<Text
<AppText
style={{
fontSize: 14,
color: '#434349',
marginLeft: 4,
}}>
Chn người duyt tiếp theo
</Text>
</AppText>
</View>
)}
{isNextApprover &&
......@@ -516,12 +523,12 @@ const OnLeaveModalDetail = ({
}}
style={styles.avatarApprove}
/>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>{`${item.extend_user_full_name}`}</Text>
}}>{`${item.extend_user_full_name}`}</AppText>
<CheckBox
disabled={false}
value={item.checked}
......@@ -534,14 +541,14 @@ const OnLeaveModalDetail = ({
</View>
))}
<View style={{marginTop: 16}}>
<Text
<AppText
style={{
fontWeight: '500',
fontSize: 14,
marginBottom: 12,
}}>
Bình lun
</Text>
</AppText>
{/*others comment*/}
{leaveComment &&
leaveComment.map((item, index) => (
......@@ -560,28 +567,28 @@ const OnLeaveModalDetail = ({
flexDirection: 'row',
justifyContent: 'space-between',
}}>
<Text
<AppText
style={{
color: '#434349',
fontSize: 12,
fontWeight: '500',
}}>
{item.extend_staff_full_name}
</Text>
<Text style={{color: '#959595', fontSize: 10}}>
</AppText>
<AppText style={{color: '#959595', fontSize: 10}}>
{Moment(item.created_at).format(
'DD/MM/YYYY hh:mm',
)}
</Text>
</AppText>
</View>
<Text
<AppText
style={{
color: '#666666',
fontSize: 13,
marginTop: 8,
}}>
{item.content}
</Text>
</AppText>
</View>
</View>
))}
......@@ -623,10 +630,10 @@ const OnLeaveModalDetail = ({
<TouchableOpacity
style={styles.btnCancel}
onPress={() => onClose(null)}>
<Text
<AppText
style={{color: '#5d78ff', fontSize: 14, fontWeight: '500'}}>
Hy
</Text>
</AppText>
</TouchableOpacity>
{leaveDayDetail &&
leaveDayDetail?.approver_id !== userDetails.id &&
......@@ -656,14 +663,14 @@ const OnLeaveModalDetail = ({
style={{height: 16, width: 16, marginRight: 4}}
source={IMAGES.IcReject}
/>
<Text
<AppText
style={{
color: '#ff0a3a',
fontSize: 14,
fontWeight: '500',
}}>
T chi
</Text>
</AppText>
</TouchableOpacity>
<TouchableOpacity
style={styles.btnAccept}
......@@ -674,14 +681,14 @@ const OnLeaveModalDetail = ({
style={{height: 16, width: 16, marginRight: 4}}
source={IMAGES.IcAccept}
/>
<Text
<AppText
style={{
color: 'white',
fontSize: 14,
fontWeight: '500',
}}>
Duyt yêu cu
</Text>
</AppText>
</TouchableOpacity>
</View>
)}
......
/* eslint-disable prettier/prettier */
export default function homePropsProvider(props) {
const {
userDetails,
navigateToConfirmDate,
navigateToOverTime,
dataChart,
alertMessage,
showAlert,
onHideAlert,
isDisableLoadMore,
onLoadMoreLeavesTicket,
leaveList,
leaveApproveReqList,
onRefreshLeaveList,
onLoadMoreLeavesApproveReqTicket,
onRefreshLeaveApproveReqList,
modalContent,
onOpenDetailModal,
onOpenAddModal,
payloadApproveLeaves,
onChangeSelectFilter,
minutesToHours,
} = props;
return {
userDetails,
navigateToConfirmDate,
navigateToOverTime,
dataChart,
alertMessage,
showAlert,
onHideAlert,
isDisableLoadMore,
onLoadMoreLeavesTicket,
leaveList,
leaveApproveReqList,
onRefreshLeaveList,
onLoadMoreLeavesApproveReqTicket,
onRefreshLeaveApproveReqList,
modalContent,
onOpenDetailModal,
onOpenAddModal,
payloadApproveLeaves,
onChangeSelectFilter,
minutesToHours,
};
}
/* eslint-disable prettier/prettier */
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit';
import serviceRequest from '../../app/serviceRequest';
import onLeaveApi from '../../network/api/onLeaveApi';
import Utils from '../../utils';
const initialHome = {
quotationList: [],
news: [],
birthdayListInMonth: [],
};
export const getUserLeavesDay = createAsyncThunk(
'onLeave/getUserLeavesDay',
async (data, thunkAPI) => {
return serviceRequest({
dispatch: thunkAPI.dispatch,
serviceMethod: onLeaveApi.requestGetLeavesDay,
payload: data,
options: {
skipLoader: false,
},
});
},
);
export const getUserRestDay = createAsyncThunk(
'onLeave/getUserRestDay',
async (data, thunkAPI) => {
return serviceRequest({
dispatch: thunkAPI.dispatch,
serviceMethod: onLeaveApi.requestGetRestDay,
payload: data,
options: {
skipLoader: false,
},
});
},
);
const onLeaveSlice = createSlice({
name: 'onLeave',
initialState: initialHome,
reducers: {},
extraReducers: builder => {
builder.addCase(getUserLeavesDay.fulfilled, (state, action) => {
const {success} = Utils.getValues(action, 'payload', false);
console.log('getUserLeavesDay', action);
if (success) {
state.usersLeavesDayList = Utils.getValues(
action,
'payload.data.collection',
[],
);
}
});
builder.addCase(getUserRestDay.fulfilled, (state, action) => {
const {success} = Utils.getValues(action, 'payload', false);
console.log('getUserRestDay', action);
if (success) {
state.userRestDayList = Utils.getValues(
action,
'payload.data.collection',
[],
);
}
});
},
});
const {reducer} = onLeaveSlice;
export default reducer;
import React, {useEffect, useRef, useState, useMemo, useCallback} from 'react';
/* eslint-disable prettier/prettier */
import Moment from 'moment';
import React from 'react';
import {
Image,
SafeAreaView,
ScrollView,
TouchableOpacity,
Image,
Text,
View,
TextInput,
Modal,
} from 'react-native';
import PieChart from 'react-native-pie-chart';
import styles from './style';
import {IMAGES, GifType} from '../../values/images';
import Moment from 'moment';
import Alert from 'react-native-awesome-alerts';
import ButtonComponent from '../../components/ButtonComponent';
import FastImage from 'react-native-fast-image';
import PieChart from 'react-native-pie-chart';
import SelectDropdown from 'react-native-select-dropdown';
const OnLeaveScreen = ({
import ButtonComponent from '../../../components/ButtonComponent';
import {GifType, IMAGES} from '../../../values/images';
import styles from '../style';
import AppText from '../../../components/AppText';
const OnLeaveMainView = ({
userDetails,
navigateToConfirmDate,
navigateToOverTime,
......@@ -54,9 +53,9 @@ const OnLeaveScreen = ({
<View key={index} style={styles.pieChartView}>
<View style={styles.pieItem}>
<View style={{marginBottom: 10}}>
<Text style={{textAlign: 'center', fontSize: 12}}>
<AppText style={{textAlign: 'center', fontSize: 12}}>
{item.name}
</Text>
</AppText>
</View>
<View
style={{
......@@ -74,11 +73,11 @@ const OnLeaveScreen = ({
coverRadius={0.9}
/>
<View style={styles.pieFill}>
<Text
<AppText
style={
styles.pieFillTextAmount
}>{`${item.from} / ${item.to}`}</Text>
<Text style={styles.pieFillText}> Ngày </Text>
}>{`${item.from} / ${item.to}`}</AppText>
<AppText style={styles.pieFillText}> Ngày </AppText>
</View>
</View>
<View>
......@@ -88,7 +87,7 @@ const OnLeaveScreen = ({
styles.bgLeftViewTextPie,
{backgroundColor: '#6dc9ee', marginRight: 5},
]}></View>
<Text>Phép đã ngh</Text>
<AppText>Phép đã ngh</AppText>
</View>
<View style={[styles.viewTextPie]}>
<View
......@@ -96,7 +95,7 @@ const OnLeaveScreen = ({
styles.bgLeftViewTextPie,
{backgroundColor: '#d9f4ff', marginRight: 10},
]}></View>
<Text>Phép còn li</Text>
<AppText>Phép còn li</AppText>
</View>
</View>
</View>
......@@ -107,38 +106,38 @@ const OnLeaveScreen = ({
</ScrollView>
</View>
<View style={styles.view}>
<Text style={{fontWeight: '500', marginBottom: 10}}>
<AppText style={{fontWeight: '500', marginBottom: 10}}>
Ngh phép ca bn:{' '}
</Text>
</AppText>
<View style={{alignItems: 'center', justifyContent: 'center'}}>
<TouchableOpacity
style={styles.btnConfirm}
onPress={onOpenAddModal}>
<Image source={IMAGES.IcBtnAdd} style={styles.iconPlus} />
<Text style={styles.whiteTxt}>YÊU CU NGH PHÉP</Text>
<AppText style={styles.whiteTxt}>YÊU CU NGH PHÉP</AppText>
</TouchableOpacity>
</View>
<Text style={{fontWeight: '500', marginBottom: 10, marginTop: 10}}>
<AppText style={{fontWeight: '500', marginBottom: 10, marginTop: 10}}>
Liên kết nhanh:{' '}
</Text>
</AppText>
<TouchableOpacity
style={{flexDirection: 'row'}}
onPress={navigateToConfirmDate}>
<Image source={IMAGES.IcTask} style={styles.iconPlus} />
<Text style={styles.primary_blue}>Xác nhn ngày công</Text>
<AppText style={styles.primary_blue}>Xác nhn ngày công</AppText>
</TouchableOpacity>
<TouchableOpacity
onPress={navigateToOverTime}
style={{flexDirection: 'row', marginTop: 5}}>
<Image source={IMAGES.IcBackTime} style={styles.iconPlus} />
<Text style={styles.primary_blue}>Tăng ca ca tôi</Text>
<AppText style={styles.primary_blue}>Tăng ca ca tôi</AppText>
</TouchableOpacity>
</View>
{/* Approve leave request */}
{leaveApproveReqList && (
<View style={styles.view}>
<View style={{flexDirection: 'row', marginBottom: 10}}>
<Text
<AppText
style={{
fontWeight: 'bold',
marginBottom: 10,
......@@ -148,7 +147,7 @@ const OnLeaveScreen = ({
flex: 2,
}}>
Duyt yêu cu ngh phép{' '}
</Text>
</AppText>
<View style={{alignItems: 'flex-end', flex: 1, paddingRight: 20}}>
<SelectDropdown
data={['Tất cả', 'Chưa duyệt', 'Đã duyệt', 'Đã từ chối']}
......@@ -201,19 +200,21 @@ const OnLeaveScreen = ({
/>
<View>
<View>
<Text style={styles.title}>
<AppText style={styles.title}>
{item.extend_creator_full_name}
</Text>
<Text>{Moment(item.start).format('DD/MM/YYYY')}</Text>
</AppText>
<AppText>
{Moment(item.start).format('DD/MM/YYYY')}
</AppText>
</View>
</View>
</View>
<View style={{flex: 1}}>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text numberOfLines={1} style={{flex: 1}}>
<AppText numberOfLines={1} style={{flex: 1}}>
{item.extend_category_name}
</Text>
<Text>{`${item.extend_taken_days} ngày`}</Text>
</AppText>
<AppText>{`${item.extend_taken_days} ngày`}</AppText>
</View>
</View>
</TouchableOpacity>
......@@ -235,7 +236,7 @@ const OnLeaveScreen = ({
{/* My leave request */}
<View style={[styles.view, {marginBottom: 30}]}>
<View style={{flexDirection: 'row', marginBottom: 10}}>
<Text
<AppText
style={{
fontWeight: 'bold',
......@@ -244,7 +245,7 @@ const OnLeaveScreen = ({
alignSelf: 'center',
}}>
Ngh phép ca tôi:{' '}
</Text>
</AppText>
<View style={{alignItems: 'flex-end', flex: 1, paddingRight: 20}}>
<ButtonComponent
text={'Tải lại'}
......@@ -270,10 +271,10 @@ const OnLeaveScreen = ({
marginTop: 10,
padding: 20,
}}>
<Text style={{textAlign: 'center'}}>
<AppText style={{textAlign: 'center'}}>
Bn chưa có ngày ngh nào! Vui lòng chn yêu cu ngh phép
bên trên nhé!
</Text>
</AppText>
<FastImage
source={GifType.gifLeave}
style={{width: '90%', height: 250}}
......@@ -291,14 +292,14 @@ const OnLeaveScreen = ({
{borderLeftColor: item.extend_approved_status_color},
]}>
<View style={{flex: 2}}>
<Text style={styles.title}>
<AppText style={styles.title}>
{item.extend_category_name}
</Text>
<Text>{Moment(item.start).format('DD/MM/YYYY')}</Text>
</AppText>
<AppText>{Moment(item.start).format('DD/MM/YYYY')}</AppText>
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text numberOfLines={1}>{item.reason}</Text>
<Text>{`${item.extend_taken_days} ngày`}</Text>
<AppText numberOfLines={1}>{item.reason}</AppText>
<AppText>{`${item.extend_taken_days} ngày`}</AppText>
</View>
</View>
</TouchableOpacity>
......@@ -335,4 +336,4 @@ const OnLeaveScreen = ({
);
};
export default OnLeaveScreen;
export default OnLeaveMainView;
/* eslint-disable prettier/prettier */
/* eslint-disable no-lone-blocks */
/* eslint-disable react-hooks/exhaustive-deps */
import Moment from 'moment';
......@@ -16,13 +17,13 @@ import OverTimeModalAdd from './modal/OvertimeModalAdd';
import OverTimeModalDetail from './modal/OverTimeModalDetail';
const OvertimeContainer = props => {
// console.log('props', props);
const {userDetails} = props;
const dispatch = useDispatch();
//Reducers
const otVoucherUserList = useSelector(state => state.OTVoucher.otVoucher);
const otApproveReqList = useSelector(
state => state.OTVoucherPending.otVoucherPending,
);
const userDetails = useSelector(state => state.UserInfo.userInfo);
//Chart
const [chartDataDefault, setChartDataDefault] = useState([]);
const [month, setMonth] = useState(Moment().month() + 1);
......
/* eslint-disable prettier/prettier */
/* eslint-disable react/self-closing-comp */
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable react-native/no-inline-styles */
import React, {useState} from 'react';
import React from 'react';
import {
Image,
SafeAreaView,
ScrollView,
Text,
TouchableOpacity,
View,
} from 'react-native';
......@@ -15,11 +15,12 @@ import Moment from 'moment';
import Alert from 'react-native-awesome-alerts';
import {BarChart} from 'react-native-chart-kit';
import SelectDropdown from 'react-native-select-dropdown';
import {IMAGES, GifType} from '../../values/images';
import {GifType, IMAGES} from '../../values/images';
import FastImage from 'react-native-fast-image';
import AppText from '../../components/AppText';
import ButtonComponent from '../../components/ButtonComponent';
import styles from './style';
import FastImage from 'react-native-fast-image';
const OvertimeScreen = ({
userDetails,
otVoucherList,
......@@ -63,7 +64,7 @@ const OvertimeScreen = ({
justifyContent: 'space-between',
}}>
<View>
<Text style={styles.boldTitle}>Thng kê tăng ca</Text>
<AppText style={styles.boldTitle}>Thng kê tăng ca</AppText>
</View>
<View
style={{
......@@ -72,7 +73,7 @@ const OvertimeScreen = ({
justifyContent: 'flex-end',
marginBottom: 16,
}}>
<Text style={{marginRight: 8}}>Tháng</Text>
<AppText style={{marginRight: 8}}>Tháng</AppText>
<SelectDropdown
data={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}
defaultValue={Moment().month() + 1}
......@@ -93,7 +94,7 @@ const OvertimeScreen = ({
</View>
</View>
<Text style={{fontWeight: 'bold'}}>Tn sut</Text>
<AppText style={{fontWeight: 'bold'}}>Tn sut</AppText>
<ScrollView horizontal={true} style={{marginTop: 8}}>
<BarChart
data={chartData}
......@@ -103,15 +104,17 @@ const OvertimeScreen = ({
withInnerLines={false}
/>
</ScrollView>
<Text style={{fontWeight: 'bold', textAlign: 'right'}}>Ngày</Text>
<AppText style={{fontWeight: 'bold', textAlign: 'right'}}>
Ngày
</AppText>
</View>
)}
</View>
<View style={styles.view}>
<Text style={{fontWeight: '500', marginBottom: 10}}>
<AppText style={{fontWeight: '500', marginBottom: 10}}>
Tăng ca ca bn:{' '}
</Text>
</AppText>
<View style={{alignItems: 'center', justifyContent: 'center'}}>
<TouchableOpacity
style={styles.btnConfirm}
......@@ -119,23 +122,23 @@ const OvertimeScreen = ({
onOpenAddModal();
}}>
<Image source={IMAGES.IcBtnAdd} style={styles.iconPlus} />
<Text style={styles.whiteTxt}>YÊU CU TĂNG CA</Text>
<AppText style={styles.whiteTxt}>YÊU CU TĂNG CA</AppText>
</TouchableOpacity>
</View>
<Text style={{fontWeight: '500', marginBottom: 10, marginTop: 10}}>
<AppText style={{fontWeight: '500', marginBottom: 10, marginTop: 10}}>
Liên kết nhanh:{' '}
</Text>
</AppText>
<TouchableOpacity
style={{flexDirection: 'row'}}
onPress={navigateToConfirmDate}>
<Image source={IMAGES.IcTask} style={styles.iconPlus} />
<Text style={styles.primary_blue}>Xác nhn ngày công</Text>
<AppText style={styles.primary_blue}>Xác nhn ngày công</AppText>
</TouchableOpacity>
<TouchableOpacity
onPress={navigateToOnLeave}
style={{flexDirection: 'row', marginTop: 5}}>
<Image source={IMAGES.IcBackTime} style={styles.iconPlus} />
<Text style={styles.primary_blue}>Ngh phép ca tôi</Text>
<AppText style={styles.primary_blue}>Ngh phép ca tôi</AppText>
</TouchableOpacity>
</View>
......@@ -143,7 +146,7 @@ const OvertimeScreen = ({
{otApproveReqVoucherList && (
<View style={[styles.view, {marginBottom: 10}]}>
<View style={{marginBottom: 10, flexDirection: 'row'}}>
<Text
<AppText
style={{
fontWeight: 'bold',
marginBottom: 10,
......@@ -151,7 +154,7 @@ const OvertimeScreen = ({
fontSize: 17,
}}>
Duyt yêu cu tăng ca{' '}
</Text>
</AppText>
<View style={{alignItems: 'flex-end', flex: 1, paddingRight: 20}}>
<SelectDropdown
data={['Tất cả', 'Chưa duyệt', 'Đã duyệt', 'Đã từ chối']}
......@@ -216,13 +219,13 @@ const OvertimeScreen = ({
justifyContent: 'space-between',
}}>
<View>
<Text style={{...styles.title, marginBottom: 4}}>
<AppText style={{...styles.title, marginBottom: 4}}>
{item.extend_creator_full_name}
</Text>
<Text>
</AppText>
<AppText>
{Moment(item.start).format('DD/MM/YYYY')} -{' '}
{Moment(item.finish).format('DD/MM/YYYY')}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -232,10 +235,12 @@ const OvertimeScreen = ({
alignItems: 'flex-end',
marginLeft: 10,
}}>
<Text style={{textAlign: 'right'}}>{item.reason}</Text>
<Text style={{textAlign: 'right'}}>{`${Moment(
<AppText style={{textAlign: 'right'}}>
{item.reason}
</AppText>
<AppText style={{textAlign: 'right'}}>{`${Moment(
item.finish,
).diff(Moment(item.start), 'hours')} giờ`}</Text>
).diff(Moment(item.start), 'hours')} giờ`}</AppText>
</View>
</TouchableOpacity>
))}
......@@ -257,7 +262,7 @@ const OvertimeScreen = ({
{/* My OT*/}
<View style={[styles.view, {marginBottom: 30}]}>
<View style={{flexDirection: 'row', marginBottom: 10}}>
<Text
<AppText
style={{
fontWeight: 'bold',
marginBottom: 10,
......@@ -266,7 +271,7 @@ const OvertimeScreen = ({
alignSelf: 'center',
}}>
Tăng ca ca tôi
</Text>
</AppText>
<View style={{alignItems: 'flex-end', flex: 1, paddingRight: 20}}>
<ButtonComponent
text={'Tải lại'}
......@@ -293,10 +298,10 @@ const OvertimeScreen = ({
marginTop: 10,
padding: 20,
}}>
<Text style={{textAlign: 'center'}}>
<AppText style={{textAlign: 'center'}}>
Chưa có tăng ca nào 🧐 Bn vui lòng thêm yêu cu tăng ca ngay
bên trên nhé!
</Text>
</AppText>
<FastImage
source={GifType.gifOt}
style={{width: '90%', height: 250}}
......@@ -314,14 +319,14 @@ const OvertimeScreen = ({
onOpenDetailModal(item?.id);
}}>
<View style={{flex: 3, alignItems: 'flex-start'}}>
<Text
<AppText
style={{...styles.title, marginBottom: 6}}
numberOfLines={1}>
{item.reason}
</Text>
<Text>{`${Moment(item.start).format('DD/MM/YYYY')} - ${Moment(
item.finish,
).format('DD/MM/YYYY')}`}</Text>
</AppText>
<AppText>{`${Moment(item.start).format(
'DD/MM/YYYY',
)} - ${Moment(item.finish).format('DD/MM/YYYY')}`}</AppText>
</View>
<View
style={{
......@@ -329,10 +334,10 @@ const OvertimeScreen = ({
alignItems: 'flex-end',
justifyContent: 'flex-end',
}}>
<Text>{''}</Text>
<Text style={{textAlign: 'right'}}>
<AppText>{''}</AppText>
<AppText style={{textAlign: 'right'}}>
{minutesToHours(item.start, item.finish)}
</Text>
</AppText>
</View>
</TouchableOpacity>
))}
......
/* eslint-disable prettier/prettier */
import React from 'react';
import {useSelector} from 'react-redux';
import {authSelector, homeSelector} from '../../app/selectors';
import OvertimeContainer from './OvertimeContainer';
export default function OvertimeScreen() {
const userDetails = useSelector(authSelector);
const {isLogin, userLoginInfo} = userDetails;
const homeScreenProps = {
isLogin,
userLoginInfo,
};
return <OvertimeContainer {...homeScreenProps} />;
}
......@@ -8,7 +8,6 @@ import {
Image,
Modal,
ScrollView,
Text,
TextInput,
TouchableOpacity,
View,
......@@ -34,6 +33,7 @@ import {
import {IMAGES} from '../../../values/images';
import styles from '../style';
import Toast from 'react-native-toast-message';
import AppText from '../../../components/AppText';
const OverTimeModalDetail = props => {
const dispatch = useDispatch();
const userDetails = useSelector(state => state.UserInfo.userInfo);
......@@ -213,7 +213,7 @@ const OverTimeModalDetail = props => {
onRequestClose={() => onClose(null)}>
<ScrollView style={styles.modalView} showsVerticalScrollIndicator={false}>
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<Text style={styles.modalTitle}>Chi tiết tăng ca</Text>
<AppText style={styles.modalTitle}>Chi tiết tăng ca</AppText>
<TouchableOpacity onPress={() => onClose(null)}>
<Image source={IMAGES.IcClose} />
</TouchableOpacity>
......@@ -226,18 +226,18 @@ const OverTimeModalDetail = props => {
style={styles.ImgAvatar}
/>
<View style={{marginLeft: 15}}>
<Text
<AppText
style={
styles.modalTitle
}>{`${OTDetail?.extend_creator_full_name}`}</Text>
<Text>{OTDetail?.extend_creator_department}</Text>
}>{`${OTDetail?.extend_creator_full_name}`}</AppText>
<AppText>{OTDetail?.extend_creator_department}</AppText>
</View>
</View>
<View style={{marginTop: 10}}>
<Text style={styles.modalTitle}>Thông tin tăng ca</Text>
<AppText style={styles.modalTitle}>Thông tin tăng ca</AppText>
<View style={styles.rowView}>
<Text>Từ ngày</Text>
<AppText>Từ ngày</AppText>
<View
style={{
alignItems: 'flex-end',
......@@ -245,11 +245,11 @@ const OverTimeModalDetail = props => {
justifyContent: 'flex-end',
borderBottomWidth: 0.5,
}}>
<Text>{Moment(OTDetail?.start).format('DD/MM/YYYY')}</Text>
<AppText>{Moment(OTDetail?.start).format('DD/MM/YYYY')}</AppText>
</View>
</View>
<View style={styles.rowView}>
<Text>Giờ</Text>
<AppText>Giờ</AppText>
<View
style={{
alignItems: 'flex-end',
......@@ -257,11 +257,11 @@ const OverTimeModalDetail = props => {
justifyContent: 'flex-end',
borderBottomWidth: 0.5,
}}>
<Text>{Moment(OTDetail?.start).format('HH:mm')}</Text>
<AppText>{Moment(OTDetail?.start).format('HH:mm')}</AppText>
</View>
</View>
<View style={styles.rowView}>
<Text>Đến ngày</Text>
<AppText>Đến ngày</AppText>
<View
style={{
alignItems: 'flex-end',
......@@ -269,11 +269,11 @@ const OverTimeModalDetail = props => {
justifyContent: 'flex-end',
borderBottomWidth: 0.5,
}}>
<Text>{Moment(OTDetail?.finish).format('DD/MM/YYYY')}</Text>
<AppText>{Moment(OTDetail?.finish).format('DD/MM/YYYY')}</AppText>
</View>
</View>
<View style={styles.rowView}>
<Text>Giờ</Text>
<AppText>Giờ</AppText>
<View
style={{
alignItems: 'flex-end',
......@@ -281,17 +281,17 @@ const OverTimeModalDetail = props => {
justifyContent: 'flex-end',
borderBottomWidth: 0.5,
}}>
<Text>{Moment(OTDetail?.finish).format('HH:mm')}</Text>
<AppText>{Moment(OTDetail?.finish).format('HH:mm')}</AppText>
</View>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Lý do</Text>
<Text style={{flex: 1, textAlign: 'right'}}>
<AppText style={{flex: 1}}>Lý do</AppText>
<AppText style={{flex: 1, textAlign: 'right'}}>
{OTDetail?.reason}
</Text>
</AppText>
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Tệp đính kèm</Text>
<AppText style={{flex: 1}}>Tệp đính kèm</AppText>
<View
style={{
flex: 2,
......@@ -304,19 +304,19 @@ const OverTimeModalDetail = props => {
// source={{uri: el?.uri}}
// style={styles.imgUpload}
// />;
return <Text numberOfLines={1}>{el.file_name}</Text>;
return <AppText numberOfLines={1}>{el.file_name}</AppText>;
})
) : (
<Text style={{fontSize: 12, textAlign: 'right'}}>
<AppText style={{fontSize: 12, textAlign: 'right'}}>
Không có tệp đính kèm
</Text>
</AppText>
)}
</View>
</View>
{/* Lịch sử duyệt */}
<View style={{marginTop: 20}}>
<Text
<AppText
style={[
styles.modalTitle,
{
......@@ -324,7 +324,7 @@ const OverTimeModalDetail = props => {
},
]}>
Lịch sử duyệt
</Text>
</AppText>
{OTDetailHistoriesList && OTDetailHistoriesList.length !== 0 ? (
OTDetailHistoriesList.map((item, index) => (
<View
......@@ -341,12 +341,12 @@ const OverTimeModalDetail = props => {
style={{width: 50, height: 50, borderRadius: 8}}
/>
<View>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>{`${item.extend_approver_full_name}`}</Text>
}}>{`${item.extend_approver_full_name}`}</AppText>
<View
style={{
flexDirection: 'row',
......@@ -372,7 +372,7 @@ const OverTimeModalDetail = props => {
}}
/>
)}
<Text
<AppText
style={{
fontSize: 12,
fontWeight: '500',
......@@ -380,14 +380,14 @@ const OverTimeModalDetail = props => {
fontStyle: 'italic',
}}>
{`${item.extend_approved_status_code}`}
</Text>
</AppText>
</View>
{item.comment && (
<Text
<AppText
style={{
fontSize: 14,
fontWeight: '500',
}}>{`${item.comment}`}</Text>
}}>{`${item.comment}`}</AppText>
)}
</View>
</View>
......@@ -402,7 +402,7 @@ const OverTimeModalDetail = props => {
style={{width: 50, height: 50, borderRadius: 8}}
/>
<View>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
......@@ -410,7 +410,7 @@ const OverTimeModalDetail = props => {
}}>{`${
OTDetail?.extend_approver_full_name ||
OTDetail?.extend_creator_full_name
}`}</Text>
}`}</AppText>
<View
style={{
flexDirection: 'row',
......@@ -418,14 +418,14 @@ const OverTimeModalDetail = props => {
marginLeft: 8,
}}>
<Image source={IMAGES.IcYellowMinus} />
<Text
<AppText
style={{
fontSize: 12,
fontWeight: '500',
color: '#ffa117',
}}>
Đang chờ
</Text>
</AppText>
</View>
</View>
</View>
......@@ -469,14 +469,14 @@ const OverTimeModalDetail = props => {
value={toggleNextApprover}
onValueChange={() => setToggleNextApprover(!toggleNextApprover)}
/>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>
Chọn người duyệt tiếp theo
</Text>
</AppText>
</View>
)}
{myDirectorManagerList.length !== 0 ? (
......@@ -501,20 +501,20 @@ const OverTimeModalDetail = props => {
style={{width: 50, height: 50, borderRadius: 8}}
/>
<View>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>{`${el?.extend_user_full_name}`}</Text>
<Text
}}>{`${el?.extend_user_full_name}`}</AppText>
<AppText
style={{
fontSize: 12,
fontWeight: '500',
marginLeft: 10,
}}>
{`${el?.position} - ${el?.department}`}
</Text>
</AppText>
</View>
</View>
<View>
......@@ -532,18 +532,18 @@ const OverTimeModalDetail = props => {
</View>
))
) : (
<Text
<AppText
style={{
fontSize: 12,
}}>
Không có người duyệt
</Text>
</AppText>
)}
</View>
{/* Bình luận */}
<View>
<Text style={[styles.modalTitle]}>Bình luận</Text>
<AppText style={[styles.modalTitle]}>Bình luận</AppText>
{commentAttachmentList.length > 0 && (
<View
style={{
......@@ -580,27 +580,27 @@ const OverTimeModalDetail = props => {
style={{width: 50, height: 50, borderRadius: 8}}
/>
<View>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>{`${el.extend_staff_full_name}`}</Text>
<Text
}}>{`${el.extend_staff_full_name}`}</AppText>
<AppText
style={{
fontSize: 12,
fontWeight: '500',
marginLeft: 10,
}}>
{`${Moment(el.created_at).format('HH:mm - DD/MM/YYYY')}`}
</Text>
<Text
</AppText>
<AppText
style={{
fontSize: 14,
fontWeight: '500',
marginLeft: 10,
marginTop: 8,
}}>{`${el.content}`}</Text>
}}>{`${el.content}`}</AppText>
</View>
</View>
<View
......@@ -622,7 +622,7 @@ const OverTimeModalDetail = props => {
flexDirection: 'row',
alignItems: 'center',
}}>
<Text>{`${el.number_of_like}`}</Text>
<AppText>{`${el.number_of_like}`}</AppText>
<Image
source={IMAGES.IcLike}
style={{
......@@ -748,7 +748,7 @@ const OverTimeModalDetail = props => {
onClose();
}}
style={styles.btnCancel}>
<Text style={styles.blueTxt}>Đóng</Text>
<AppText style={styles.blueTxt}>Đóng</AppText>
</TouchableOpacity>
{OTDetail?.approver_id !== userDetails.id &&
OTDetail?.extend_approved_status_name === 'PENDING' && (
......
......@@ -4,14 +4,7 @@
import CheckBox from '@react-native-community/checkbox';
import Moment from 'moment';
import React, {useEffect, useState} from 'react';
import {
Image,
Modal,
Text,
TextInput,
TouchableOpacity,
View,
} from 'react-native';
import {Image, Modal, TextInput, TouchableOpacity, View} from 'react-native';
import {launchImageLibrary} from 'react-native-image-picker';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import {useDispatch, useSelector} from 'react-redux';
......@@ -25,6 +18,7 @@ import Toast from 'react-native-toast-message';
import styles from '../style';
import Alert from 'react-native-awesome-alerts';
import ButtonComponent from '../../../components/ButtonComponent';
import AppText from '../../../components/AppText';
const OverTimeModalAdd = props => {
//userSelector
const userDetails = useSelector(state => state.UserInfo.userInfo);
......@@ -151,7 +145,7 @@ const OverTimeModalAdd = props => {
onRequestClose={() => onClose(null)}>
<View style={styles.modalView}>
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<Text style={styles.modalTitle}>Tăng ca mi</Text>
<AppText style={styles.modalTitle}>Tăng ca mi</AppText>
<TouchableOpacity onPress={() => onClose(null)}>
<Image source={IMAGES.IcClose} />
</TouchableOpacity>
......@@ -162,18 +156,18 @@ const OverTimeModalAdd = props => {
style={styles.ImgAvatar}
/>
<View style={{marginLeft: 15}}>
<Text
<AppText
style={
styles.modalTitle
}>{`${userDetails.first_name} ${userDetails.middle_name} ${userDetails.last_name}`}</Text>
<Text>{userDetails.position}</Text>
}>{`${userDetails.first_name} ${userDetails.middle_name} ${userDetails.last_name}`}</AppText>
<AppText>{userDetails.position}</AppText>
</View>
</View>
<View style={{marginTop: 20}}>
<Text style={styles.modalTitle}>Thông tin tăng ca</Text>
<AppText style={styles.modalTitle}>Thông tin tăng ca</AppText>
<View style={styles.rowView}>
<Text>T ngày (*)</Text>
<AppText>T ngày (*)</AppText>
<TouchableOpacity
onPress={() =>
setOpenTimePicker({
......@@ -187,7 +181,7 @@ const OverTimeModalAdd = props => {
justifyContent: 'flex-end',
borderBottomWidth: 0.5,
}}>
<Text>{Moment(otVoucher.start).format('DD/MM/YYYY')}</Text>
<AppText>{Moment(otVoucher.start).format('DD/MM/YYYY')}</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{width: 20, height: 20, marginLeft: 8}}
......@@ -211,7 +205,7 @@ const OverTimeModalAdd = props => {
/>
</View>
<View style={styles.rowView}>
<Text>Gi</Text>
<AppText>Gi</AppText>
<TouchableOpacity
onPress={() =>
setOpenTimePicker({
......@@ -225,7 +219,7 @@ const OverTimeModalAdd = props => {
justifyContent: 'flex-end',
borderBottomWidth: 0.5,
}}>
<Text>{Moment(otVoucher.timeStart).format('HH:mm')}</Text>
<AppText>{Moment(otVoucher.timeStart).format('HH:mm')}</AppText>
<Image
source={IMAGES.IcLockGrey}
style={{width: 20, height: 20, marginLeft: 8}}
......@@ -249,7 +243,7 @@ const OverTimeModalAdd = props => {
/>
</View>
<View style={styles.rowView}>
<Text>Đến ngày (*)</Text>
<AppText>Đến ngày (*)</AppText>
<TouchableOpacity
onPress={() =>
setOpenTimePicker({
......@@ -263,7 +257,7 @@ const OverTimeModalAdd = props => {
justifyContent: 'flex-end',
borderBottomWidth: 0.5,
}}>
<Text>{Moment(otVoucher.finish).format('DD/MM/YYYY')}</Text>
<AppText>{Moment(otVoucher.finish).format('DD/MM/YYYY')}</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{width: 20, height: 20, marginLeft: 8}}
......@@ -287,7 +281,7 @@ const OverTimeModalAdd = props => {
/>
</View>
<View style={styles.rowView}>
<Text>Gi</Text>
<AppText>Gi</AppText>
<TouchableOpacity
onPress={() =>
setOpenTimePicker({
......@@ -301,7 +295,7 @@ const OverTimeModalAdd = props => {
justifyContent: 'flex-end',
borderBottomWidth: 0.5,
}}>
<Text>{Moment(otVoucher.timeFinish).format('HH:mm')}</Text>
<AppText>{Moment(otVoucher.timeFinish).format('HH:mm')}</AppText>
<Image
source={IMAGES.IcLockGrey}
style={{width: 20, height: 20, marginLeft: 8}}
......@@ -325,10 +319,10 @@ const OverTimeModalAdd = props => {
/>
</View>
<View style={styles.rowView}>
<Text
<AppText
style={{color: otVoucher.reason.length == 0 ? 'red' : 'grey'}}>
Lý do (*)
</Text>
</AppText>
<TextInput
style={styles.inputTextArea}
values={otVoucher.reason}
......@@ -345,7 +339,7 @@ const OverTimeModalAdd = props => {
</View>
<View style={styles.rowView}>
<Text style={{flex: 1}}>Tp đính kèm</Text>
<AppText style={{flex: 1}}>Tp đính kèm</AppText>
<View
style={{
flex: 2,
......@@ -381,7 +375,7 @@ const OverTimeModalAdd = props => {
</View>
</View>
<View style={{marginTop: 20}}>
<Text
<AppText
style={[
styles.modalTitle,
{
......@@ -389,7 +383,7 @@ const OverTimeModalAdd = props => {
},
]}>
Người duyt (*)
</Text>
</AppText>
{myDirectorManagerList.length !== 0 &&
myDirectorManagerList.map((item, index) => (
<View
......@@ -411,20 +405,20 @@ const OverTimeModalAdd = props => {
style={{width: 50, height: 50, borderRadius: 8}}
/>
<View>
<Text
<AppText
style={{
fontSize: 16,
fontWeight: '500',
marginLeft: 10,
}}>{`${item?.extend_user_full_name}`}</Text>
<Text
}}>{`${item?.extend_user_full_name}`}</AppText>
<AppText
style={{
fontSize: 12,
fontWeight: '500',
marginLeft: 10,
}}>
{`${item?.position} - ${item?.department}`}
</Text>
</AppText>
</View>
</View>
<View>
......@@ -459,7 +453,7 @@ const OverTimeModalAdd = props => {
onClose();
}}
style={styles.btnCancel}>
<Text style={styles.blueTxt}>Hủy</Text>
<AppText style={styles.blueTxt}>Hủy</AppText>
</TouchableOpacity>
<TouchableOpacity
disabled={
......@@ -478,7 +472,7 @@ const OverTimeModalAdd = props => {
: '#5d78ff',
padding: 10,
}}>
<Text style={styles.whiteTxt}>Gửi yêu cầu</Text>
<AppText style={styles.whiteTxt}>Gửi yêu cầu</AppText>
</TouchableOpacity>
</View>
</View>
......
/* eslint-disable prettier/prettier */
import React, {useEffect, useState} from 'react';
import ProfileScreen from './ProfileScreen';
......@@ -17,9 +18,9 @@ import {launchImageLibrary} from 'react-native-image-picker';
import Toast from 'react-native-toast-message';
import Moment from 'moment';
import {logoutApp} from '../../store/actions/CommonAction';
const ProfileContainer = () => {
const ProfileContainer = props => {
const {userDetails} = props;
const dispatch = useDispatch();
const userDetails = useSelector(state => state.UserInfo.userInfo);
const [modalVisible, setModalVisible] = useState(false);
const [isEditField, setEditField] = useState({
......
import React, {useEffect, useState} from 'react';
/* eslint-disable prettier/prettier */
import Moment from 'moment';
import React from 'react';
import {
SafeAreaView,
TouchableOpacity,
Animated,
Image,
Text,
View,
ImageBackground,
Modal,
TextInput,
SafeAreaView,
ScrollView,
ImageBackground,
Animated,
TextInput,
TouchableOpacity,
View,
} from 'react-native';
import Alert from 'react-native-awesome-alerts';
import {GestureHandlerRootView, Swipeable} from 'react-native-gesture-handler';
import {Menu, MenuItem} from 'react-native-material-menu';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import SelectDropdown from 'react-native-select-dropdown';
import Swiper from 'react-native-swiper';
import AppText from '../../components/AppText';
import ButtonComponent from '../../components/ButtonComponent';
import TextInputComponent from '../../components/TextInputComponent';
import {
IMAGES,
IcNotificationList,
IconProfile,
IconSocial,
IcNotificationList,
} from '../../values/images';
import string from '../../values/string';
import strings from '../../values/string';
import {default as string, default as strings} from '../../values/string';
import styles from './style';
import Moment from 'moment';
import ButtonComponent from '../../components/ButtonComponent';
import {Menu, MenuItem} from 'react-native-material-menu';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import SelectDropdown from 'react-native-select-dropdown';
import Alert from 'react-native-awesome-alerts';
import {SwipeListView} from 'react-native-swipe-list-view';
import {GestureHandlerRootView, Swipeable} from 'react-native-gesture-handler';
import Swiper from 'react-native-swiper';
const ProfileScreen = ({
userDetails,
contactUser,
......@@ -95,7 +94,7 @@ const ProfileScreen = ({
extrapolate: 'clamp',
});
return (
<Animated.Text
<Animated.AppText
style={[
styles.actionText,
{
......@@ -108,7 +107,7 @@ const ProfileScreen = ({
iconSource={IcNotificationList.IcTrash}
styleIcon={{width: 20, height: 20}}
/>
</Animated.Text>
</Animated.AppText>
);
};
return (
......@@ -155,8 +154,8 @@ const ProfileScreen = ({
<View style={styles.viewImageProfile}>
<ImageBackground
source={
(userDetails.cover_image && {
uri: 'https://meu.anawork.com' + userDetails.cover_image,
(userDetails?.cover_image && {
uri: 'https://meu.anawork.com' + userDetails?.cover_image,
}) ||
IMAGES.ImageCoverBg
}
......@@ -182,7 +181,7 @@ const ProfileScreen = ({
<View style={{justifyContent: 'center', alignItems: 'center'}}>
<Menu
visible={visibleMenu}
// anchor={<Text onPress={showMenu}>Show menu</Text>}
// anchor={<AppText onPress={showMenu}>Show menu</AppText>}
onRequestClose={hideMenu}>
<MenuItem onPress={showFullScreen}>Xem nh đại din</MenuItem>
<MenuItem onPress={openGallery}>Đổi hình nn</MenuItem>
......@@ -206,12 +205,12 @@ const ProfileScreen = ({
</TouchableOpacity>
</View>
)}
<Text style={{color: 'black', fontSize: 18}}>
<AppText style={{color: 'black', fontSize: 18}}>
{`${userDetails.first_name} ${
userDetails.middle_name ? userDetails.middle_name : ''
} ${userDetails.last_name} (${userDetails.employee_code})`}{' '}
</Text>
<Text style={{marginBottom: 20}}>{userDetails.position}</Text>
</AppText>
<AppText style={{marginBottom: 20}}>{userDetails.position}</AppText>
</View>
{/**Card Info */}
<ImageBackground
......@@ -245,12 +244,13 @@ const ProfileScreen = ({
/>
</ImageBackground>
<View style={{justifyContent: 'center', alignItems: 'center'}}>
<Text style={{marginTop: 20}}>{userDetails.position}</Text>
<Text style={{color: 'black', fontSize: 18, fontWeight: 'bold'}}>
<AppText style={{marginTop: 20}}>{userDetails.position}</AppText>
<AppText
style={{color: 'black', fontSize: 18, fontWeight: 'bold'}}>
{`${userDetails.first_name} ${
userDetails.middle_name ? userDetails.middle_name : ''
} ${userDetails.last_name} `}
</Text>
</AppText>
<View style={{flexDirection: 'row', marginTop: 10}}>
<View
style={{flex: 1, alignItems: 'flex-end', paddingRight: 5}}>
......@@ -259,9 +259,9 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
</View>
<Text style={{flex: 2, color: 'black'}}>
<AppText style={{flex: 2, color: 'black'}}>
{userDetails.email}
</Text>
</AppText>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
<View
......@@ -271,9 +271,9 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
</View>
<Text style={{flex: 2, color: 'black'}}>
<AppText style={{flex: 2, color: 'black'}}>
{userDetails.cell_phone}
</Text>
</AppText>
</View>
</View>
<View
......@@ -282,13 +282,15 @@ const ProfileScreen = ({
justifyContent: 'space-evenly',
marginTop: 20,
}}>
<Text style={{color: 'black', fontWeight: 'bold'}}>
<AppText style={{color: 'black', fontWeight: 'bold'}}>
#willing-to-do
</Text>
<Text style={{color: 'black', fontWeight: 'bold'}}>#passion</Text>
<Text style={{color: 'black', fontWeight: 'bold'}}>
</AppText>
<AppText style={{color: 'black', fontWeight: 'bold'}}>
#passion
</AppText>
<AppText style={{color: 'black', fontWeight: 'bold'}}>
#hard-working
</Text>
</AppText>
</View>
</ImageBackground>
</Swiper>
......@@ -296,55 +298,55 @@ const ProfileScreen = ({
{/* General information */}
<View style={styles.viewInfo}>
<View style={styles.viewTitle}>
<Text style={{color: 'black', fontSize: 18}}>
<AppText style={{color: 'black', fontSize: 18}}>
{strings.GENERAL_INFORMATION}
</Text>
</AppText>
</View>
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<View style={{flexDirection: 'row'}}>
<Image source={IMAGES.IcUser} style={{height: 45, width: 45}} />
<View style={{marginLeft: 5}}>
<Text>{strings.USER_ID}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.USER_ID}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.employee_code}
</Text>
</AppText>
</View>
</View>
<View style={{flexDirection: 'row'}}>
<Image source={IMAGES.IcCheck} style={{height: 45, width: 45}} />
<View style={{marginLeft: 5}}>
<Text>{strings.TIME_ATTENDANCE_CODE}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.TIME_ATTENDANCE_CODE}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.employee_code}
</Text>
</AppText>
</View>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
<Image source={IMAGES.IcCalendar} style={{height: 45, width: 45}} />
<View style={{marginLeft: 5}}>
<Text>{strings.SHIFT}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.SHIFT}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
Meu Official working time
</Text>
</AppText>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
<Image source={IMAGES.IcUserTag} style={{height: 45, width: 45}} />
<View style={{marginLeft: 5}}>
<Text>{strings.STATUS}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.STATUS}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
Nhân viên chính thc
</Text>
</AppText>
</View>
</View>
</View>
{/* personal information */}
<View style={[styles.viewInfo, styles.paddingView]}>
<View style={styles.viewTitle}>
<Text style={{color: 'black', fontSize: 17}}>
<AppText style={{color: 'black', fontSize: 17}}>
{strings.PERSONAL_INFORMATION}
</Text>
</AppText>
<View
style={{
justifyContent: 'flex-end',
......@@ -371,7 +373,7 @@ const ProfileScreen = ({
setBtnAvailable(prev => ({...prev, personalBtn: false}));
}}
style={styles.btnCancel}>
<Text style={styles.blueTxt}>Hy</Text>
<AppText style={styles.blueTxt}>Hy</AppText>
</TouchableOpacity>
<TouchableOpacity
style={styles.btnSubmit}
......@@ -380,7 +382,7 @@ const ProfileScreen = ({
setEditField(prev => ({...prev, personal_info: false}));
setBtnAvailable(prev => ({...prev, personalBtn: false}));
}}>
<Text style={styles.whiteTxt}>Lưu</Text>
<AppText style={styles.whiteTxt}>Lưu</AppText>
</TouchableOpacity>
</View>
)}
......@@ -392,19 +394,19 @@ const ProfileScreen = ({
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.LAST_NAME}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.LAST_NAME}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.first_name}
</Text>
</AppText>
</View>
</View>
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.MIDDLE_NAME}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.MIDDLE_NAME}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.middle_name ? userDetails.middle_name : ''}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -412,19 +414,19 @@ const ProfileScreen = ({
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.FIRST_NAME}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.FIRST_NAME}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.last_name}
</Text>
</AppText>
</View>
</View>
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.GENDER}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.GENDER}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.gender ? 'Nam' : 'Nữ'}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -434,10 +436,10 @@ const ProfileScreen = ({
style={{height: 20, width: 20}}
/>
<View style={{marginLeft: 5}}>
<Text>{strings.TELEPHONE}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.TELEPHONE}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.cell_phone}
</Text>
</AppText>
</View>
</View>
<View style={styles.viewItem}>
......@@ -446,10 +448,10 @@ const ProfileScreen = ({
style={{height: 20, width: 20}}
/>
<View style={{marginLeft: 5}}>
<Text>{strings.EMAIL}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.EMAIL}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.email}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -459,7 +461,7 @@ const ProfileScreen = ({
{/* row 1 */}
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>H</Text>
<AppText style={{fontSize: 12}}>H</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Họ'}
......@@ -475,7 +477,7 @@ const ProfileScreen = ({
/>
</View>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Tên lót</Text>
<AppText style={{fontSize: 12}}>Tên lót</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Tên lót'}
......@@ -494,7 +496,7 @@ const ProfileScreen = ({
{/* row 2 */}
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Tên</Text>
<AppText style={{fontSize: 12}}>Tên</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Tên'}
......@@ -510,7 +512,7 @@ const ProfileScreen = ({
/>
</View>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Gii tính</Text>
<AppText style={{fontSize: 12}}>Gii tính</AppText>
<SelectDropdown
data={gender}
dropdownIconPosition={'right'}
......@@ -543,7 +545,7 @@ const ProfileScreen = ({
</View>
{/* row 3 */}
<View style={{paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>S đin thoi</Text>
<AppText style={{fontSize: 12}}>S đin thoi</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Số điện thoại'}
......@@ -560,7 +562,7 @@ const ProfileScreen = ({
</View>
{/* row 4 */}
<View style={{paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Email</Text>
<AppText style={{fontSize: 12}}>Email</AppText>
<TextInputComponent
disable={true}
styleAreaInput={{backgroundColor: 'white'}}
......@@ -582,9 +584,9 @@ const ProfileScreen = ({
{/* detail information */}
<View style={[styles.viewInfo, styles.paddingView]}>
<View style={styles.viewTitle}>
<Text style={{color: 'black', fontSize: 18, flex: 1}}>
<AppText style={{color: 'black', fontSize: 18, flex: 1}}>
{strings.DETAIL_INFORMATION}
</Text>
</AppText>
<View
style={{
justifyContent: 'flex-end',
......@@ -611,7 +613,7 @@ const ProfileScreen = ({
setBtnAvailable(prev => ({...prev, detailBtn: false}));
}}
style={styles.btnCancel}>
<Text style={styles.blueTxt}>Hy</Text>
<AppText style={styles.blueTxt}>Hy</AppText>
</TouchableOpacity>
<TouchableOpacity
style={styles.btnSubmit}
......@@ -620,7 +622,7 @@ const ProfileScreen = ({
setEditField(prev => ({...prev, detail_info: false}));
setBtnAvailable(prev => ({...prev, detailBtn: false}));
}}>
<Text style={styles.whiteTxt}>Lưu</Text>
<AppText style={styles.whiteTxt}>Lưu</AppText>
</TouchableOpacity>
</View>
)}
......@@ -633,10 +635,10 @@ const ProfileScreen = ({
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.IDENTITY_CARD}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.IDENTITY_CARD}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.id_card_number}
</Text>
</AppText>
</View>
</View>
<View style={styles.rightView}>
......@@ -645,13 +647,13 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
<View>
<Text>{strings.DATE_IDENTITY_CARD}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.DATE_IDENTITY_CARD}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.id_card_issue_date &&
Moment(userDetails.id_card_issue_date).format(
'DD/MM/YYYY',
)}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -660,10 +662,10 @@ const ProfileScreen = ({
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.ISSUED_BY}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.ISSUED_BY}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.id_card_issue_palce}
</Text>
</AppText>
</View>
</View>
<View style={styles.rightView}>
......@@ -672,11 +674,11 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
<View>
<Text>{strings.DATE_OF_BIRTH}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.DATE_OF_BIRTH}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{infoUser.birthday &&
Moment(infoUser.birthday).format('DD/MM/YYYY')}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -685,10 +687,10 @@ const ProfileScreen = ({
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.PLACE_OF_COUNTRY}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.PLACE_OF_COUNTRY}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.domicile}
</Text>
</AppText>
</View>
</View>
<View style={styles.rightView}>
......@@ -697,10 +699,10 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
<View>
<Text>Nơi sinh</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>Nơi sinh</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.birthplace}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -709,10 +711,10 @@ const ProfileScreen = ({
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.NATIONALITY}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.NATIONALITY}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.nationality}
</Text>
</AppText>
</View>
</View>
<View style={styles.rightView}>
......@@ -721,10 +723,10 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
<View>
<Text>{string.ETHNIC}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{string.ETHNIC}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.ethnic}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -733,10 +735,10 @@ const ProfileScreen = ({
<View style={{flexDirection: 'row', flex: 1}}>
<Image source={IMAGES.IcInfoGuess} />
<View style={{marginLeft: 5}}>
<Text>{strings.RELIGION}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.RELIGION}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.religion}
</Text>
</AppText>
</View>
</View>
<View style={styles.rightView}>
......@@ -745,10 +747,10 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
<View>
<Text>{strings.MST}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.MST}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.personal_tax_code}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -759,10 +761,10 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
<View style={{marginLeft: 5}}>
<Text>{strings.PERMANENT_ADDRESS}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.PERMANENT_ADDRESS}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.permanent_address}
</Text>
</AppText>
</View>
</View>
{/* row 7 */}
......@@ -772,10 +774,10 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
<View style={{marginLeft: 5}}>
<Text>{strings.RESIDENTIAL_ADDRESS}</Text>
<Text style={{color: 'black', fontSize: 15}}>
<AppText>{strings.RESIDENTIAL_ADDRESS}</AppText>
<AppText style={{color: 'black', fontSize: 15}}>
{userDetails.address}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -785,7 +787,7 @@ const ProfileScreen = ({
{/* row 1 */}
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>S CMND</Text>
<AppText style={{fontSize: 12}}>S CMND</AppText>
<TextInputComponent
maxLength={12}
styleAreaInput={{backgroundColor: 'white'}}
......@@ -809,7 +811,7 @@ const ProfileScreen = ({
id_card_issue_date: true,
}))
}>
<Text style={{fontSize: 12}}>Ngày cp CMND</Text>
<AppText style={{fontSize: 12}}>Ngày cp CMND</AppText>
<TextInputComponent
disable={true}
styleAreaInput={{backgroundColor: 'white'}}
......@@ -846,7 +848,7 @@ const ProfileScreen = ({
{/* row 2 */}
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Nơi cp CMND</Text>
<AppText style={{fontSize: 12}}>Nơi cp CMND</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Nơi cấp CMND'}
......@@ -869,7 +871,7 @@ const ProfileScreen = ({
birthday: true,
}))
}>
<Text style={{fontSize: 12}}>Ngày sinh</Text>
<AppText style={{fontSize: 12}}>Ngày sinh</AppText>
<TextInputComponent
disable={true}
styleAreaInput={{backgroundColor: 'white'}}
......@@ -900,7 +902,7 @@ const ProfileScreen = ({
{/* row 3 */}
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Nguyên Quán</Text>
<AppText style={{fontSize: 12}}>Nguyên Quán</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Nguyên Quán'}
......@@ -916,7 +918,7 @@ const ProfileScreen = ({
/>
</View>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Nơi sinh</Text>
<AppText style={{fontSize: 12}}>Nơi sinh</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Nơi sinh'}
......@@ -935,7 +937,7 @@ const ProfileScreen = ({
{/* row 4 */}
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Quc tch</Text>
<AppText style={{fontSize: 12}}>Quc tch</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Quốc tịch'}
......@@ -951,7 +953,7 @@ const ProfileScreen = ({
/>
</View>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Dân tc</Text>
<AppText style={{fontSize: 12}}>Dân tc</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Dân tộc'}
......@@ -970,7 +972,7 @@ const ProfileScreen = ({
{/* row 5 */}
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Tôn giáo</Text>
<AppText style={{fontSize: 12}}>Tôn giáo</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Tôn giáo'}
......@@ -986,7 +988,7 @@ const ProfileScreen = ({
/>
</View>
<View style={{flex: 1, paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Mã s thuế</Text>
<AppText style={{fontSize: 12}}>Mã s thuế</AppText>
<TextInputComponent
maxLength={20}
styleAreaInput={{backgroundColor: 'white'}}
......@@ -1005,7 +1007,7 @@ const ProfileScreen = ({
</View>
{/* row 6 */}
<View style={{paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Địa ch thường trú</Text>
<AppText style={{fontSize: 12}}>Địa ch thường trú</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Địa chỉ thường trú'}
......@@ -1022,7 +1024,7 @@ const ProfileScreen = ({
</View>
{/* row 7 */}
<View style={{paddingLeft: 10, paddingRight: 10}}>
<Text style={{fontSize: 12}}>Địa ch liên h</Text>
<AppText style={{fontSize: 12}}>Địa ch liên h</AppText>
<TextInputComponent
styleAreaInput={{backgroundColor: 'white'}}
placeholder={'Địa chỉ liên hệ'}
......@@ -1044,9 +1046,9 @@ const ProfileScreen = ({
<View style={[styles.viewInfo, styles.marginBottom]}>
{/* edit */}
<View style={styles.viewTitle}>
<Text style={{color: 'black', fontSize: 18, flex: 1}}>
<AppText style={{color: 'black', fontSize: 18, flex: 1}}>
Thông tin liên lc
</Text>
</AppText>
<View
style={{
justifyContent: 'flex-end',
......@@ -1073,12 +1075,12 @@ const ProfileScreen = ({
setBtnAvailable(prev => ({...prev, contactBtn: false}));
}}
style={styles.btnCancel}>
<Text style={styles.blueTxt}>Hy</Text>
<AppText style={styles.blueTxt}>Hy</AppText>
</TouchableOpacity>
<TouchableOpacity
style={styles.btnSubmit}
onPress={() => onSubmitChangeContactUser()}>
<Text style={styles.whiteTxt}>Lưu</Text>
<AppText style={styles.whiteTxt}>Lưu</AppText>
</TouchableOpacity>
</View>
)}
......@@ -1094,9 +1096,9 @@ const ProfileScreen = ({
style={{height: 25, width: 25}}
/>
<View style={{marginLeft: 5, justifyContent: 'center'}}>
<Text style={{color: 'black', fontSize: 15}}>
<AppText style={{color: 'black', fontSize: 15}}>
{item.contact_unique_id}
</Text>
</AppText>
</View>
</View>
</View>
......@@ -1252,10 +1254,10 @@ const ProfileScreen = ({
}}
/>
{userInputContact.type.length <= 0 && (
<Text style={{fontSize: 12, color: 'red'}}>
<AppText style={{fontSize: 12, color: 'red'}}>
{' '}
Vui lòng chn liên h
</Text>
</AppText>
)}
</View>
<View style={{flex: 1}}>
......@@ -1273,10 +1275,10 @@ const ProfileScreen = ({
}
/>
{userInputContact.text.length <= 0 && (
<Text style={{fontSize: 12, color: 'red'}}>
<AppText style={{fontSize: 12, color: 'red'}}>
{' '}
Vui lòng nhp liên h
</Text>
</AppText>
)}
</View>
</View>
......
/* eslint-disable prettier/prettier */
import React from 'react';
import {useSelector} from 'react-redux';
import {authSelector} from '../../app/selectors';
import ProfileContainer from './ProfileContainer';
export default function ProfileScreen() {
const userDetails = useSelector(authSelector);
const profileScreenProps = {
userDetails,
};
return <ProfileContainer {...profileScreenProps} />;
}
import React, {useEffect, useState, useCallback} from 'react';
/* eslint-disable prettier/prettier */
import React, {useCallback, useEffect, useState} from 'react';
import {useDispatch, useSelector} from 'react-redux';
import SalaryScreen from './SalaryScreen';
import {
getPaySlipSections,
getSalariesUser,
getUserSheet,
getPaySlipSections,
} from '../../store/actions/UserAction';
const SalaryContainer = () => {
import SalaryScreen from './SalaryScreen';
const SalaryContainer = props => {
const {userDetails} = props;
const dispatch = useDispatch();
const userDetails = useSelector(state => state.UserInfo.userInfo);
const bankAccount = useSelector(state => state.SalaryUser.bankAccount);
// const salaryData = useSelector(state => state.SalaryUser.salaryData);
// const allowanceData = useSelector(state => state.SalaryUser.allowanceData);
const saBooksInfo = useSelector(state => state.SalaryUser.saBooks);
const [tableData, setTableData] = useState([]);
const [isShow, setIsShow] = useState(false);
......
import React, {useEffect, useState} from 'react';
import {SafeAreaView, ScrollView, Image, Text, View} from 'react-native';
import styles from './style';
import {IMAGES, GifType} from '../../values/images';
/* eslint-disable prettier/prettier */
import Moment from 'moment';
import ButtonComponent from '../../components/ButtonComponent';
import React from 'react';
import {Image, SafeAreaView, ScrollView, View} from 'react-native';
import FastImage from 'react-native-fast-image';
import AppText from '../../components/AppText';
import ButtonComponent from '../../components/ButtonComponent';
import {GifType, IMAGES} from '../../values/images';
import styles from './style';
const SalaryScreen = ({
userDetails,
bankAccount,
......@@ -22,12 +24,13 @@ const SalaryScreen = ({
<SafeAreaView>
<ScrollView nestedScrollEnabled={true}>
<View style={styles.view}>
<Text style={{fontWeight: 'bold', marginBottom: 10, color: 'black'}}>
<AppText
style={{fontWeight: 'bold', marginBottom: 10, color: 'black'}}>
Phiếu lương
</Text>
</AppText>
<View style={{flexDirection: 'row', justifyContent: 'space-between'}}>
<Text>K lương tháng 11</Text>
<Text>01/11/2021 - 30/11/2021</Text>
<AppText>K lương tháng 11</AppText>
<AppText>01/11/2021 - 30/11/2021</AppText>
</View>
<View style={[styles.marginTop, {marginTop: 10}]}>
<View style={{flex: 1}}>
......@@ -60,7 +63,7 @@ const SalaryScreen = ({
styleIcon={{width: 20, height: 20}}
onPress={prevPayItem}
/>
<Text>{showNamePayItem}</Text>
<AppText>{showNamePayItem}</AppText>
<ButtonComponent
iconSource={IMAGES.IcArrowRight}
styleIcon={{width: 20, height: 20}}
......@@ -81,39 +84,39 @@ const SalaryScreen = ({
style={{width: 80, height: 80}}
/>
<View style={{marginLeft: 15}}>
<Text style={{color: 'black', fontWeight: 'bold'}}>{`${
<AppText style={{color: 'black', fontWeight: 'bold'}}>{`${
userDetails.first_name
} ${userDetails.middle_name ? userDetails.middle_name : ''} ${
userDetails.last_name
}`}</Text>
<Text style={{paddingTop: 5}}>{userDetails.position}</Text>
}`}</AppText>
<AppText style={{paddingTop: 5}}>{userDetails.position}</AppText>
</View>
</View>
<View style={[styles.marginTop, {marginTop: 10}]}>
<Text style={{color: 'black', fontWeight: '500'}}>
<AppText style={{color: 'black', fontWeight: '500'}}>
Ngày vào công ty
</Text>
<Text>
</AppText>
<AppText>
{userDetails.join_date &&
Moment(userDetails.join_date).format('DD/MM/YYYY')}
</Text>
</AppText>
</View>
<View style={styles.marginTop}>
<Text style={{color: 'black', fontWeight: '500', flex: 1}}>
<AppText style={{color: 'black', fontWeight: '500', flex: 1}}>
Tên ngân hàng
</Text>
</AppText>
{bankAccount && bankAccount.length > 0 && (
<Text style={{textAlign: 'right', flex: 1}}>
<AppText style={{textAlign: 'right', flex: 1}}>
{bankAccount[0].extend_bank_brand_name}
</Text>
</AppText>
)}
</View>
<View style={[styles.marginTop, {marginBottom: 30}]}>
<Text style={{color: 'black', fontWeight: '500'}}>
<AppText style={{color: 'black', fontWeight: '500'}}>
S tài khon
</Text>
</AppText>
{bankAccount && bankAccount.length > 0 && (
<Text>{bankAccount[0].bank_account}</Text>
<AppText>{bankAccount[0].bank_account}</AppText>
)}
</View>
<View>
......@@ -124,9 +127,9 @@ const SalaryScreen = ({
backgroundColor: '#e3e5ed',
padding: 5,
}}>
<Text style={{color: 'black', fontWeight: 'bold'}}>
<AppText style={{color: 'black', fontWeight: 'bold'}}>
Phiếu lương
</Text>
</AppText>
</View>
{tableData &&
tableData.map((item, index) => {
......@@ -135,7 +138,7 @@ const SalaryScreen = ({
key={item.id + '_' + index}
style={{borderBottomWidth: 1, flexDirection: 'row'}}>
<View style={{flex: 1, borderRightWidth: 1, padding: 10}}>
<Text>{item.extend_collumn_name}</Text>
<AppText>{item.extend_collumn_name}</AppText>
</View>
<View
style={{
......@@ -144,13 +147,13 @@ const SalaryScreen = ({
alignItems: 'flex-end',
padding: 10,
}}>
<Text>
<AppText>
{isShow
? (
parseFloat(item.extend_value).toFixed(0) + ''
).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1.')
: '*****'}
</Text>
</AppText>
</View>
</View>
);
......@@ -165,9 +168,9 @@ const SalaryScreen = ({
marginTop: 10,
padding: 20,
}}>
<Text style={{textAlign: 'center'}}>
<AppText style={{textAlign: 'center'}}>
Bn chưa có bng lương nào, Cùng làm vic tht chăm ch nhé!
</Text>
</AppText>
<FastImage
source={GifType.gifSalary}
style={{width: '90%', height: 250}}
......
/* eslint-disable prettier/prettier */
import React from 'react';
import {useSelector} from 'react-redux';
import {authSelector} from '../../app/selectors';
import SalaryContainer from './SalaryContainer';
export default function SalaryScreen() {
const userDetails = useSelector(authSelector);
const salaryScreenProps = {
userDetails,
};
return <SalaryContainer {...salaryScreenProps} />;
}
/* eslint-disable prettier/prettier */
/* eslint-disable react-native/no-inline-styles */
import React from 'react';
import {useState, useRef, useCallback} from 'react';
import Moment from 'moment';
import React, {useState} from 'react';
import {
FlatList,
Image,
SafeAreaView,
Text,
TextInput,
ScrollView,
TouchableOpacity,
View,
ScrollView,
} from 'react-native';
import Moment from 'moment';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import SelectDropdown from 'react-native-select-dropdown';
//import {ScrollView} from 'react-native-virtualized-view';
import Alert from 'react-native-awesome-alerts';
import ButtonComponent from '../../components/ButtonComponent';
import LoadingProgress from '../../components/LoadingProgress';
import TextInputComponent from '../../components/TextInputComponent';
import colors from '../../values/colors';
import {IconTimeSheet, IMAGES, IconProfile} from '../../values/images';
import {IconTimeSheet, IMAGES} from '../../values/images';
import ConfirmedShiftContainer from './shift-tabs/ConfirmedShiftScreen/ConfirmedShiftContainer';
import {contentStyle, mainStyle} from './style';
import Alert from 'react-native-awesome-alerts';
import AppText from '../../components/AppText';
const ShiftScreen = ({
userDetails,
prevWeek,
......@@ -82,7 +80,7 @@ const ShiftScreen = ({
height: 30,
}}>
<View style={contentStyle.viewItemDay}>
<Text>{item.title ? item.title : ''}</Text>
<AppText>{item.title ? item.title : ''}</AppText>
</View>
<View
style={{
......@@ -90,13 +88,13 @@ const ShiftScreen = ({
justifyContent: 'center',
alignItems: 'center',
}}>
<Text>
<AppText>
{item.time && item.time.toString().includes(':')
? item.time
: item.time !== 0 && item.time !== ''
? Moment(item.time).format('HH:mm')
: '00:00'}
</Text>
</AppText>
<DateTimePickerModal
isVisible={item.isOpen}
mode="time"
......@@ -118,9 +116,9 @@ const ShiftScreen = ({
borderWidth: 0.5,
height: 30,
}}>
<Text style={{color: '#ffa117', fontWeight: '500'}}>{`${
<AppText style={{color: '#ffa117', fontWeight: '500'}}>{`${
item.title
} ${totalTime || 0}`}</Text>
} ${totalTime || 0}`}</AppText>
</View>
)}
</View>
......@@ -145,13 +143,13 @@ const ShiftScreen = ({
borderBottomWidth: tabChange === 'MY-SHIFT' ? 1 : 0,
borderBottomColor: '#5d78ff',
}}>
<Text
<AppText
style={{
color: tabChange === 'MY-SHIFT' ? '#5d78ff' : '#959595',
fontWeight: '500',
}}>
Timesheet ca tôi
</Text>
</AppText>
</TouchableOpacity>
<TouchableOpacity
style={{
......@@ -159,13 +157,13 @@ const ShiftScreen = ({
borderBottomColor: '#5d78ff',
}}
onPress={() => onTabChange('CONFIRMED-SHIFT')}>
<Text
<AppText
style={{
color: tabChange !== 'MY-SHIFT' ? '#5d78ff' : '#959595',
fontWeight: '500',
}}>
Timesheet cn duyt
</Text>
</AppText>
</TouchableOpacity>
</View>
{tabChange === 'MY-SHIFT' ? (
......@@ -176,12 +174,14 @@ const ShiftScreen = ({
style={{width: 70, height: 70}}
/>
<View style={{marginLeft: 15, justifyContent: 'center'}}>
<Text style={{color: '#434349', fontWeight: '500'}}>{`${
<AppText style={{color: '#434349', fontWeight: '500'}}>{`${
userDetails.first_name
} ${userDetails.middle_name ? userDetails.middle_name : ''} ${
userDetails.last_name
} (${userDetails.employee_code})`}</Text>
<Text style={{fontSize: 13}}>{userDetails.department}</Text>
} (${userDetails.employee_code})`}</AppText>
<AppText style={{fontSize: 13}}>
{userDetails.department}
</AppText>
</View>
</View>
<View
......@@ -190,8 +190,8 @@ const ShiftScreen = ({
{justifyContent: 'space-between', alignItems: 'center'},
]}>
<View style={{flexDirection: 'row'}}>
<Text style={{color: '#5c65dc'}}>Tng gi tun này:</Text>
<Text style={{color: '#ffa117'}}> {totalTime} gi</Text>
<AppText style={{color: '#5c65dc'}}>Tng gi tun này:</AppText>
<AppText style={{color: '#ffa117'}}> {totalTime} gi</AppText>
</View>
<ButtonComponent
iconSource={IconTimeSheet.IcCopyBlue}
......@@ -221,14 +221,14 @@ const ShiftScreen = ({
paddingLeft: 10,
paddingRight: 10,
}}>
<Text style={{color: '#615f71', fontWeight: '500'}}>
<AppText style={{color: '#615f71', fontWeight: '500'}}>
{`Tuần ${numberWeekOfYear} `}{' '}
</Text>
<Text>{`${Moment(managerDate.currentDate).format(
</AppText>
<AppText>{`${Moment(managerDate.currentDate).format(
'DD/MM/YYYY',
)} - ${Moment(managerDate.theWeekend).format(
'DD/MM/YYYY',
)}`}</Text>
)}`}</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{height: 20, width: 20, marginLeft: 10}}
......@@ -358,9 +358,9 @@ const ShiftScreen = ({
disable={managerDisabled.desInput}
/>
{error && (
<Text style={{color: 'red', fontSize: 12}}>
<AppText style={{color: 'red', fontSize: 12}}>
Vui lòng nhp chi tiết công vic
</Text>
</AppText>
)}
{item.isDes && (
<TextInputComponent
......@@ -391,7 +391,7 @@ const ShiftScreen = ({
}
numColumns={2}
ListHeaderComponent={() => {
<Text>AAA</Text>;
<AppText>AAA</AppText>;
}}
/> */}
{item.calendar &&
......@@ -421,7 +421,9 @@ const ShiftScreen = ({
height: 30,
}}>
<View style={contentStyle.viewItemDay}>
<Text>{el.title ? el.title : ''}</Text>
<AppText>
{el.title ? el.title : ''}
</AppText>
</View>
<View
style={{
......@@ -429,14 +431,14 @@ const ShiftScreen = ({
justifyContent: 'center',
alignItems: 'center',
}}>
<Text>
<AppText>
{el.time &&
el.time.toString().includes(':')
? el.time
: el.time !== 0 && el.time !== ''
? Moment(el.time).format('HH:mm')
: '00:00'}
</Text>
</AppText>
<DateTimePickerModal
isVisible={el.isOpen}
mode="time"
......@@ -465,13 +467,13 @@ const ShiftScreen = ({
borderWidth: 0.5,
height: 30,
}}>
<Text
<AppText
style={{
color: '#ffa117',
fontWeight: '500',
}}>{`${el.title} ${
totalTime || 0
}`}</Text>
}`}</AppText>
</View>
)}
</View>
......@@ -513,15 +515,15 @@ const ShiftScreen = ({
)} */}
<View style={{flexDirection: 'row'}}>
<View style={{justifyContent: 'flex-start', flex: 6}}>
<Text
<AppText
style={{
fontSize: 14,
color: 'black',
fontWeight: 'bold',
}}>
{item.projectName}
</Text>
<Text>{item.taskName}</Text>
</AppText>
<AppText>{item.taskName}</AppText>
</View>
<TouchableOpacity
onPress={() => onExpandView(index_arr)}
......
/* eslint-disable prettier/prettier */
/* eslint-disable react/jsx-no-undef */
/* eslint-disable prettier/prettier */
import moment from 'moment';
import React from 'react';
import {
FlatList,
Image,
SafeAreaView,
ScrollView,
Text,
TouchableOpacity,
View,
FlatList,
} from 'react-native';
import AppText from '../../../../../components/AppText';
import ButtonComponent from '../../../../../components/ButtonComponent';
import TextInputComponent from '../../../../../components/TextInputComponent';
import colors from '../../../../../values/colors';
import {IconTimeSheet, IMAGES} from '../../../../../values/images';
import {mainStyle} from './style';
import colors from '../../../../../values/colors';
import TextInputComponent from '../../../../../components/TextInputComponent';
const ConfirmedShiftDetailScreen = ({
numberWeekOfYear,
managerDate,
......@@ -49,7 +47,7 @@ const ConfirmedShiftDetailScreen = ({
height: 30,
}}>
<View style={mainStyle.viewItemDay}>
<Text>{item.title ? item.title : ''}</Text>
<AppText>{item.title ? item.title : ''}</AppText>
</View>
<View
style={{
......@@ -57,13 +55,13 @@ const ConfirmedShiftDetailScreen = ({
justifyContent: 'center',
alignItems: 'center',
}}>
<Text>
<AppText>
{item.time && item.time.toString().includes(':')
? item.time
: item.time !== 0 && item.time !== ''
? moment(item.time).format('HH:mm')
: '00:00'}
</Text>
</AppText>
</View>
</TouchableOpacity>
) : (
......@@ -76,9 +74,9 @@ const ConfirmedShiftDetailScreen = ({
borderWidth: 0.5,
height: 30,
}}>
<Text style={{color: '#ffa117', fontWeight: '500'}}>{`${
<AppText style={{color: '#ffa117', fontWeight: '500'}}>{`${
item.title
} ${totalTime || 0}`}</Text>
} ${totalTime || 0}`}</AppText>
</View>
)}
</View>
......@@ -92,9 +90,9 @@ const ConfirmedShiftDetailScreen = ({
{/* <HeaderComponent {...props} /> */}
<ScrollView nestedScrollEnabled={true} style={{padding: 5}}>
<View>
<Text style={{marginBottom: 16, fontWeight: 'bold'}}>
<AppText style={{marginBottom: 16, fontWeight: 'bold'}}>
{userInfo?.extend_user_full_name} -{userInfo?.employee_code}
</Text>
</AppText>
<View style={[mainStyle.row, {justifyContent: 'space-between'}]}>
<ButtonComponent
style={{
......@@ -114,14 +112,14 @@ const ConfirmedShiftDetailScreen = ({
paddingLeft: 10,
paddingRight: 10,
}}>
<Text style={{color: '#615f71', fontWeight: '500'}}>
<AppText style={{color: '#615f71', fontWeight: '500'}}>
{`Tuần ${numberWeekOfYear} `}{' '}
</Text>
<Text>{`${moment(managerDate?.currentDate).format(
</AppText>
<AppText>{`${moment(managerDate?.currentDate).format(
'DD/MM/YYYY',
)} - ${moment(managerDate?.theWeekend).format(
'DD/MM/YYYY',
)}`}</Text>
)}`}</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{height: 20, width: 20, marginLeft: 10}}
......@@ -146,20 +144,24 @@ const ConfirmedShiftDetailScreen = ({
marginTop: 16,
}}>
<View style={mainStyle.boxButton}>
<Text style={{color: '#646c9a', fontWeight: 'bold'}}>
<AppText style={{color: '#646c9a', fontWeight: 'bold'}}>
Tổng giờ tuần này:{' '}
<Text style={{color: '#f9bf5a', fontWeight: 'bold'}}>22:00</Text>
</Text>
<AppText style={{color: '#f9bf5a', fontWeight: 'bold'}}>
22:00
</AppText>
</AppText>
</View>
<TouchableOpacity
style={mainStyle.boxButton}
onPress={() => getNumberWeekOfYear(new Date())}>
<Text style={{color: '#646c9a', fontWeight: 'bold'}}>Tuần này</Text>
<AppText style={{color: '#646c9a', fontWeight: 'bold'}}>
Tuần này
</AppText>
</TouchableOpacity>
</View>
<View style={{marginTop: 10}}>
{confirmSheetDetail?.timesheet?.length === 0 ? (
<Text style={{textAlign: 'center'}}>Không có dữ liệu</Text>
<AppText style={{textAlign: 'center'}}>Không có dữ liệu</AppText>
) : (
<View>
{confirmSheetDetail &&
......@@ -180,26 +182,26 @@ const ConfirmedShiftDetailScreen = ({
/>
<View style={{padding: 10}}>
<View style={{marginBottom: 10}}>
<Text style={mainStyle.subtitle}>Dự án</Text>
<Text style={mainStyle.txtItem}>
<AppText style={mainStyle.subtitle}>Dự án</AppText>
<AppText style={mainStyle.txtItem}>
{item.projectName}
</Text>
</AppText>
</View>
<View style={{marginBottom: 10}}>
<Text style={mainStyle.subtitle}>
<AppText style={mainStyle.subtitle}>
Tên công việc
</Text>
<Text style={mainStyle.txtItem}>
</AppText>
<AppText style={mainStyle.txtItem}>
{item.taskName}
</Text>
</AppText>
</View>
<View style={{marginBottom: 10}}>
<Text style={mainStyle.subtitle}>
<AppText style={mainStyle.subtitle}>
Ghi chú trong tuần
</Text>
<Text style={mainStyle.txtItem}>
</AppText>
<AppText style={mainStyle.txtItem}>
{item.description}
</Text>
</AppText>
</View>
</View>
<View>
......@@ -230,15 +232,15 @@ const ConfirmedShiftDetailScreen = ({
]}>
<View style={{flexDirection: 'row'}}>
<View style={{justifyContent: 'flex-start', flex: 6}}>
<Text
<AppText
style={{
fontSize: 14,
color: 'black',
fontWeight: 'bold',
}}>
{item.projectName}
</Text>
<Text>{item.taskName}</Text>
</AppText>
<AppText>{item.taskName}</AppText>
</View>
<TouchableOpacity
onPress={() => onExpandView(index_arr)}
......@@ -286,14 +288,14 @@ const ConfirmedShiftDetailScreen = ({
onChangeText={text => setFeedback(text)}
/>
{feedBack.length == 0 && (
<Text
<AppText
style={{
marginTop: -20,
color: 'red',
marginBottom: 10,
}}>
*Vui lòng nhập nhận xét
</Text>
</AppText>
)}
<View style={mainStyle.viewBtn}>
<ButtonComponent
......
/* eslint-disable prettier/prettier */
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable prettier/prettier */
/* eslint-disable react-native/no-inline-styles */
/* eslint-disable prettier/prettier */
/* eslint-disable no-unused-vars */
import moment from 'moment';
import React, {useEffect, useRef, useState} from 'react';
import React, { useEffect, useRef, useState } from 'react';
import {
Image,
SafeAreaView,
Text,
TextInput,
TouchableOpacity,
View,
} from 'react-native';
import SelectDropdown from 'react-native-select-dropdown';
import AppText from '../../../../components/AppText';
import ButtonComponent from '../../../../components/ButtonComponent';
import {IconTimeSheet, IMAGES} from '../../../../values/images';
import { IconTimeSheet, IMAGES } from '../../../../values/images';
import ConfirmedShiftDetailContainer from './ConfirmedShiftDetail/ConfirmedShiftDetailContainer';
import {mainStyle} from './style';
import { mainStyle } from './style';
const statusDropdownData = [
'Tất cả trạng thái',
'Chờ duyệt',
......@@ -40,8 +35,6 @@ const ConfirmedShiftScreen = ({
onPageNext,
onPagePrevious,
}) => {
//Search
const [searchTerm, setSearchTerm] = useState('');
const typingTimeoutRef = useRef(null);
const [isDesOpen, setOpenDes] = useState(false);
......@@ -52,7 +45,6 @@ const ConfirmedShiftScreen = ({
const [userId, setUserId] = useState();
const handleSearchDebounce = text => {
const value = text;
setSearchTerm(value);
if (typingTimeoutRef.current) {
clearTimeout(typingTimeoutRef.current);
......@@ -167,14 +159,14 @@ const ConfirmedShiftScreen = ({
paddingLeft: 10,
paddingRight: 10,
}}>
<Text style={{color: '#615f71', fontWeight: '500'}}>
<AppText style={{color: '#615f71', fontWeight: '500'}}>
{`Tuần ${numberWeekOfYear} `}{' '}
</Text>
<Text>{`${moment(managerDate?.currentDate).format(
</AppText>
<AppText>{`${moment(managerDate?.currentDate).format(
'DD/MM/YYYY',
)} - ${moment(managerDate?.theWeekend).format(
'DD/MM/YYYY',
)}`}</Text>
)}`}</AppText>
<Image
source={IMAGES.IcCalendarGray}
style={{height: 20, width: 20, marginLeft: 10}}
......@@ -193,7 +185,9 @@ const ConfirmedShiftScreen = ({
{/* Table header */}
<View>
<View style={{...mainStyle.rowSpaceBetween, marginTop: 16}}>
<Text style={mainStyle.textTitle}>Danh sách nhân viên</Text>
<AppText style={mainStyle.textTitle}>
Danh sách nhân viên
</AppText>
<SelectDropdown
data={statusDropdownData}
buttonStyle={mainStyle.statusButtonDropdown}
......@@ -210,17 +204,19 @@ const ConfirmedShiftScreen = ({
width: '20%',
paddingLeft: 12,
}}>
<Text style={mainStyle.tableHeaderTitle}>#</Text>
<AppText style={mainStyle.tableHeaderTitle}>#</AppText>
</View>
<View
style={{...mainStyle.tableHeaderContainer, width: '35%'}}>
<Text style={mainStyle.tableHeaderTitle}>Nhân viên</Text>
<AppText style={mainStyle.tableHeaderTitle}>
Nhân viên
</AppText>
</View>
<View
style={{...mainStyle.tableHeaderContainer, width: '35%'}}>
<Text style={mainStyle.tableHeaderTitle}>
<AppText style={mainStyle.tableHeaderTitle}>
Trạng thái timesheet
</Text>
</AppText>
</View>
<View
style={{
......@@ -235,16 +231,16 @@ const ConfirmedShiftScreen = ({
<View key={index}>
<View style={mainStyle.tableRowContent}>
<View style={{width: '20%', paddingLeft: 12}}>
<Text
<AppText
style={{fontWeight: 'bold', color: '#313131'}}>
{index + 1}
</Text>
</AppText>
</View>
<View style={{width: '35%'}}>
<Text
<AppText
style={{fontWeight: 'bold', color: '#313131'}}>
{el?.user?.extend_user_full_name || '--'}
</Text>
</AppText>
</View>
<View
style={{
......@@ -260,10 +256,10 @@ const ConfirmedShiftScreen = ({
: '#757575',
marginRight: 8,
}}></View>
<Text
<AppText
style={{fontWeight: 'bold', color: '#313131'}}>
{el?.user?.status}
</Text>
</AppText>
</View>
<View style={{width: '10%'}}>
{el?.isExpand ? (
......@@ -291,16 +287,16 @@ const ConfirmedShiftScreen = ({
<View
style={{width: '20%', paddingLeft: 12}}></View>
<View style={{width: '35%'}}>
<Text>Mã nhân viên</Text>
<AppText>Mã nhân viên</AppText>
</View>
<View style={{width: '35%'}}>
<Text
<AppText
style={{
fontWeight: 'bold',
color: '#313131',
}}>
{el?.user?.employee_code || '--'}
</Text>
</AppText>
</View>
<View style={{width: '10%'}}></View>
</View>
......@@ -308,16 +304,16 @@ const ConfirmedShiftScreen = ({
<View
style={{width: '20%', paddingLeft: 12}}></View>
<View style={{width: '35%'}}>
<Text>Phòng ban</Text>
<AppText>Phòng ban</AppText>
</View>
<View style={{width: '35%'}}>
<Text
<AppText
style={{
fontWeight: 'bold',
color: '#313131',
}}>
{el?.user?.department || '--'}
</Text>
</AppText>
</View>
<View style={{width: '10%'}}></View>
</View>
......@@ -325,16 +321,16 @@ const ConfirmedShiftScreen = ({
<View
style={{width: '20%', paddingLeft: 12}}></View>
<View style={{width: '35%'}}>
<Text>Chức vụ</Text>
<AppText>Chức vụ</AppText>
</View>
<View style={{width: '35%'}}>
<Text
<AppText
style={{
fontWeight: 'bold',
color: '#313131',
}}>
{el?.user?.position || '--'}
</Text>
</AppText>
</View>
<View style={{width: '10%'}}></View>
</View>
......@@ -342,16 +338,16 @@ const ConfirmedShiftScreen = ({
<View
style={{width: '20%', paddingLeft: 12}}></View>
<View style={{width: '35%'}}>
<Text>Số giờ</Text>
<AppText>Số giờ</AppText>
</View>
<View style={{width: '35%'}}>
<Text
<AppText
style={{
fontWeight: 'bold',
color: '#313131',
}}>
{el?.user?.extend_total_hour}
</Text>
</AppText>
</View>
<View style={{width: '10%'}}></View>
</View>
......@@ -388,9 +384,9 @@ const ConfirmedShiftScreen = ({
))
) : (
<View style={{marginTop: 8, marginBottom: 8}}>
<Text style={{textAlign: 'center'}}>
<AppText style={{textAlign: 'center'}}>
Không có dữ liệu
</Text>
</AppText>
</View>
)}
</View>
......@@ -411,7 +407,7 @@ const ConfirmedShiftScreen = ({
}}
/>
</TouchableOpacity>
<Text>{`Trang ${currentPage}/${totalPage}`}</Text>
<AppText>{`Trang ${currentPage}/${totalPage}`}</AppText>
<TouchableOpacity
onPress={() => onPageNext()}
disabled={currentPage === totalPage}>
......
/* eslint-disable prettier/prettier */
import Moment from 'moment';
import React, {useEffect, useState} from 'react';
import {useDispatch, useSelector} from 'react-redux';
import WorkLoadScreen from './WorkLoadScreen';
import {
getDescriptionTimekeeping,
getDataChartTimekeeping,
getDescriptionTimekeeping,
} from '../../store/actions/UserAction';
import Moment from 'moment';
import {APP_NAVIGATE_SCREEN} from '../../utils/constant';
import RootNavigation from '../../navigation/RootNavigation';
const WorkLoadContainer = () => {
import WorkLoadScreen from './WorkLoadScreen';
const WorkLoadContainer = props => {
const {userDetails} = props;
const dispatch = useDispatch();
const userDetails = useSelector(state => state.UserInfo.userInfo);
const loadingDataChart = useSelector(
state => state.LoadingDataChart.isLoading,
);
......
import React, {useEffect, useState} from 'react';
import {
SafeAreaView,
TouchableOpacity,
Image,
Text,
View,
TextInput,
LogBox,
ActivityIndicator,
Dimensions,
} from 'react-native';
import ButtonComponent from '../../components/ButtonComponent';
import {mainStyle, styles, contentStyle} from './style';
import {ScrollView} from 'react-native-virtualized-view';
/* eslint-disable prettier/prettier */
import CheckBox from '@react-native-community/checkbox';
import Moment from 'moment';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import React from 'react';
import {Dimensions, Image, SafeAreaView, View} from 'react-native';
import {BarChart} from 'react-native-chart-kit';
import {Table, Rows, Row, Cell} from 'react-native-table-component';
import CheckBox from '@react-native-community/checkbox';
import {IMAGES} from '../../values/images';
import LoadingProgress from '../../components/LoadingProgress';
import DateTimePickerModal from 'react-native-modal-datetime-picker';
import SelectDropdown from 'react-native-select-dropdown';
import {ScrollView} from 'react-native-virtualized-view';
import AppText from '../../components/AppText';
import ButtonComponent from '../../components/ButtonComponent';
import LoadingProgress from '../../components/LoadingProgress';
import {IMAGES} from '../../values/images';
import {contentStyle, mainStyle, styles} from './style';
const WorkLoadScreen = ({
userDetails,
table,
......@@ -65,7 +56,9 @@ const WorkLoadScreen = ({
backgroundColor: 'white',
marginTop: 10,
}}>
<Text style={contentStyle.txtTitle}>Thng kê phm vi trong k</Text>
<AppText style={contentStyle.txtTitle}>
Thng kê phm vi trong k
</AppText>
<SelectDropdown
data={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}
defaultValue={chooseMonth.getMonth() + 1}
......@@ -120,12 +113,12 @@ const WorkLoadScreen = ({
</View>
</ScrollView>
<View style={[mainStyle.viewChart, {marginBottom: 30}]}>
<Text style={contentStyle.txtTitle}>Chi tiết chm công</Text>
<AppText style={contentStyle.txtTitle}>Chi tiết chm công</AppText>
<View style={{paddingLeft: 10, marginBottom: 20}}>
<View style={{flexDirection: 'row', marginBottom: 5}}>
{/* start */}
<View style={{flex: 1, marginRight: 10}}>
<Text style={contentStyle.subText}>T ngày</Text>
<AppText style={contentStyle.subText}>T ngày</AppText>
<ButtonComponent
style={[contentStyle.viewCalendar]}
text={Moment(timeFilter.start).format('DD/MM/YYYY')}
......@@ -133,7 +126,7 @@ const WorkLoadScreen = ({
iconSource={IMAGES.IcCalendarGray}
styleIcon={contentStyle.btnIcon}
/>
<Text style={contentStyle.subText}>Lc t ngày...</Text>
<AppText style={contentStyle.subText}>Lc t ngày...</AppText>
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<CheckBox
disabled={false}
......@@ -142,7 +135,9 @@ const WorkLoadScreen = ({
setToggleCheckBox({start: newValue})
}
/>
<Text style={{fontSize: 12}}>Ch hin đi tr, v sm</Text>
<AppText style={{fontSize: 12}}>
Ch hin đi tr, v sm
</AppText>
</View>
<DateTimePickerModal
isVisible={openTimePicker.start}
......@@ -155,7 +150,7 @@ const WorkLoadScreen = ({
{/* from */}
<View style={{flex: 1}}>
<Text style={contentStyle.subText}>Đến ngày</Text>
<AppText style={contentStyle.subText}>Đến ngày</AppText>
<ButtonComponent
style={contentStyle.viewCalendar}
text={Moment(timeFilter.finish).format('DD/MM/YYYY')}
......@@ -163,7 +158,7 @@ const WorkLoadScreen = ({
iconSource={IMAGES.IcCalendarGray}
styleIcon={contentStyle.btnIcon}
/>
<Text style={contentStyle.subText}>Lc đến ngày...</Text>
<AppText style={contentStyle.subText}>Lc đến ngày...</AppText>
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<CheckBox
disabled={false}
......@@ -172,7 +167,7 @@ const WorkLoadScreen = ({
setToggleCheckBox({finish: newValue})
}
/>
<Text style={{fontSize: 12}}>Ch hin đi tr</Text>
<AppText style={{fontSize: 12}}>Ch hin đi tr</AppText>
</View>
<DateTimePickerModal
isVisible={openTimePicker.finish}
......@@ -193,10 +188,10 @@ const WorkLoadScreen = ({
<View style={{marginBottom: 20}}>
<View
style={{flexDirection: 'row', borderWidth: 0.2, padding: 5}}>
<Text style={{flex: 2, fontWeight: '500'}}>Ngày</Text>
<Text style={{flex: 2, fontWeight: '500'}}>Gi vào</Text>
<Text style={{flex: 2, fontWeight: '500'}}>Gi ra</Text>
<Text style={{flex: 1, fontWeight: '500'}}>Tng</Text>
<AppText style={{flex: 2, fontWeight: '500'}}>Ngày</AppText>
<AppText style={{flex: 2, fontWeight: '500'}}>Gi vào</AppText>
<AppText style={{flex: 2, fontWeight: '500'}}>Gi ra</AppText>
<AppText style={{flex: 1, fontWeight: '500'}}>Tng</AppText>
</View>
{table &&
table.length >= 1 &&
......@@ -210,52 +205,52 @@ const WorkLoadScreen = ({
padding: 5,
}}>
<View style={{flexDirection: 'row'}}>
<Text
<AppText
style={[
{flex: 2, fontWeight: '500', color: 'black'},
item.isError && styles.errText,
]}>
{item.date}
</Text>
<Text
</AppText>
<AppText
style={[{flex: 2}, item.isError && styles.errText]}>
{item.time_input}
</Text>
<Text
</AppText>
<AppText
style={[{flex: 2}, item.isError && styles.errText]}>
{item.time_output}
</Text>
<Text
</AppText>
<AppText
style={[
{flex: 1, fontWeight: '500', color: 'black'},
item.isError && styles.errText,
]}>{`${item.total} giờ`}</Text>
]}>{`${item.total} giờ`}</AppText>
</View>
<View style={{flexDirection: 'row'}}>
<Text
<AppText
style={[{flex: 1}, item.isError && styles.errText]}>
Đi tr{' '}
</Text>
<Text
</AppText>
<AppText
style={[
contentStyle.boldTxt,
item.isError && styles.errText,
]}>
{item.time_work_late}
</Text>
</AppText>
</View>
<View style={{flexDirection: 'row'}}>
<Text
<AppText
style={[{flex: 1}, item.isError && styles.errText]}>
V sm{' '}
</Text>
<Text
</AppText>
<AppText
style={[
contentStyle.boldTxt,
item.isError && styles.errText,
]}>
{item.leave_early}
</Text>
</AppText>
</View>
</View>
);
......@@ -270,10 +265,10 @@ const WorkLoadScreen = ({
justifyContent: 'flex-end',
marginBottom: 50,
}}>
<Text
<AppText
style={{
marginRight: 10,
}}>{`${infoTable.from}-${infoTable.to} của ${infoTable.total}`}</Text>
}}>{`${infoTable.from}-${infoTable.to} của ${infoTable.total}`}</AppText>
<ButtonComponent
style={{marginRight: 10}}
iconSource={
......
/* eslint-disable prettier/prettier */
import React from 'react';
import {useSelector} from 'react-redux';
import {authSelector} from '../../app/selectors';
import WorkLoadContainer from './WorkLoadContainer';
export default function WorkLoadScreen() {
const userDetails = useSelector(authSelector);
const salaryScreenProps = {
userDetails,
};
return <WorkLoadContainer {...salaryScreenProps} />;
}
import OneSignal from 'react-native-onesignal';
import AuthApi from '../../network/api/authApi';
import RootNavigation from '../../navigation/RootNavigation';
import CommonApi from '../../network/api/commonApi';
import api from '../../network/axios';
import AsyncStorageService from '../../utils/AsyncStorageService';
import AuthApi from '../../network/api/authApi';
import {APP_NAVIGATE_SCREEN} from '../../utils/constant';
import ActionType from '../actions/types';
import OneSignal from 'react-native-onesignal';
import api from '../../network/axios';
export const getMyInfo = () => {
return async (dispatch, getState) => {
const response = await CommonApi.requestGetMyInfo();
......
import AsyncStorage from '@react-native-async-storage/async-storage';
import moment from 'moment';
import {Linking} from 'react-native';
import config from '../config';
const storeData = async (storageKey, value) => {
try {
const jsonValue = JSON.stringify(value);
await AsyncStorage.setItem(storageKey, jsonValue);
} catch (e) {
// saving error
}
};
const getData = async storageKey => {
try {
const jsonValue = await AsyncStorage.getItem(storageKey);
return jsonValue != null ? JSON.parse(jsonValue) : {};
} catch (e) {
// error reading value
}
};
const removeData = async storageKey => {
try {
await AsyncStorage.removeItem(storageKey);
} catch (e) {
// error reading value
}
};
// const startTime = new Date('2023-03-16T12:55:00+07:00');
const calculateElapsedSeconds = (eventDate, eventTime) => {
const eventDateTime = moment(
`${eventDate.split('T')[0]}T${eventTime ?? '13:00:00'}`,
);
const now = moment();
const elapsedSeconds = Math.max(eventDateTime.diff(now, 'seconds'), 0) - 300;
return elapsedSeconds <= 0 ? 0 : elapsedSeconds;
};
/**
* Nested Object or Array data value retriever
* @param source
* @param variables {string}
* @param fallbackValue {any}
* @param allowNull
* @returns {any|boolean|string}
*/
const getValues = (
source,
variables = '',
fallbackValue,
allowNull = false,
) => {
const targetValueHierarchy = (variables || '')
.toString()
.replace(/[[\]]/g, '.')
.split('.')
.filter(key => key !== '');
if (source === null && allowNull && targetValueHierarchy.length === 0) {
return null;
}
// Check for string type because string is subtype of Array
// Don't worry, if the data type not an object or array will fail after that.
if (!source || ['string, boolean'].includes(typeof source)) {
return fallbackValue;
}
// Retain data type cause data type is dynamic
let result = Object.assign(source);
for (let i = 0; i < targetValueHierarchy.length; i++) {
result = result[targetValueHierarchy[i]];
if (result === undefined) {
break;
}
if (result === null && i !== targetValueHierarchy.length - 1) {
result = undefined;
break;
}
}
if (result === null) {
return allowNull ? result : fallbackValue;
}
return result !== undefined ? result : fallbackValue;
};
const formatLinkYoutube = url => {
var regExp =
/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/;
var match = url.match(regExp);
return match && match[7].length == 11 ? match[7] : '';
};
const handleOpenUrl = async url => {
// Checking if the link is supported for links with custom URL scheme.
const supported = await Linking.canOpenURL(url);
if (supported) {
// Opening the link with some app, if the URL scheme is "http" the web link should be opened
// by some browser in the mobile
await Linking.openURL(url);
}
};
const formatMonthVietNamLanguage = month => {
const months = [
{
en: 'January',
vi: 'Tháng 1',
},
{
en: 'February',
vi: 'Tháng 2',
},
{
en: 'March',
vi: 'Tháng 3',
},
{
en: 'April',
vi: 'Tháng 4',
},
{
en: 'May',
vi: 'Tháng 5',
},
{
en: 'June',
vi: 'Tháng 6',
},
{
en: 'July',
vi: 'Tháng 7',
},
{
en: 'August',
vi: 'Tháng 8',
},
{
en: 'September',
vi: 'Tháng 9',
},
{
en: 'October',
vi: 'Tháng 10',
},
{
en: 'November',
vi: 'Tháng 11',
},
{
en: 'December',
vi: 'Tháng 12',
},
];
const viMonth = months.filter(item => item.en === month);
return viMonth[0].vi;
};
const formatCurrency = price => {
if (!price || !Number(price)) return;
return price.toLocaleString('vi', {style: 'currency', currency: 'VND'});
};
const getCategoryNotification = category => {
return Object.keys(config.categoryNotification).find(el => el === category);
};
const Utils = {
storeData,
getData,
removeData,
calculateElapsedSeconds,
getValues,
formatLinkYoutube,
handleOpenUrl,
formatMonthVietNamLanguage,
formatCurrency,
getCategoryNotification,
};
export default Utils;
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment