Posts

Showing posts from November, 2024

modal in typescript[reactnative] and design of ecard

 how to create a modal seprate component and use the onPress or other event to other compoent where we do import that component in reactnative using typescript method < View style = { styles . container } >         { /* First Relative Layout */ }         < View style = { [ styles . relativeLayout , styles . hidden ] } >           < View style = { styles . memberDetails } >             { /* Include your member_basic_details_tpa component here */ }           </ View >           < Image             //source={require('../../../vidal-app/assets/images/ecard_images/ecard_icon.png')}             source = { ecardIcon }             style = { styles . ecardImage }             resizeMode = "cover" ...

api.tsreactnative

import { useQuery } from "@tanstack/react-query" import { fetchPostsAPI } from "./api" export const usePosts = () => {     const { data , isLoading , isError , isSuccess } = useQuery ({         queryKey : [ 'fetch-posts' ],         queryFn : fetchPostsAPI     });     return {         data ,         isLoading ,         isError ,         isSuccess     } }

git commands for project

 git checkout -b <your_branch_name>   git add .   git commit -m 'commit message'   git push   [WIP]: ecard-feature

dropdowncomponent use native

  import React from 'react' ; import { StyleSheet , Text , View } from 'react-native' ; import { useForm } from 'react-hook-form' ; import DropdownIcons from '../../components/Dropdown' ; type FormData = {   dropdown : string | null ; // Name of the field in the form }; export default function EcardModule () {   const { setValue , handleSubmit , watch } = useForm < FormData >({     defaultValues : {       dropdown : null , // Default value for the dropdown     },   });   // Watching the dropdown value   const selectedValue = watch ( 'dropdown' );   const handleValueChange = ( value : string | null ) => {     console . log ( 'Selected Value:' , value );     setValue ( 'dropdown' , value ); // Update the form state using setValue   }; //   const onSubmit = (data: FormData) => { //     console.log('Form Data:', data); //   }; ...

dropdownrectnative

  import React from 'react' ; import { StyleSheet , Text , View , Image } from 'react-native' ; import { Dropdown } from 'react-native-element-dropdown' ; type DropdownOption < T > = {   label : string ;   value : T ;   icon : any ; // URL or local path to the icon }; type DropdownIconsProps < T > = {   options : DropdownOption < T >[];   // Options with label, value, and icon   onValueChange : ( value : T ) => void ; // Callback for when a value is selected   selectedValue : string | null ;           // The currently selected value   placeholder ?: string ;             // Placeholder for the dropdown }; function DropdownIcons < T >({   options ,   onValueChange ,   selectedValue ,   placeholder = 'Select an option' , } : DropdownIconsProps < T >) {   // Custom render for dropdown items   const ren...

react native select

 import React from 'react'; import { View, Text, Button, Image, StyleSheet } from 'react-native'; import RNPickerSelect from 'react-native-picker-select'; import { useForm, Controller } from 'react-hook-form'; const App = () => {   const { control, handleSubmit } = useForm();   // Options with paths to images in the asset folder   const options = [     { label: 'SF/VIDAL 2022', value: 'SF/VIDAL 2022', icon: require('./assets/icons/chocolate.png') },     { label: 'SF/VIDAL 2023', value: 'SF/VIDAL 2023', icon: require('./assets/icons/strawberry.png') },     { label: 'SF/VIDAL 2024', value: 'SF/VIDAL 2024', icon: require('./assets/icons/vanilla.png') },   ];   const onSubmit = (data) => {     alert(JSON.stringify(data));   };   return (     <View style={{ padding: 20 }}>       <Text style={{ fontSize: 18, marginBottom: 10 }}>Select Ice Cream Preference</Text> ...

native work assigned

Image
  User name:  gaurav.pandey@vidalhealth.com password:  JHnf$tf9u4#:microsoft account redif:-Vidal@12345 gitpass:Vidal_@123 login-module.tsx 12C:--------------------------- Hamburger Menu-Documents Hamburger Menu-WhatsApp Updates Hamburger Menu - Change Password Hamburger Menu - Terms and Conditions Hamburger Menu - Privacy Policy Vidal App React Native Migration - Hamburger Menu - FAQs Track IPD Cashless Track IPD Claim Pharmacy (Apollo) 12A:------------- ................................................................................ Submit IPD Claim E Card (Download E Card) ........................................................................................................................................... comments:-------------------------------..................................... app:drawer:---- layout.tsx line no 6-10 comment dischargetimeline.jsx:194 login:index.tsx:--15-17 comment https://www.npmjs.com/package/react-native-element-dropdown

angular 18 httpclient

Image
Angular:------- httpClient :library APi methods:--Get,Post,Put,Delete. apiitegration:-- getapi:component :-- .ts:-- appconfig.ts:--- provider:[providerhttpClient] get.api.components:-- userList:any[]=[]; import by two ways:-- http=inject(HttpClient);//injection or construct(private http:HttpClient){//dependency injection } getUser(){ subscribe to catch your data debugger; this.http.get(`url`).subscribe(result:any)=>{ this.userList=result; } } Now call from html file:-- <button (click)=getUser()">click</button> <select> @for(item of userList;track $index){ <option>{item.name}</option> </select> services:---which can be used in no of component  that code u create in service. ng g s department:-- service:-- in your ts file  edit and delete

my current work

 optnow:checking? 4206:---policy type ....................for policy no.... 4207:hospital list: header:--[for the api] 560052:-pincode KA:state 1:city policyNumber:-072200/WIPRO DEMO .....................strHospitalName... 4919/4221:both are working for save... chrome.exe --user-data-dir="C://chrome-dev-disabled-security" --disable-web-security --disable-site-isolation-trials admission:today minimun max 15 discharge: admission datemin 7

react hook form

  import React from 'react' import { useForm } from "react-hook-form" ; import './Style/style.css' ; export default function RF1 () {     const {       register ,       formState : { errors , isSubmitting },       handleSubmit ,             }     = useForm ();     const onSubmit = async ( data ) => {       await new Promise (( resolve ) => setTimeout ( resolve , 5000 ))       console . log ( data );     }   return (     < div >       < form   onSubmit = { handleSubmit ( onSubmit ) } >       < div >       < label htmlFor = "uname" >< b > Username </ b ></ label >       < input type = "text" placeholder = "Enter Username"       className = { errors . uname ? 'input-error' ...