Closed nakitend closed 11 months ago
Facing the same issue on my side.
Additionally, what I see is that VSCode is now currently not automatically detecting the script type when the file is created (i.e., when I create a new file ending with .sql
, the contents inside are not automatically colour formatted based on SQL syntax).
I recommend running the Reset View Locations
command from Command Palette (F1)
import { useState, useEffect } from 'react'; import { View, ScrollView, Text } from 'react-native'; import { Formik, Field } from 'formik'; import { useNavigation } from '@react-navigation/native'; import { TextInput, Snackbar, ActivityIndicator } from 'react-native-paper'; import { useDispatch, useSelector } from 'react-redux'; import DateTimePicker from '@react-native-community/datetimepicker'; import moment from 'moment';
import TopBar from '../../components/TopBar'; import TextField from './../../components/TextField'; import Button from '../../components/Button'; import Select from '../../components/Select';
import Styles from '../../constants/Styles'; import Color from '../../constants/Colors'; import Messages from '../../constants/Messages';
import * as validationSchema from '../../validation/ValidationSchemas'; import { makeSignature } from '../../helpers/makeSignature';
import { addNewAgentFormData } from '../../redux/reducers/formSlice'; import { clearNinDetails, fetchSmileData, setSnackbarVisible, setDob, } from '../../redux/reducers/ninSlice';
function ContactInfo() { const [id, setId] = useState(''); const { agentName } = useSelector((store) => store.ninDataStore); const { dob } = useSelector((store) => store.ninDataStore); const { dateText } = useSelector((store) => store.ninDataStore); const { snackbarVisible } = useSelector((store) => store.ninDataStore); const { snackbarMessage } = useSelector((store) => store.ninDataStore); const { gender } = useSelector((store) => store.ninDataStore); const { isLoading } = useSelector((store) => store.ninDataStore); const ninError = useSelector((store) => store.ninDataStore.error);
const signatureDetails = makeSignature();
const [date, setDate] = useState(new Date()); const [open, setOpen] = useState(false); const [text, setText] = useState('');
const [noNinDob, setNoNinDob] = useState('');
const maxDate = moment().subtract(18, 'years');
const showDatePicker = () => { setOpen(true); };
const onDateSelected = (e, value) => { setOpen(false); console.log(value); setNoNinDob(value); setDate(value); setText(moment(value).format('LL')); };
const genders = [ { label: 'Male', value: '1' }, { label: 'Female', value: '2' }, { label: 'Not Applicable', value: '0' }, ];
const smileData = { source_sdk: 'rest_api', source_sdk_version: '1.0.0', signature: signatureDetails.signature, timestamp: signatureDetails.timestamp, partner_params: { user_id: 'INTS', job_id: 'INT', job_type: 5, }, country: 'UG', id_type: 'NATIONAL_ID_NO_PHOTO', id_number: id, partner_id: '2384', };
const { agentType } = useSelector((store) => store.formDataStore.newAgent); const dispatch = useDispatch(); const navigation = useNavigation();
useEffect(() => { dispatch(clearNinDetails()); }, []);
return ( <View style={[{ zIndex: 1 }, Styles.mainContainer]}> <TopBar title="New Agent" onPress={() => navigation.goBack()} />
<View style={Styles.formContainer}>
<Text style={Styles.h1}>Contact Info</Text>
<ScrollView style={Styles.scrollviewStyle}>
<View
style={{
flexDirection: 'row',
alignContent: 'center',
justifyContent: 'space-evenly',
}}
>
<TextInput
selectionColor={Color.silverChalice}
mode="outlined"
label="Agent NIN"
value={id}
maxLength={14}
onChangeText={(id) => setId(id)}
activeOutlineColor={Color.darkBlue}
style={[Styles.textInput, { width: '50%' }]}
/>
<Button
style={{
width: '45%',
alignItems: 'center',
alignSelf: 'center',
backgroundColor: Color.darkBlue,
borderRadius: 5,
padding: '5%',
}}
textStyle={{ fontSize: 13 }}
onPress={() => {
dispatch(fetchSmileData(smileData));
}}
title="Check NIN"
/>
</View>
{isLoading && (
<ActivityIndicator
size="small"
color={Color.red}
animating={isLoading}
/>
)}
<Formik
enableReinitialize={true}
validationSchema={validationSchema.contactInfoValidationSchema}
initialValues={{
AgentName: agentName,
AgentNin: id,
DateOfBirth: '',
Email: '',
// TIN_No: '',
Sex: gender,
NatureofBusiness: '',
}}
onSubmit={(values) => {
if (ninError === null) {
dispatch(
addNewAgentFormData({
...values,
DateOfBirth: dob,
Sex: gender === 'M' ? 1 : 2,
isNinValidated: true,
NumberOfOutlets: agentType === 'Individual' ? 1 : undefined,
DirectorName:
agentType === 'Individual' ? values.AgentName : undefined,
})
);
} else {
dispatch(
addNewAgentFormData({
...values,
DateOfBirth: new Date(noNinDob).toISOString(),
isNinValidated: false,
NumberOfOutlets: agentType === 'Individual' ? 1 : undefined,
DirectorName:
agentType === 'Individual' ? values.AgentName : undefined,
})
);
}
navigation.navigate(
agentType === 'Individual' ? 'LocationInfo' : 'CompanyInfo'
);
}}
>
{({
handleSubmit,
handleBlur,
errors,
values,
handleChange,
isValid,
}) => (
<>
<Field
component={TextField}
name="AgentName"
label="Agent Full Name *"
editable={!ninError ? false : true}
/>
{ninError && (
<>
<TextInput
label="Date of Birth"
name="DateOfBirth"
value={text}
onPressIn={showDatePicker}
showSoftInputOnFocus={false}
selectionColor={Color.silverChalice}
mode="outlined"
activeOutlineColor={Color.darkBlue}
style={Styles.textInput}
/>
{open && (
<DateTimePicker
value={date}
maximumDate={new Date(maxDate)}
mode={'date'}
display={Platform.OS === 'ios' ? 'spinner' : 'default'}
onChange={onDateSelected}
/>
)}
{text === '' && (
<Text style={Styles.errorText}>
{Messages.requiredMessage}
</Text>
)}
<Field
component={Select}
name="Sex"
label="Gender *"
data={genders}
onValueChange={handleChange('Sex')}
selectedValue={values.Sex}
onBlur={handleBlur('Sex')}
/>
{errors.Sex && (
<Text style={Styles.errorText}>{errors.Sex}</Text>
)}
</>
)}
{!ninError && (
<>
<Field
component={TextField}
name="DateofBirth"
label="Date of Birth"
value={dateText}
editable={ninError === null ? false : true}
/>
<Field
component={TextField}
name="Sex"
label="Gender"
editable={ninError === null ? false : true}
/>
</>
)}
<Field
component={TextField}
name="Phone"
label="Phone Number (07-- --- ---) *"
keyboardType="numeric"
maxLength={10}
/>
<Field
component={TextField}
name="Email"
label="Email"
keyboardType="Email-address"
/>
{/* <Field
component={TextField}
name="TIN_No"
label="Agent TIN"
keyboardType="numeric"
maxLength={10}
/> */}
<Field
component={TextField}
name="NatureofBusiness"
label="Nature of Business *"
/>
<Button
style={Styles.nextButtonStyle}
onPress={handleSubmit}
disabled={!isValid}
title="Next"
/>
</>
)}
</Formik>
</ScrollView>
</View>
<Snackbar
style={[Styles.snackbarStyle]}
action={{
label: 'Please fill in your details',
}}
visible={snackbarVisible}
onDismiss={() => dispatch(setSnackbarVisible(false))}
>
{snackbarMessage}
</Snackbar>
</View>
); }
export default ContactInfo; can someone help me with how i can delete the agent tin from this code please its need quikly
Closing as F1 - Reset View Locations
is all you need, if you still cannot find your explorer let us know
Type: Bug
am not seeing my folder icon in the side bar which i use for opening a folder or workspace
VS Code version: Code 1.85.0 (af28b32d7e553898b2a91af498b1fb666fdebe0c, 2023-12-06T20:48:09.019Z) OS version: Windows_NT x64 10.0.22635 Modes:
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz (4 x 2712)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|3.84GB (0.27GB free)| |Process Argv|--crash-reporter-id 8d3ad055-f4a8-47a3-a525-0526540b6cc0| |Screen Reader|no| |VM|0%|
Extensions (26)
Extension|Author (truncated)|Version ---|---|--- arepl|alm|2.0.5 vscode-opennewinstance|chr|0.0.12 prettier-vscode|esb|10.1.0 file-icons|fil|1.1.0 auto-rename-tag|for|0.1.10 code-runner|for|0.12.1 copilot|Git|1.141.0 copilot-chat|Git|0.11.0 vscode-test-explorer|hbe|2.21.1 auto-comment-blocks|kev|1.0.1 vscode-python-test-adapter|lit|0.8.1 vscode-docker|ms-|1.28.0 csharp|ms-|2.13.10 vscode-dotnet-runtime|ms-|2.0.0 vscodeintellicode-csharp|ms-|0.1.26 autopep8|ms-|2023.8.0 black-formatter|ms-|2023.6.0 python|ms-|2023.22.0 vscode-pylance|ms-|2023.11.10 remote-containers|ms-|0.327.0 test-adapter-converter|ms-|0.1.8 autodocstring|njp|0.6.1 LiveServer|rit|5.7.9 es7-react-js-snippets|rod|1.9.3 vscode-python-test-adapter|Syn|0.0.3 vscode-icons-mac|way|7.25.3A/B Experiments
``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263:30899288 vsclangdc:30486549 c4g48928:30535728 dsvsc012:30540252 azure-dev_surveyone:30548225 3biah626:30602489 89544117:30613380 showlangstatbar:30737416 0bi6i642:30917235 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialogc:30910334 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 dsvsc019cf:30917260 ```