Commit f820ef0a authored by Nguyen Danh Khanh's avatar Nguyen Danh Khanh

Merge branch 'khanhTDT/fix-UI' into 'master'

fix done UI

See merge request !10
parents 68de7bd7 da2c496c
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
import React, { ReactElement } from 'react'; import React, { ReactElement } from 'react';
import { View } from 'react-native'; import { View, TouchableOpacity } from 'react-native';
import styles from './index.style' import styles from './index.style'
......
import { StyleSheet } from "react-native";
const styles = StyleSheet.create({
containerIconBack: {
backgroundColor: "#61A02C",
alignItems: 'center',
justifyContent: 'center'
},
iconBack: {
height: 20,
width: 12,
},
});
export default styles;
\ No newline at end of file
import React, { ReactElement } from 'react';
import { View, Image } from 'react-native';
import styles from './index.style'
type Props = {
}
const IconMedlink = (props: Props) => {
return (
<View style={styles.containerIconBack}>
<Image style={styles.iconBack}
source={require('../../assets/icon/iconHeader/icon-back.png')} />
</View>
);
};
export default IconMedlink;
\ No newline at end of file
...@@ -25,42 +25,7 @@ const App = () => { ...@@ -25,42 +25,7 @@ const App = () => {
const navigation = useNavigation(); const navigation = useNavigation();
//------------------------------------------------------ //------------------------------------------------------
// const [todayRevenue, setTodayRevenue] = useState(0) // doanh thu hom nay
// const [thisMonthRevenue, setThisMonthRevenue] = useState(0) // doanh thu thang nay
// const [lastMonthRevenue, setLastMonthRevenue] = useState(0) // doanh thu thang truoc
// const [todayInvoice, setTodayInvoice] = useState(0)
// const [todayExport, setTodayExport] = useState(0) // hoa don hom nay
// const [totalImport, setTodayImport] = useState(0) // nhap kho hom nay
// const [etd, setEtd] = useState(0) // da het han
// const [ate, setAte] = useState(0) // sap het han
// const [osp, setOsp] = useState(0) // sap het trong kho
// type totalDashboard = {
// today_total_revenue: any| undefined
// this_month_revenue: any | undefined
// last_month_revenue: number
// today_total_invoice: number
// today_total_import: number
// today_total_export: number
// expire_time_products: number
// total_drug_about_to_expire: number
// out_of_stock_product: number
// }
// const totalDashboard = dashboardRequest()
// const a = totalDashboard.today_total_revenue
// setTodayRevenue(totalDashboard.today_total_revenue)
// setThisMonthRevenue(totalDashboard.this_month_revenue)
// setLastMonthRevenue(totalDashboard.last_month_revenue)
// setTodayInvoice(totalDashboard.today_total_invoice)
// setTodayImport(totalDashboard.today_total_import)
// setTodayExport(totalDashboard.today_total_export)
// setEtd(totalDashboard.expire_time_products)
// setAte(totalDashboard.total_drug_about_to_expire)
// setOsp(totalDashboard.out_of_stock_product)
// const revenueAll = dashboardRequest()
// console.log(revenueAll)
// dashboardRequest()
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
const token = useSelector((state:RootState) => state.auth.token) const token = useSelector((state:RootState) => state.auth.token)
......
...@@ -11,11 +11,16 @@ import styles from './index.style'; ...@@ -11,11 +11,16 @@ import styles from './index.style';
import Header from '../../components/Header'; import Header from '../../components/Header';
import IconMedlink from '../../components/IconMedlink'; import IconMedlink from '../../components/IconMedlink';
import HeaderTitle from '../../components/HeaderTitle'; import HeaderTitle from '../../components/HeaderTitle';
import IconBack from '../../components/IconBack';
import { useNavigation } from '@react-navigation/core';
const App = () => { const App = () => {
const navigation = useNavigation()
const _renderHeaderLeft = () => { const _renderHeaderLeft = () => {
return ( return (
<IconMedlink /> <TouchableOpacity onPress={() => navigation.goBack()}>
<IconBack />
</TouchableOpacity>
) )
} }
const _renderHeaderCenter = () => { const _renderHeaderCenter = () => {
......
...@@ -8,8 +8,7 @@ const styles = StyleSheet.create({ ...@@ -8,8 +8,7 @@ const styles = StyleSheet.create({
height: 40, height: 40,
}, },
container: { container: {
paddingBottom: 50, marginBottom: 60,
marginBottom: 50,
}, },
buttonAdd: { buttonAdd: {
height: 150, height: 150,
...@@ -97,9 +96,12 @@ const styles = StyleSheet.create({ ...@@ -97,9 +96,12 @@ const styles = StyleSheet.create({
noteTitleContainer: { noteTitleContainer: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center' alignItems: 'center'
},
buttonSend: {
paddingBottom: 100,
height: 200,
} }
}); });
export default styles; export default styles;
\ No newline at end of file
...@@ -21,12 +21,16 @@ import config from "../../configs" ...@@ -21,12 +21,16 @@ import config from "../../configs"
import ItemCartProduct from '../../components/ItemCartProduct'; import ItemCartProduct from '../../components/ItemCartProduct';
import { RootState } from '../../redux/reducers'; import { RootState } from '../../redux/reducers';
import { Product } from '../../model/cart'; import { Product } from '../../model/cart';
import IconBack from '../../components/IconBack';
const App = () => { const App = () => {
const navigation = useNavigation() const navigation = useNavigation()
const _renderHeaderLeft = () => { const _renderHeaderLeft = () => {
return ( return (
<IconMedlink />
<TouchableOpacity onPress={() => navigation.goBack()}>
<IconBack />
</TouchableOpacity>
) )
} }
const _renderHeaderCenter = () => { const _renderHeaderCenter = () => {
...@@ -168,25 +172,7 @@ const App = () => { ...@@ -168,25 +172,7 @@ const App = () => {
'current_pay': 40000, 'current_pay': 40000,
'note': note, 'note': note,
} }
// const newProduct = {
// base_quantity: 1,
// discount: 0,
// discount_type: "VNĐ",
// discount_unit: 0,
// dosage: products.dosage,
// drg_drug_cd: cartProducts.drg_drug_cd,
// drg_drug_name: cartProducts.drg_drug_name,
// drug_id: cartProducts.drug_id,
// drug_unit_id: cartProducts.drug_unit_id,
// import_price: 0,
// inv_id: cartProducts.inv_id,
// lot: cartProducts.lot,
// price: cartProducts.price,
// promotion_flg: 0,
// quantity: 2,
// unit_id: 14,
// unit_name: "Viên"
// }
console.log('function', cartProducts) console.log('function', cartProducts)
const body = { const body = {
'invoice': invoice, 'invoice': invoice,
...@@ -201,9 +187,6 @@ const App = () => { ...@@ -201,9 +187,6 @@ const App = () => {
const baseURL = config.axiosConfig().baseURL const baseURL = config.axiosConfig().baseURL
try { try {
const response = await axios.post(`${baseURL}/invoice`, body, header) const response = await axios.post(`${baseURL}/invoice`, body, header)
// const totalDashboard = response.data
// console.log('Data: ', response.data)
// console.log('total: ', response.data.today_total_revenue)
console.log(response) console.log(response)
return response return response
} catch (error) { } catch (error) {
...@@ -265,6 +248,9 @@ const App = () => { ...@@ -265,6 +248,9 @@ const App = () => {
{_renderNote()} {_renderNote()}
<Button onPress={() => submit()} title='SEND'></Button> <Button onPress={() => submit()} title='SEND'></Button>
</ScrollView> </ScrollView>
<TouchableOpacity style={styles.buttonSend} onPress={() => submit()}>
<Text>SENDDDDDDDDDDDDDDDDDD</Text>
</TouchableOpacity>
</SafeAreaView> </SafeAreaView>
); );
}; };
......
...@@ -5,8 +5,8 @@ const styles = StyleSheet.create({ ...@@ -5,8 +5,8 @@ const styles = StyleSheet.create({
rightHeader: { rightHeader: {
fontWeight: 'bold', fontWeight: 'bold',
fontSize: 15, fontSize: 14,
color: 'white' color: 'white',
}, },
container: { container: {
alignItems: 'center', alignItems: 'center',
......
...@@ -20,6 +20,7 @@ import { addProductToCart } from '../../redux/actions/cart'; ...@@ -20,6 +20,7 @@ import { addProductToCart } from '../../redux/actions/cart';
import { Cart, Product } from "../../model/cart"; import { Cart, Product } from "../../model/cart";
import { Data } from '../../model/product'; import { Data } from '../../model/product';
import { RootState } from '../../redux/reducers'; import { RootState } from '../../redux/reducers';
import IconBack from '../../components/IconBack';
const App = () => { const App = () => {
...@@ -29,7 +30,9 @@ const App = () => { ...@@ -29,7 +30,9 @@ const App = () => {
//------------------------------------------------------------------- //-------------------------------------------------------------------
const _renderHeaderLeft = () => { const _renderHeaderLeft = () => {
return ( return (
<IconMedlink /> <TouchableOpacity onPress={() => navigation.goBack()}>
<IconBack />
</TouchableOpacity>
) )
} }
const _renderHeaderCenter = () => { const _renderHeaderCenter = () => {
......
...@@ -11,11 +11,15 @@ import IconMedlink from '../../components/IconMedlink'; ...@@ -11,11 +11,15 @@ import IconMedlink from '../../components/IconMedlink';
import HeaderTitle from '../../components/HeaderTitle'; import HeaderTitle from '../../components/HeaderTitle';
import HomeRepositoryItem from '../../components/HomeRepositoryItem' import HomeRepositoryItem from '../../components/HomeRepositoryItem'
import { useNavigation } from '@react-navigation/core'; import { useNavigation } from '@react-navigation/core';
import IconBack from '../../components/IconBack';
const App = () => { const App = () => {
const navigation = useNavigation() const navigation = useNavigation()
const _renderHeaderLeft = () => { const _renderHeaderLeft = () => {
return ( return (
<IconMedlink /> <TouchableOpacity onPress={() => navigation.goBack()}>
<IconBack />
</TouchableOpacity>
) )
} }
const _renderHeaderCenter = () => { const _renderHeaderCenter = () => {
......
...@@ -11,11 +11,17 @@ import styles from './index.style'; ...@@ -11,11 +11,17 @@ import styles from './index.style';
import Header from '../../components/Header'; import Header from '../../components/Header';
import IconMedlink from '../../components/IconMedlink'; import IconMedlink from '../../components/IconMedlink';
import HeaderTitle from '../../components/HeaderTitle'; import HeaderTitle from '../../components/HeaderTitle';
import IconBack from '../../components/IconBack';
import { useNavigation } from '@react-navigation/core';
const App = () => { const App = () => {
const navigation = useNavigation()
const _renderHeaderLeft = () => { const _renderHeaderLeft = () => {
return ( return (
<IconMedlink /> <TouchableOpacity onPress={() => navigation.goBack()}>
<IconBack />
</TouchableOpacity>
) )
} }
const _renderHeaderCenter = () => { const _renderHeaderCenter = () => {
......
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